我正在尝试对天气服务执行一个简单的soap调用,但一直收到无效的ZIP错误。有人能告诉我我做错了什么吗下面是我的代码。
谢谢
require_once 'SOAP/Client.php';
$client = new Soap_Client('http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL');
$method = 'GetCityWeatherByZIP';
$params = array('ZIP' => '07108');
$result = $client->call($method, $params);
if (PEAR::isError($result)) {
echo $result->getMessage();
} else {
print_r($result);
}发布于 2014-07-11 14:42:25
使用PHP内置的SOAP客户端。PEAR中的脚本是在PHP本身没有脚本的时候编写的。
他们的服务不是SOAP服务。The wiki states
$url = "http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityForecastByZIP";
$url .= "?ZIP=" . $this->ZipCode;
$this->response = simplexml_load_file($url) or die("ERROR");https://stackoverflow.com/questions/24678566
复制相似问题