我正在使用 php SOAPClient 从外部服务器调用数据,并使用soapUI 测试和验证了该服务。我的请求似乎可以正常工作,直到它遇到第四个参数,这是一个字符串(前三个是数字)。我的代码和请求如下:
$wdsl = "http://ofmpub.epa.gov/WATERSWebServices/SpatialServices?WSDL";
$client = new SoapClient($wdsl, array(
"trace"=>1,
"exceptions"=>0));
$lat = 46.852783;
$long = -114.004517;
$radius = 1;
$program = '303D';
$values = $client->getEntitiesByLatLong($lat,$long,$radius,$program);
结果请求:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ofmpub.epa.gov/WATERSWebServices/SpatialServices.wsdl">
<SOAP-ENV:Body>
<ns1:getEntitiesByLatLong>
<latitude>46.852783</latitude>
<longitude>-114.004517</longitude>
<searchRadiusMiles>1</searchRadiusMiles>
<programsList />
</ns1:getEntitiesByLatLong>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我相信该服务在这里期待一个字符串。我对代码做错了什么吗?