HI,
I use the POST method to send XML Data at web service
Here is my code
$myDataXml = '<item>
<number>445</number>
<itemId>7319</itemId>
<name>GO</name>
<user>
<name>Jean</name>
<lastName>Penn</lastName>
</user>
</item>';
$url_ws = 'https://ourwebservice.com/ws/item/TOTO?id=tototiti&pswd=87963215&xml=';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url_ws);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch,CURLOPT_POSTFIELDS, "xmlRequest=" . $myDataXml);
$dataWS = curl_exec($ch);
if(curl_errno($ch))
{
echo 'CURL ERROR: ' . curl_error($ch);
}
else
{
$getInfo = curl_getinfo($ch);
print_r($getInfo);
}
print_r($dataWS);
curl_close($ch)
It works without problem : I have not error with curl_error($ch)
But web service me send this message by [print_r($dataWS);] :
What must I do for this ? could you help me please
have a nice day