首頁  >  文章  >  後端開發  >  php中,如何通过soap传递两个参数,(ms-security下)

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

WBOY
WBOY原創
2016-06-23 14:01:381042瀏覽

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



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


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


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


怎么传递两个参数啊???


回复讨论(解决方案)

注意大小写 !   

什么大小写,方法or参数

版主的回答给了我启发,在wsdl里看到了要的传的参数,对方在q里说的参数是password,但wsdl里确是pwd,气炸了

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn