Let's modify the wsdl generated here to include header message. To do this, we define an element, named requestHeader. Eg.
We create a wsdl complex
data type for this element, with two parameters, username and password as shown
below;
We add the new element and the complex type definition to the wsdl <type> tag,
within the <schema> tag. Eg
We also defined the data or interface for our requestHeader via the <message>
tag. Eg;
We add this data
definition to the message part of the wsdl file; eg
Next, we define <soap:header>
tag for our requestHeader type eg.
Finally, we add this tag as
part of the input for the boom() and getDate() operations immediately after within the <binding>
tag. Eg
This is all we need to add
header message to our WSDL. The complete wsdl file is shown below.
You can check out the updated server example that handles the soap header request.
You can check out the updated server example that handles the soap header request.
Did you find this tutorial useful? Kindly share your comments.
COMPLETE WSDL FILE :
Hi !
ReplyDeleteThe link to the complete wsdl file is invalid, he is linked to your local computer.
Is it possible to have the good one ?
Thanks
Hello Anonymous,
ReplyDeleteThe wsdl file has been added to the tutorial page.
Thanks for stopping by.
Hi,
ReplyDeleteOpening tag (on line 68) porttype and closing tag (on line 77) portType are not same, PHP SOAPServer is giving error.
Thank you for the useful post.
Thanks for the observation. It should be portType too on line 68. The WSDL file has been updated.
Delete