I am using curl to connect a 3rd party web service and I am getting the correct response.The problem is I can't parse the response into an array and then get the string.
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
the response is
How can get that language code that is English (UK) and the value UK in an array.
Please help.Thanks in advance.
@bbolte Many thanks for the link.I have seen that before.But the problem is that in my case the xml file is not generating and the response body which I can see (from firebug > net panel) is inside my question. Somehow it is not a proper xml I guess.When I do print_r($response) it just prints the html in the browser.
sorry, missed the SOAP stuff. Look into NuSOAP.
This topic is now closed. New replies are no longer allowed.