I´ve recently started looking a web service calls using PHP. I can´t get the following rather simple snippet to work, instead the web service returns an exception.
<?php
$client = new SoapClient("http://www.webservicex.net/geoipservice.asmx?wsdl");
print($client->__soapCall("GetGeoIP", array('IP' => '83.251.30.62')));
?>
I´ve also tried the simpler $client->GetGeoIP('83.251.30.62');
but they both yield the same result.
Is there something wrong with my code? Exception below:
Fatal error: Uncaught SoapFault exception: [soap:Server]
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: input at System.Text.RegularExpressions.Regex.IsMatch(String input) at
WebserviceX.Service.Adapter.IPAdapter.CheckIP(String IP) at
WebserviceX.Service.GeoIPService.GetGeoIP(String IPAddress) --- End of inner exception
stack trace --- in C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\isolda\test.php:16 Stack trace: #0 C:\Program Files
(x86)\Apache Software Foundation\Apache2.2\htdocs\isolda\test.php(16): SoapClient-
>__soapCall('GetGeoIP', Array) #1 {main} thrown in C:\Program Files (x86)\Apache
Software Foundation\Apache2.2\htdocs\isolda\test.php on line 16