Response message body
This is the request message body I sent via PHP
<code><?php public function getXml() { $xmlStr = <<<xml <?xml version="1.0" encoding="utf-8"?> <msg v="1.0" id="1470798667"> <ctrl><agentID>800205</agentID><cmd>2000</cmd><timestamp>1470798667</timestamp><md>17468b91d6b9bc1debb052a1f9a66fee</md></ctrl> <body><loto lotoid="001" issue=""/></body></msg> xml; $url = 'http://175.25.25.41:7070/billservice/sltAPI'; $header[] = 'Content-type: text/xml; charset=utf-8'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlStr); $response = curl_exec($ch); if(curl_errno($ch)){ print curl_error($ch); } curl_close($ch); var_dump($response); }</code>
But it cannot be parsed. I don’t know where the problem lies. It always returns such a result.
The analysis result is as shown in the figure: (errorcode = 100) represents the error code
The correct return result is like this. Here I only complete the parsing through form submission, which is normal.
I send an xml message locally but it cannot be parsed. Please help me!
Response message body
This is the request message body I sent via PHP
<code><?php public function getXml() { $xmlStr = <<<xml <?xml version="1.0" encoding="utf-8"?> <msg v="1.0" id="1470798667"> <ctrl><agentID>800205</agentID><cmd>2000</cmd><timestamp>1470798667</timestamp><md>17468b91d6b9bc1debb052a1f9a66fee</md></ctrl> <body><loto lotoid="001" issue=""/></body></msg> xml; $url = 'http://175.25.25.41:7070/billservice/sltAPI'; $header[] = 'Content-type: text/xml; charset=utf-8'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlStr); $response = curl_exec($ch); if(curl_errno($ch)){ print curl_error($ch); } curl_close($ch); var_dump($response); }</code>
But it cannot be parsed. I don’t know where the problem lies. It always returns such a result.
The analysis result is as shown in the figure: (errorcode = 100) represents the error code
The correct return result is like this. Here I only complete the parsing through form submission, which is normal.
I send an xml message locally but it cannot be parsed. Please help me!