The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » Metro and JAXB

Thread: getting at the SOAPHeader directly from inside @WebMethod

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 3 - Last Post: Jun 20, 2009 7:00 PM by: Clive Brettingh...
mcs130

Posts: 30
getting at the SOAPHeader directly from inside @WebMethod
Posted: Jun 18, 2009 3:19 AM
 
  Click to reply to this thread Reply

Hello,

Does anyone know of an example that shows how to get at a SOAPHeader from within an @WebMethod annotated method in a service implementation class marked w/ @WebService? I am trying to find away to avoid having to deal with using a "Handler" approach. But need the method to have visibilty to some elements passed in the SOAPHeader. Any suggestions would be appreciated. Thanks.

ramapulavarthi

Posts: 525
Re: getting at the SOAPHeader directly from inside @WebMethod
Posted: Jun 18, 2009 9:35 PM   in response to: mcs130
 
  Click to reply to this thread Reply

See https://metro.dev.java.net/guide/SOAP_headers.html#Accessing_SOAP_headers_for_incoming_messages

mcs130

Posts: 30
Re: getting at the SOAPHeader directly from inside @WebMethod
Posted: Jun 20, 2009 7:28 AM   in response to: ramapulavarthi
 
  Click to reply to this thread Reply

Thank you for the link.

Unfortunately that won't work. This is being done using IBM WAS 7 and their built in runtime implementation is Axis2. Metro endpoints can be deployed to WAS 7 if one packages the jaxws-ri libraries (JARs) in the WEB-INF/lib of the WAR. Of course you have to make sure that the classloader policy for the deployed app in WAS 7 is set to PARENT_LAST so that Axis2 won't intercept the incoming request. That said, right now, the team working on this won't have that option. They have to use the IBM JAX-WS implementation (Axis2).

In addition, that page you refer to is suggesting something that is JAX-WS RI - specific (which seems somewhat counter to the premise of RI - a STANDARD).

Message was edited by: mcs130

Clive Brettingh...
Re: getting at the SOAPHeader directly from inside @WebMethod
Posted: Jun 20, 2009 6:20 PM   in response to: mcs130
  Click to reply to this thread Reply

Well, I don't like to say never, but in several readings of the standard
I have not noticed any specified way to access headers in the endpoint
code (unless is a message mode Provider).

I got the impression that headers are considered metadata that should be
processed by handlers (unless header part); the handlers however, may
pass the results of this processing to the endpoint via the message
context (or other mechanisms like container authentication).

Architecturally it makes sense, though I'll admit it can be a little
inconvenient sometimes, eg to have to write a handler when you only want
to extract a single string valued header.
The RI keeps the list of parsed headers in the context as a byproduct of
the way it does message processing; it is very likely that Axis does
something similar (potentially with different access mechanism), so if
you just need just access in Axis as opposed to portable JAX-WS it is
worth looking into.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net





 XML java.net RSS