aspkiddy Posted October 8, 2015 Share Posted October 8, 2015 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);] : Unable to parse the specified order data from request body. Unable to parse xml file What must I do for this ? could you help me please have a nice day Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.