|
Posted by craigyk on 04/23/07 13:30
I have access to the following web service but always retreive the
same error:-
Array
(
[faultcode] => soapenv:Server.userException
[faultstring] => se.brodit.ws.InvalidUserException
[detail] => Array
(
[hostname] => webserver
)
)
This is the following code (taken from numerous examples)
// Pull in the NuSOAP code
require_once('nusoap/nusoap.php');
$serverpath ='http://www.brodit.se/';
$wsdl = $serverpath . 'Brodit/wsdl/WebService.wsdl';
$param = array(
'userId' => 'xxxxxxxx'
);
// Create the client instance
$client = new soapclient($wsdl, true);
// Check for an error
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
// At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call('getBrandtypes', $param);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}
any help would be grateful. many thanks
craig
Navigation:
[Reply to this message]
|