I am using NUSOAP client with a hard coded XML request to communicate with a Server to read a response from a Websphere server. I use nusoap_client->send to send the request.
$result = nusoap_client->send. Then SOAP response is obtained from $result. Perfect. Now I am trying to get a server response from an upgraded server (probably not using Websphere. Not sure). SOAP namespace is also changed and the response has some prefix.
I no longer get the SOAP response from $result (when I run strlen() I get zero size) . But I can call nusoap_client->responseData to get a response below. So I try to parse with simplexml_load_string on PHP5.x but it doesnt seem to parse and error message => syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING. Where could I be going wrong?
$stringer = <<<XML <?xml version='1.0' encoding='ISO-8859-1'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ser:getCarResourceResponse xmlns:ser="http://sos.joburg.com/webservice/ecare/services"> <ser:GetCarResourceReply> <ser:resCode>10652981251</ser:resCode> <ser:departName>Ingolstadt</ser:departName> <ser:resStatus>4</ser:resStatus> <ser:statusDate>2022-05-09 09:24:50</ser:statusDate> <ser:isScheduled>0</ser:isScheduled> <ser:departStatus>0</ser:departStatus> </ser:GetCarResourceReply> <ser:ResultOfOperationReply> <ser:resultCode>0</ser:resultCode> <ser:resultMessage>Successful</ser:resultMessage> </ser:ResultOfOperationReply> </ser:getCarResourceResponse> </soapenv:Body> </soapenv:Envelope> XML; $log->logInfo(print_r(simplexml_load_string($stringer), 1));
XML;in the codeblock included in the response from the server? If so, then this is likely the error and you've to strip it away before parsing.