View Full Version : Trouble consuming a .NET web service with nuSOAP

04-25-2006, 05:59 PM
I am trying to consume a web service and am faced with this fault:

soapclient: got wsdl error: phpType is struct, but value is not an array: see debug output for details

My script is below;

require_once('nusoap.php') ;
$client = new soapclient('http://www.regonline.com/webservices/RetrieveSingleRegistration.asmx?wsdl' , true ) ;
$msg = '
<RetrieveSingleRegistration xmlns="http://www.regonline.com/webservices/">

$ns = "http://www.regonline.com/webservices/";

$soapaction = "http://www.regonline.com/webservices/RetrieveSingleRegistration";

$response = $client->call( "RetrieveSingleRegistration" , array($msg), $ns, $soapaction ) ;

echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';

if ( isset( $fault ) ) {
print "Error: ". $fault;
print "no errors";
echo "<br /> <br />Response: " . $response ;

Does anyone have a clue what I'm doing wrong?

04-26-2006, 02:25 AM
It sounds like a parsing problem with the WSDL file itself. Have you considered trying PHP's built in SoapClient (http://www.php.net/soap/)? (although you will need PHP 5)

04-26-2006, 04:48 PM
I have tried it that way, at least I think so and it appears the values passed are read as NULL on the .NET service

05-03-2006, 11:55 AM
The web service apparently gets and successfully reads the passed values, but errors on the response attempt with this message:

soapclient: got wsdl error: phpType is struct, but value is not an array

05-03-2006, 12:21 PM
I had problems with nuSoap and it wanting arrays instead of xml. So I use send() instead and just send the full xml data

$msg = '
?xml version="1.0" encoding="ISO-8859-1"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<RetrieveSingleRegistration xmlns="http://www.regonline.com/webservices/">

$soapclient = new nuSoapclient('http://www.regonline.com/webservices/RetrieveSingleRegistration.asmx');

$soapclient->send($msg, "http://www.regonline.com/webservices/RetrieveSingleRegistration");
$response = $soapclient->response

05-03-2006, 02:00 PM
i also fear you wount be able to fully use the nusoap, and will need to do some of the envelop composing by hand.

check out http://users.skynet.be/pascalbotte/rcx-ws-doc/nusoapadvanced.htm for an example

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum