In php, how to pass two parameters through soap (under ms-security)
$xml = '
admin
PasswordText
'; $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'))));
When the above code is run, an error is prompted.
SoapFault exception: [soap:Server] Fault occurred while processing. in
Later, when the call was made, the other party looked at the log and showed that the username was passed and the password was not passed.
When passing a parameter, the other party can receive it.
$info = turnObjectToArray($this->client->__call('getClasses', array('gradeId' => array('gradeId' => $data['id']))));
How do I pass two parameters ???
Reply to discussion (solution)
Case Sensitive!
Case Sensitive, method or parameter
I was inspired by the answer from the moderator. I saw the parameters to be passed in the wsdl. the parameter that the other party said in q is password, but it is actually pwd in the wsdl.