For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2007 > webservies, wsdl and nuspoap. Please help









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author webservies, wsdl and nuspoap. Please help
craigyk

2007-04-23, 9:57 pm

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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com