PHP部分调用webservice的方法
//php.ini中打开下面3个dll
//extension = php_soap.dll//extension = php_curl.dll//extension = php_openssl.dllheader("content-type:text/html;charset=utf-8");$client = new SoapClient(" http://192.168.1.178:808/ChkWelePsw.asmx?WSDL");//本行测试不可行 $client = new SoapClient(" http://192.168.1.178:808/chkwelepsw.asmx?WSDL/ChkWele?username=test3&psw=123");//参数这样传递 先包装一下$param = array('username'=>'test3','psw'=>'123');//调用必须用__soapCall$p = $client->__soapCall('ChkWele',array('parameters' => $param));print_r($p->ChkWeleResult); //这里先输出一下变量$p,看看是什么类型。?>
.NET部分 webservice要注意的地方
/* *在这个节点中加入如下内容 */ [WebMethod(Description = "This......", EnableSession = false)] public string ChkWele(string username, string psw) { string ret = ""; return ret; }