<?php
header("Content-type: text/html; charset=utf-8");
$client = new SoapClient(" http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl");
echo "<pre>";
print_r($client->__getFunctions ()) ;//获取WebService提供的函数$param = array('theCityName'=>"台州");
$result = $client->__soapCall('getWeatherbyCityName',array('paramters'=>$param));
echo "<pre>";
print_r($result);
?>网上的天气案例,我现有的WebSevice的<soap:address location>标签指向http://localhost/xxx,如何改成http://ip/xxx,然后再调用
header("Content-type: text/html; charset=utf-8");
$client = new SoapClient(" http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl");
echo "<pre>";
print_r($client->__getFunctions ()) ;//获取WebService提供的函数$param = array('theCityName'=>"台州");
$result = $client->__soapCall('getWeatherbyCityName',array('paramters'=>$param));
echo "<pre>";
print_r($result);
?>网上的天气案例,我现有的WebSevice的<soap:address location>标签指向http://localhost/xxx,如何改成http://ip/xxx,然后再调用
<soap:address location="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx" />
,我现在是局域网内部的服务器是<soap:address location="http://loaclhost/xxxx" />,这样直接调用的话会无法解析,如何把webservice的内容改成<soap:address location="http://192.168.X.X/xxx" />,然后再拿来调用
wsdl 中的内容是通讯的约定,是按规定的格式针对具体的 WebSevice 书写的
你总不能直接复制人家的 wsdl 作为你自己的 wsdl 吧?那里面的方法和数据结构能和你的 WebSevice 服务一样吗?
就打算是一样的,那么如 http://www.webxml.com.cn/WebServices/WeatherWebService.asmx 这样的串,至少要在 wsdl 中出现两次以上,要改都要改