File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Problem with mapping headers on WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with mapping headers on WSDL" Watch "Problem with mapping headers on WSDL" New topic

Problem with mapping headers on WSDL

Marcelo Tataje
Ranch Hand

Joined: Jan 31, 2011
Posts: 64

Hello everybody, I'm here because I'm facing a problem taht I don't know how to solve and maybe, you can help me with this. The escenario for me is the following:

I have a WSDL File which is mapping SOAP like this:

That's the way I'm mapping the Binding for my operation called Create operation that describes the body and the headers.

Then I can map like this:

This in effect makes the header elements part of the interface contract - in Java terms these elements are mapped to
parameters in the signature of the Java service interface method for "Create" operation.

However, somebody's telling me that this is not the only possible mapping and it could generate some problems. (I've already tested that and it's causing me problems). Then, I was told that the alternative is to leave these elements as headers, to be dealt with in header processing code separate from the business code that deals with the body.

Do you know what this means? I will be really grateful if you can help me please.

Thanks in advance.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Headers of a SOAP message are not part of the contract of a web service, since they may not be required, may be targeted at a specific node in the chain leading to the web service (intermediary).
Headers are used to send and receive additional information, such as security tokens, transaction information or additional information related to message delivery guarantee etc.
Best wishes!

My free books and tutorials:
I agree. Here's the link:
subject: Problem with mapping headers on WSDL
It's not a secret anymore!