Re: soapclient method to .net server returns object not xml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roland skrev:

$client = new SoapClient("http://foo.asmx?WSDL";);
echo $client->foo();

Returns an stdObject when I want xml. If I call the same url not using soap I
do get xml.
Try:

$client = new SoapClient("http://foo.asmx?WSDL";);
var_dump($client->foo());

and you'll see the result.

If you want to have a look at the actual SOAP messages you should either add 'trace' => 1 in the options-array to the SoapClient constructor and call:

echo $client->__getLastRequest();
echo $client->__getLastResponse();

Or simply use the ngrep tool.

If you want to get the class names right for the return values you need to use the classmap option. wsdl2php can help you with that ;)

I have been trying something like this:
$client = new SoapClient("http://foo.asmx?WSDL";, array('encoding' =>
'literal'));

But I get an invalid encoding error.
It's correct that .NET uses the doc/literal message encoding, but the 'encoding' option in SoapClient is related to the charset encoding.

If you read the manual you see that you should use 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL to use doc/literal with ext/soap.

See http://no.php.net/manual/en/function.soap-soapclient-construct.php for all options.

Best regards,
Knut Urdalen
http://www.urdalen.com

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux