dev@jax-ws.java.net

SOAPFault headers? (and SOAPFault in general)

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Thu, 07 Dec 2006 16:02:43 -0500

I have an addressing enabled SEI that simply throws a SOAPFaultException.
The actual fault on the wire seems to be missing all header information
that I was expecting to see (namely To, RelatesTo, and Action):

<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
     <ns2:Fault xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
       <faultcode xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">wscoor:InvalidState</faultcode>
       <faultstring>The message was invalid for the current state of the activity: Some message</faultstring>
     </ns2:Fault>
   </S:Body>
</S:Envelope>

This sounds very similar to an issue Bobby reported[1].

Also, even though I specify a locale when I set the fault string, xml:lang
isn't being marshalled in <faultstring> (see above).

One final question: suppose that I want to dispatch a SOAPFault to an EPR
rather than throw a SOAPFaultException. Beyond simply creating a new
SOAPFault object and setting the faultcode and faultstring, how do I go
about setting the required headers such as To, RelatesTo, and Action?

I'm running all the latest and greatest versions of everything in the
stack (wsit, jax-ws, jaxb, saaj, gf, etc). I'm creating SOAP 1.1 faults
and I'm using 2004 Addressing.

Thanks,

--Ryan

[1] https://jax-ws.dev.java.net/issues/show_bug.cgi?id=93