Excuse me for my english, I'm french.
I have a great problem and I don't find any solution.
I can't read the double response of a web service with NuSOAP.
This is the response :
<tns:Se…teMsgOut xmlns:tns="…" xmlns:xsi="…">
I can acces the part in italic, but not the one underlined.
This is the method that I use to read the answer :
$login = array('user' => 'xxx', 'pass' => 'xxx');
$param = array('fullname' => 'blablabla', 'passwd' => 'truc');
$client = new nusoap_client("http:// … .wsdl",true);
$client->soap_defencoding = 'UTF-8';
$result = $client->call('Se…te', array('login'=> $login,'param'=>$param));
this is the result that I get :
Array ( =>blablabla => truc )
I don't have the second part.
Please how can I do to have the second part too in my response ?
NuSOAP does not directly support output parameters. It parses the first child of the SOAP Body as the response returned from call(). When you need access to the full SOAP response, use $client->responseData which you may parse yourself.
Thank you very much snichol, it's exactly what I need.
Is it possible to have this result in an assiociative array ?
@celineodm you get the response as XML (with the envelope) and the result in the Array, and that's it.
The response from
(with and without header info)
looks like this:
<?xml version="1.0" encoding="iso-8859-1"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/BLAH" xmlns:types="http://tempuri.org/BLAH" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressin
If you asign the call to a variable:
$resp = $soapClient->call($methodName,$paramsArray)
$resp is an Array that contains the contents of the XML response, for example:
It would be nice to have the XML contents (not the full soap response) in a variable.