users@jax-ws.java.net

Re: server side java ee architecture question

From: Mark Hansen <mark_at_javector.com>
Date: Mon, 06 Mar 2006 17:48:37 -0500

Interesting. Is that a legit use of SAAJ - to add a Fault to a message,
and then throw away the message, and just use the fault to construct a
SOAPFaultException - which ends up getting serialized to a different
SOAP message?

This approach works inside a handler where the MessageContext can be
cast so SOAPMessageContext, but inside the endpoint, that produces a
class cast exception.

Bobby Bissett wrote:

>>
>> The use case is actually getting the SOAPBinding from inside either
>> the handler or the endpoint, so that I can get an instance of
>> SOAPFactory using SOAPBinding.getSOAPFactory(). For generating SOAP
>> Fault message detail elements.
>
>
> A simpler way would be to get the SOAPBody and do addFault(). You can
> get the body from:
>
> SOAPMessageContext.getMessage().getSOAPBody();
>
> Then you can remove the body contents with removeContents() if you'd
> like and then add the fault.
>
> Cheers,
> Bobby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>