Best view in Firefox and Chrome

SOAP Header and field additional information

Monday, January 18, 2010
Convert Article to PDFPrint ArticleEmail Article to FrinedBookmark this Article



Can we send some additional Header information in a standard SOAP message. Yeah, we can. Sending the Header information in a SOAP message is a smart way of programing. Through this scenario we can clearly distinguish the processing inputs for the actual business logic and the supporting/utility inputs for a service, in the SOAP message. If you have a close lookup in the WS-Addressing there are using similar technique to give the flexibility to provides the transport-neutral mechanisms to address Web services and messages.

In our scenario we are going to send some additional, but not directly involved in a business logic processing, inputs values in the Header of the SOAP message. For example, we are interesting to identify the source of the location from where the SOAP request was originated. For that we have a unique application ID for each WS client must have to send along with the SOAP message, but this Application ID is actually no needed for the business logic processing. Just to track the Client application. So what we can do is, we can differentiate the Body of the SOAP message to the business logic inputs and we can send the required application ID in the Header section of the SOAP message.

This is the soap message we are going to send to the WS server. Just have a look at the SOAP message, specify in the Header section.

<env:Header><tns:appId>A21313SDF</tns:appId></env:Header>

Alright, The next question is how can we define this header information in the WSDL service contract! Have a look at this shots.
This are the additional fields in the normal WSDL contract. Then by using the Apache CXF, you can easy create the related java classes with this WSDL. For your convenient, I have attached the services Implementation class and WSDL. have a look at get the idea.

Resources :
Person WSDL File
All Related Java Files-Including Generated Class


Read these Articles :

0 comments:

Why Breeze

This is a new technological rhythm in the web. It blooms like a Breeze in your technological face with more than 75 technoligical atricles and guidences.

Contact Me
Contact Me Send an Email Facebook Account LinkedIn profile Twitter/Shayanth
Share And Save
Social Share with Twitter Facebook Share Add to Google Save on Delicious
Get Updates

The RSS will facilitate you to get the updates from Breeze. Click Here to redirect to the RSS link.

Designed by Posicionamiento Web | Bloggerized by GosuBlogger | Blue Business Blogger | Customized by SHAUOM