• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Working with Custom SOAP Headers shows how to do it with Axis2. SOAP headers explains the Metro's way.

Regards,
Dan
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They're reorganizing the java.net site: substitute "metro" for "jax-ws" in the URL.
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



Thanks Lester. Your suggestion worked.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic