| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/HostingSpaces/admin/sms4real.com/wwwroot/soap/ |
Upload File : |
<?php
$url = "http://www.webservicex.net/geoipservice.asmx?WSDL";
//$url ="http://www.webservicex.net/geoipservice.asmx?op=GetGeoIP";
$fields ='POST /geoipservice.asmx HTTP/1.1 Host: www.webservicex.net Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.webservicex.net/GetGeoIP" <?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:Body><GetGeoIP xmlns="http://www.webservicex.net/"><IPAddress>"70.35.207.112"</IPAddress></GetGeoIP></soap:Body></soap:Envelope>';
$curl = curl_init($url);
//curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($curl, CURLOPT_URL, $url);
//curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl,CURLOPT_TIMEOUT,120);
curl_setopt($curl,CURLOPT_ENCODING,'gzip');
curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl,CURLOPT_HTTPHEADER,array (
'SOAPAction:"http://www.webservicex.net/GetGeoIP"',
'Content-Type: text/xml; charset=utf-8',
));
curl_setopt ($curl, CURLOPT_POST, 1);
curl_setopt ($curl, CURLOPT_POSTFIELDS, $fields);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
var_dump ($response);
print_r(json_decode($response));
//print_r $response;
// Check if any error occurred
if (!curl_errno($curl)) {
$info = curl_getinfo($curl);
echo 'Took ', $info['total_time'], ' seconds to send a request to ', $info['url'], "\n";
//var_dump($info);
}
var_dump($response);
//$xml = new SimpleXMLElement($response);
//print_r($xml);
curl_close($curl);
?>