SOAP Client Header : Help!
Good Day!
Any help will be greatly appreciated.
I am consuming a webservice and I am struggling to get around constructing/setting up the client side soap header.
The webservice does not have the soap headers defined on any of the webmetods so i am guessing I will have to construct the soap header on the client side on the fly?
I have searched hi and lo for any samples on doing this but cant seem to get any samples on doing so.
Help!!
Thanks
Answers
Joffies,
According to your question on creating client side soap header, I would like to provide you the example as follows:
SOAP Headers can play an important role in SOAP messages. By using headers, you can separate data that is used by the Web Service but not directly related to the functionality exposed by a given Web Method. Unlike the Body element of a SOAP message, which includes the in and out parameters for the XML Web service method, which are thus processed by the XML Web service method, the Header element is optional and can be processed by the infrastructure. In other words, it is processed by an infrastructure developed to provide a custom authentication mechanism.
The following sample demonstrates how to achieve Custom Authentication using Soap Headers in XML Web Services.
Soap Headers Authentication in Web Services
We have seen in this article how useful Soap Header authentication is for both secure and non-secure Internet scenarios. User credentials are passed within the SOAP header of the SOAP message. The Web server, regardless of the platform hosting the XML Web service, provides a custom authentication implementation.
Also, we have seen that on the consumer/client-side, very little code is required to add a SOAP header into a request. A proxy object does the majority of the work required in adding header details into SOAP messages.
The following example from code project can help you to create a SoapExtension that allows you to insert XML into a SOAP header.
You can also post the related question in .NET Remoting and Runtime Serialization and ASMX Web Services and XML Serialization forums for the further support.
Hope that can help you.
All Replies
Joffies,
According to your question on creating client side soap header, I would like to provide you the example as follows:
SOAP Headers can play an important role in SOAP messages. By using headers, you can separate data that is used by the Web Service but not directly related to the functionality exposed by a given Web Method. Unlike the Body element of a SOAP message, which includes the in and out parameters for the XML Web service method, which are thus processed by the XML Web service method, the Header element is optional and can be processed by the infrastructure. In other words, it is processed by an infrastructure developed to provide a custom authentication mechanism.
The following sample demonstrates how to achieve Custom Authentication using Soap Headers in XML Web Services.
Soap Headers Authentication in Web Services
We have seen in this article how useful Soap Header authentication is for both secure and non-secure Internet scenarios. User credentials are passed within the SOAP header of the SOAP message. The Web server, regardless of the platform hosting the XML Web service, provides a custom authentication implementation.
Also, we have seen that on the consumer/client-side, very little code is required to add a SOAP header into a request. A proxy object does the majority of the work required in adding header details into SOAP messages.
The following example from code project can help you to create a SoapExtension that allows you to insert XML into a SOAP header.
You can also post the related question in .NET Remoting and Runtime Serialization and ASMX Web Services and XML Serialization forums for the further support.
Hope that can help you.


