note 91297 added to function.curl-setopt
| From: | ericbianchetti at gmail dot com | Date: | Thu, 04 Jun 2009 10:06:10 +0000 |
| Subject: | note 91297 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156351@lists.php.net to get a copy of this message | ||
if you need to send a SOAP string that is the CURL you must use :
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, XML_POST_URL);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array('SOAPAction: ""'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, XML_PAYLOAD);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
Note : Having based my snipet on Chemo demonstration (oscommerce user know who he is), XML_POST_URL
and XML_PAYLOAD where defined as constant with define().
The point is : at the opposite of .xml , SOAP must send the header 'SOAPAction:
""' that can be a valid URI, an empty string (that is here) or nothing
('SOAPAction: '). The later case baing not accepted by all server, the second one
indicating the target is the URI used to post the SOAP.
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
----
Server IP: 203.121.145.123
Probable Submitter: 58.181.165.129
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/91297
Del: integrated -- https://master.php.net/note/delete/91297/integrated
Del: useless -- https://master.php.net/note/delete/91297/useless
Del: bad code -- https://master.php.net/note/delete/91297/bad+code
Del: spam -- https://master.php.net/note/delete/91297/spam
Del: non-english -- https://master.php.net/note/delete/91297/non-english
Del: in docs -- https://master.php.net/note/delete/91297/in+docs
Del: other reasons-- https://master.php.net/note/delete/91297
Reject -- https://master.php.net/note/reject/91297
Search -- https://master.php.net/manage/user-notes.php