I have used this linux command to send xml CURL request
curl -f -d
'<REQ>
<FEATURE>COMMON</FEATURE>
<TIME-STAMP>ddmmyyyy HH:MM:SS</TIME-STAMP>
<OPERATION-CODE>DEACTIVATE</OPERATION-CODE>
<CLIENT-TRANS-ID>3256778901</CLIENT-TRANS-ID>
<BODY>
<DATASET>
<PARAM>
<NAME>PRODUCT-CODE</NAME>
<VALUE>T-1234</VALUE>
</PARAM>
<PARAM>
<NAME>CP-ID</NAME>
<VALUE>111</VALUE>
</PARAM>
<PARAM>
<NAME>CHANNEL-ID</NAME>
<VALUE>WAP</VALUE>
</PARAM>
<ADDITIONAL-PARAM>
<PARAM>
<NAME>LANGUAGE</NAME>
<VALUE>1</VALUE>
</PARAM>
<PARAM>
<NAME>KEYWORD</NAME>
<VALUE>LS</VALUE>
</PARAM>
</ADDITIONAL-PARAM>
</DATASET>
</BODY>
</REQ>'
'http://192.168.xx.xxx:8088/HttpAdapter'
It's working fine.
But when I have tried using PHPI am getting Error
$input_xml = "<REQ>
<FEATURE>COMMON</FEATURE>
<TIME-STAMP>ddmmyyyy HH:MM:SS</TIME-STAMP>
<OPERATION-CODE>DEACTIVATE</OPERATION-CODE>
<CLIENT-TRANS-ID>3256778901</CLIENT-TRANS-ID>
<BODY>
<DATASET>
<PARAM>
<NAME>PRODUCT-CODE</NAME>
<VALUE>T-1234</VALUE>
</PARAM>
<PARAM>
<NAME>CP-ID</NAME>
<VALUE>111</VALUE>
</PARAM>
<PARAM>
<NAME>CHANNEL-ID</NAME>
<VALUE>WAP</VALUE>
</PARAM>
<ADDITIONAL-PARAM>
<PARAM>
<NAME>LANGUAGE</NAME>
<VALUE>1</VALUE>
</PARAM>
<PARAM>
<NAME>KEYWORD</NAME>
<VALUE>ls</VALUE>
</PARAM>
</ADDITIONAL-PARAM>
</DATASET>
</BODY>
</REQ>
";
$url = "http://192.168.xx.xxx:8088/HttpAdapter";
//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/xml',
'Connection: Keep-Alive'
));
curl_setopt($ch, CURLOPT_URL, $url);
// Following line is compulsary to add as it is:
curl_setopt($ch, CURLOPT_POSTFIELDS,
"xmlRequest=" . $input_xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
$data = curl_exec($ch);
curl_close($ch);
//convert the XML result into array
$array_data = json_decode(json_encode(simplexml_load_string($data)), true);
print_r('<pre>');
print_r($array_data);
print_r('</pre>');
In this time I am getting "5689 featureID not sent with the request". Fault code is 1003. I am not getting any error in my PHP code. How can I send this xml request using php CURL.