This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I need to admit that I have not studied much on headers but to get a feeling, I was looking for a good demonstration of using the headers in SOAP request/response. Specially I'm looking for some examples, where and how in built headers are added in non SAAJ way. I mean are there any annotations that can be added, so that headers are automatically added at run time. If yes, can an example be provided for both client and service side.
How about custom headers? Can we add any custom headers to SOAP request/response? What API needs to be extended/implemented for writing custom Headers and how can they be added.
If you want to use generated artifacts, then handlers is a way that you can use to add custom SOAP headers to outgoing messages both on the client and server side.
I suspect, though, that in order to be able to manipulate the SOAP message in the handler code, you will have to use SAAJ or some API that offers similar functionality.
For an example of how to implement a handler that does not add custom headers, see section 9.4 of my study notes. I am sorry, but as far as I recall, I don't have an example of a handler that adds custom headers.