Home >Backend Development >PHP Tutorial >php中,怎么通过soap传递两个参数,(ms-security下)

php中,怎么通过soap传递两个参数,(ms-security下)

WBOY
WBOYOriginal
2016-06-13 11:49:33914browse

php中,如何通过soap传递两个参数,(ms-security下)

<br />$xml = '<br />            <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><br />            <wsse:UsernameToken><br />            <wsse:Username>admin</wsse:Username><br />            <wsse:Password>PasswordText</wsse:Password><br />            </wsse:UsernameToken><br />            </wsse:Security>';<br /><br />        $header = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'CallbackHandler', new SoapVar($xml, XSD_ANYXML), TRUE);<br /><br />        $this->client = new SoapClient($wsdl);<br />        $this->client->__setSoapHeaders(array($header));<br /><br />        $userInfo = turnObjectToArray($this->client->__call('checkUser', array('username' => array('username' => 'username', 'password' => 'password'))));<br /><br />



一运行上述代码,就提示出错
<br />SoapFault exception: [soap:Server] Fault occurred while processing. in <br />


后来连调时,对方看了下log,显示就把username传过去了,password没传过去


传递一个参数时对方是可以接收到的
<br />$info = turnObjectToArray($this->client->__call('getClasses', array('gradeId' => array('gradeId' => $data['id']))));<br />


怎么传递两个参数啊???
------解决方案--------------------
注意大小写 !   

Statement:
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