问题
I have the following curl which does a SOAP request
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL,"http://uat-api.gafoorkp.in/services/simulator");
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER,true);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($soap_do, CURLOPT_POST,true);
curl_setopt($soap_do, CURLOPT_POSTFIELDS,"<?xml version='1.1'?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:sas='http://uat-api.gafoorkp.in/services/simulator'><SOAP-ENV:Body><sas:Login><Username>demo</Username><Password>demo</Password></sas:Login></SOAP-ENV:Body></SOAP-ENV:Envelope>");
// $report=curl_getinfo($soap_do);
if(curl_exec($soap_do) === false)
{
$err = 'Curl error: ' . curl_error($soap_do);
curl_close($soap_do);
echo $err;
}
else
{
curl_close($soap_do);
echo 'Operation completed without any errors';
print_r($soap_do);
// print_r($report);
}
This code is giving me a response as 'Resource ID #2
' in the browser where Im suppose to get an xml response.Why is this happening,is there something wrong with what im doing?
Also no curl error is returned
来源:https://stackoverflow.com/questions/26066015/curl-returning-resource-id-2-as-response-why