Very urgent ..help to get this response
We are tried the xml api call with curl function,but I Can't get xml repsonse from this & I got a response like sequence format
Code format are:
- <?php
- $soapUrl = "http://locationinfo.addtech.in/LocationInfo.asmx?op=ADDGetLiveData";
- $soapUser = ".......";
- $soapPassword = "........";
- $lIMEI = ".........";
- $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Header>
- <Authentication xmlns="http://ADDtech.org/">
- <User>'.$soapUser.'</User>
- <Password>'.$soapPassword.'</Password>
- </Authentication>
- </soap:Header>
- <soap:Body>
- <ADDGetLiveData xmlns="http://ADDtech.org/">
- <lIMEI>'.$lIMEI.'</lIMEI>
- </ADDGetLiveData>
- </soap:Body>
- </soap:Envelope>';
- $headers = array(
- "Content-type: text/xml;charset=\"utf-8\"",
- "Accept: text/xml",
- "Host: locationinfo.addtech.in",
- "Cache-Control: no-cache",
- "Pragma: no-cache",
- "SOAPAction: http://ADDtech.org/ADDGetLiveData",
- "Content-length: ".strlen($xml_post_string),
- );
- $url = $soapUrl;
-
- $ch = curl_init();
-
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml;charset=\"utf-8\"'));
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
-
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
-
-
- $response = curl_exec($ch);
- curl_close($ch);
- print_r($response);
- ?>
Now Got a Response like:
8.70418078.01902507/Mar/2019 10:42:16 AM0.00OffGPSNorth100%Strong SignalPower Connected
Actually we want response like :
- <?xml version="1.0" encoding="utf-8"?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <ADDGetLiveDataResponse xmlns="http://ADDtech.org/">
- <ADDGetLiveDataResult>
- <Latitude>11.713210</Latitude>
- <Longitude>78.083677</Longitude>
- <PositionTime>04/Mar/2019 04:20:46 PM</PositionTime>
- <Speed>25.00</Speed>
- <ACC>Off</ACC>
- <PositionType>GPS</PositionType>
- <Direction>NorthWest</Direction>
- <Battery>100%</Battery>
- <GSMStrength>Strong Signal</GSMStrength>
- <PowerStatus>Power Connected</PowerStatus>
- </ADDGetLiveDataResult>
- </ADDGetLiveDataResponse>
- </soap:Body>
- </soap:Envelope>
Any help is greatly appreciated. Thanks for looking.