To process soap header request in our PHP SOAP Server Example, we will add to our PHP server class, a function with the same name as the header element we are trying to process. Please ensure that you are using the latest version of PHP to avoid any weird behaviour.
See How To Add Header Message To WSDL, on how we created the header element. For this example, our header element is named, requestHeader. So we will create a function in our server class, with the same name, requestHeader.
The requestHeader element is a complexType with two parameters, which we can process in php as an associative array with two keys.
Our requestHeader function
will be called if soap request contains "requestHeader" in SOAP header. For
demonstration, we simply stored the requestHeader parameters, username and
password, in a private variable, headerInfo, and returned this info back to the
client in the boom() function. See the complete server codes below;
The updated client version, on how to add SOAP Header request to PHP SOAP Client, will be available soon.
Hi, Please any help me
ReplyDeletewsdl authentication [requestHeader function ]not working for me.
Thanks in advance