vincenzobar
June 6th, 2006, 09:21 AM
I have a XML document i want to pass to my Soap server. I am using cURL. But all i get in return is "1"
I need to get back the XML generated by the server. How do i do this? here is my cURL so far
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, client_info($urlSetting, $sSoapAction, $username, $password, $partnerId, $productId, $ratePlanId, $responseGroups, $zipcode));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // process page
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
}
curl_close($ch);
echo $postResult;
What i get back is:
HTTP/1.1 100 Continue HTTP/1.1 400 Bad Request Date: Tue, 06 Jun 2006 14:18:14 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Transfer-Encoding: chunked Cache-Control: private Content-Type: text/html
Do i need to store a cookie with the header info?
I think i am using POSTFIELDS wrong because that is just the generated XML and not a query string.
How do i pass XML to a service in cURL?
Arg... this is my last step and i can't get it, any help is much appreciated!!!
I need to get back the XML generated by the server. How do i do this? here is my cURL so far
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, client_info($urlSetting, $sSoapAction, $username, $password, $partnerId, $productId, $ratePlanId, $responseGroups, $zipcode));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // process page
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
}
curl_close($ch);
echo $postResult;
What i get back is:
HTTP/1.1 100 Continue HTTP/1.1 400 Bad Request Date: Tue, 06 Jun 2006 14:18:14 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Transfer-Encoding: chunked Cache-Control: private Content-Type: text/html
Do i need to store a cookie with the header info?
I think i am using POSTFIELDS wrong because that is just the generated XML and not a query string.
How do i pass XML to a service in cURL?
Arg... this is my last step and i can't get it, any help is much appreciated!!!