Discussion:
[jboss-user] [JBoss Web Services] - Annotate WebService methodwith optional Header
samhain
2013-03-18 13:16:18 UTC
Permalink
samhain [https://community.jboss.org/people/samhain] created the discussion

"Annotate WebService methodwith optional Header"

To view the discussion, visit: https://community.jboss.org/message/803252#803252

--------------------------------------------------------------
I have a Web Service that needs an optional soap header on its methods, but I don't want to have it required(i.e. nullable ).  The reason for this is because my service will be deployed to multiple environments, some of which will require the header while others will not.

Is it possible to use Java annotations to mark a soap method's header parameter as optional?  If not, can it be accomplished via WSDL modification?

Or is the "correct" way to accomplish this by not defining the header in the WSDL, but instead to tell the clients to send the header with mustUnderstand="0".
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/803252#803252]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
Daniel Cote
2013-03-18 20:19:45 UTC
Permalink
Daniel Cote [https://community.jboss.org/people/daniel.cote.qc.ca] created the discussion

"Re: Annotate WebService methodwith optional Header"

To view the discussion, visit: https://community.jboss.org/message/803345#803345

--------------------------------------------------------------
Hi Samhain,

I always use a SOAPHandlers to make the majority of the adaptations regarding the SOAP headers.
There is an annotation that makes possible to say that a parameter SHOULD be conveyed using headers (@WebParam (header=true) but that is all I'm awared of.  By its nature, it does not seems to express what you were looking for...
By default, not providing a mustUnderstand attribute, the WS stack should recognize the header as optionnal.

This was my 2 cents...

Regards
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/803345#803345]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
Loading...