0
我使用php SOAPClient從外部服務器調用數據,並使用soapUI測試並驗證了該服務。我的請求似乎正常工作,直到它遇到第四個參數,這是一個字符串(前三個是數字)。我的代碼,並要求低於:soapclient請求不完整
$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>
相信該服務在這裏期待一個字符串。有什麼我做了錯誤的代碼?
通過文檔回過頭來看,它看起來像它期待字符串數組,所以我已將$ program更改爲:array('303D');.標籤顯示爲完整: 303D ,但沒有響應。 –
user2305316
2013-04-30 00:58:48