aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes How to add custom headers to SOAP request/response in JAX-WS Metro Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "How to add custom headers to SOAP request/response in JAX-WS Metro " Watch "How to add custom headers to SOAP request/response in JAX-WS Metro " New topic
Author

How to add custom headers to SOAP request/response in JAX-WS Metro

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hello All,

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.

Can some examples be provided here?

Thanks

Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Working with Custom SOAP Headers shows how to do it with Axis2. SOAP headers explains the Metro's way.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Dan Drillich wrote:Working with Custom SOAP Headers shows how to do it with Axis2. SOAP headers explains the Metro's way.

Regards,
Dan


Thanks Dan. But unfortunately the link for Metro's way seem to be missing.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
They're reorganizing the java.net site: substitute "metro" for "jax-ws" in the URL.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Lester Burnham wrote:They're reorganizing the java.net site: substitute "metro" for "jax-ws" in the URL.


Thanks Lester. Your suggestion worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to add custom headers to SOAP request/response in JAX-WS Metro