Home > Backend Development > PHP Tutorial > 这个wsdl该怎么使用?PHP>soapclient

这个wsdl该怎么使用?PHP>soapclient

WBOY
Release: 2016-06-23 13:52:18
Original
1026 people have browsed it

地址:http://in.commchina.net:8071/service.asmx?WSDL
查找出函数: var_dump($soap->__getFunctions());
得到: "Login Login(LoginWrapper $parameters)"
查询函数参数:var_dump($soap->__getTypes());
得到:"struct LoginWrapper {string _xml;}"
说明书输入xml描述:

号码不能为空
密码不能为空


使用代码如下:
       $arr = array(
 'Param'=>array(
'Number'=>'4*******',
 'Pwd'=>'********'
 )
  );
       try{ 
        $wsdl = 'http://in.commchina.net:8071/service.asmx?WSDL';
        $soap = new  SoapClient($wsdl);
        $res=$soap->Login(array('_xml'=>$arr));
       }catch(Exception $e){  
        print_r($e->getMessage(),true);  
      }

错误提示:服务器无法处理请求。 ---> 根级别上的数据无效。 行 1,位置 1。


回复讨论(解决方案)

Login Login(LoginWrapper $parameters)

struct LoginWrapper {
 string _xml;
}

$param = array( '_xml' => '
号码不能为空
密码不能为空
');

 $res=$soap->Login(param);

 $res=$soap->_call('Login', array($param));

 $res=$soap->_soapcall('Login', array($param));

?考: http://blog.csdn.net/fdipzone/article/details/21810347

$res = $soap->Login($param);

$res = $soap-> __soapCall('Login', array($param));

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template