Skip to main content

Adding Soap Headers to responses in service implementation

3 replies [Last post]
Anonymous

https://jax-ws.dev.java.net/guide/SOAP_headers.html#Adding_SOAP_headers_...

We are using jax-ws 2.2 version and we need to set couple of fields in the
response header.
We cannot change the WSDL and this is published by a standard company and we
are just implementing it.

The above mentioned url indicates that metro does not have the ability to
add Soap Headers to responses.
Is this correct?

Is there a way from MessageContext or from Serverside SoapHandlers can we
add SoapHeaders to response.

Please answer this at the earliest as we are stuck in our implementation.
Adding headers on Soap responses and Faults is a must. The client side code
expects this

regds,
Chiths
--
View this message in context: http://old.nabble.com/Adding-Soap-Headers-to-responses-in-service-implem...
Sent from the Metro - Users mailing list archive at Nabble.com.
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Glen Mazza

http://www.jroller.com/gmazza/entry/jaxws_handler_tutorial, Step #3 and Step
#5 in particular.

BTW, even though you cannot change the WSDL *officially*, in many cases,
such as adding headers to operation calls, you *can* tweak it just when
running wsimport (wsdl-to-java) so the Java classes will have parameters you
can use to add the headers:
http://www.jroller.com/gmazza/entry/using_implicit_soap_headers_with .
However doing this is sometimes easy, sometimes quite complex.

HTH,
Glen

CHITHS wrote:
>
> https://jax-ws.dev.java.net/guide/SOAP_headers.html#Adding_SOAP_headers_...
>
> We are using jax-ws 2.2 version and we need to set couple of fields in the
> response header.
> We cannot change the WSDL and this is published by a standard company and
> we are just implementing it.
>
> The above mentioned url indicates that metro does not have the ability to
> add Soap Headers to responses.
> Is this correct?
>
> Is there a way from MessageContext or from Serverside SoapHandlers can we
> add SoapHeaders to response.
>
> Please answer this at the earliest as we are stuck in our implementation.
> Adding headers on Soap responses and Faults is a must. The client side
> code expects this
>
> regds,
> Chiths
>

--
View this message in context: http://old.nabble.com/Adding-Soap-Headers-to-responses-in-service-implem...
Sent from the Metro - Users mailing list archive at Nabble.com.

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

CHITHS

Hello Glen..

Thanks for the suggestion, I followed your suggestion and of modifying the
WSDL and using the xadditionalHeaders="true" option in wsimport for the
Server side artificacts.

I tested the invocation from the client first by using the stubs generated
with the xadditionalHeaders="true" option in wsimport and it worked.

I then generated the client stub without the xadditionalHeaders="true" and
then added the header info via DOM API in a SoapHandler (client side) and
tested the the service invocation and I could validate the header in the
response using the WSBindingProvider.

This is cool, however to make the implementation as easy as the websphere's
implementation (adding a Map in wscontext), would it not be
worthwhile to provide the access to add off hand headers to the response in
the server side impl and not having to go the code generation part when some
additional requirements (in terms of headerr info) are added.
The WSDL being used is from a standards body and being implemented by a
large number of service providers (akin to a federated search across
catalogues).
Kindly please explore the possibility of adding adhoc header information to
the responses.

Thanks and regds,
Chiths
--
View this message in context: http://old.nabble.com/Adding-Soap-Headers-to-responses-in-service-implem...
Sent from the Metro - Users mailing list archive at Nabble.com.

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

ahmad_nk01
Offline
Joined: 2013-02-05
Points: 0

Thanks for Hint, it really helped. :)