繁体   English   中英

SOAP请求使用PHP失败

[英]SOAP Request fails using PHP

我想从此Web服务使用一个简单的SOAP请求:

http://www.webservicex.net/geoipservice.asmx

System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> System.NullReferenceException:对象引用未设置为对象的实例。 在WebserviceX.Service.GeoIPService.GetGeoIP(String IPAddress)处的WebserviceX.Service.Adapter.IPAdapter.CheckIP(String IP)

这是我从Web服务获得的异常 ,这是我的代码:

    $wsdl = 'http://www.webservicex.net/geoipservice.asmx?WSDL';
    $soap = new SoapClient($wsdl);

    $functions = $soap->__getFunctions();
    $types = $soap->__getTypes();

    $parameters = array("IPAddress"=> "exampleIPAddress");
    $response = $soap->GetGeoIP($parameters);

当然,使用的是真实的ip地址,而不是“ exampleIPAddress”。

谢谢

肥皂服务器端似乎有一个错误(感谢James)。 我尝试了另一个IP地址,并且效果很好。 也许不支持某些IP区域:D

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM