Re: How to set a SOAP fault message's faultcode element

From: Simon Horrell <>
Date: Fri, 24 May 2002 08:38:35 +0100

OK, so I see that SOAPFaultException changed from a checked to a runtime
exception after the 0.7 release of the spec and is no longer tied to literal
representation. I am happy and await the FCS release.

----- Original Message -----
From: "Simon Horrell" <simonh_at_DEVELOP.COM>
Sent: Thursday, May 23, 2002 6:32 PM
Subject: How to set a SOAP fault message's faultcode element

> I am trying to figure out how to pass back a specific faultcode to a
> within a SOAP fault message. The RI uses a faultcode of env:Server
> (xmlns:env="") for
> exceptions and it doesn't seem possible for me to influence this and pass,
> for example, env:Client.
> I tried throwing a SOAPFaultException in my method implementation and
> setting the faultcode programmatically. Of course, because
> SOAPFaultException is a checked exception, this meant that the method in
> Java service definition interface had to throw SOAPFaultException as part
> its signature. Fair enough. The RI's xrpcc tool complained that
> SOAPFaultException was not supported as an exception type.
> Next, I authored the WSDL and made the faults 'literal' to try and force
> xrpcc to generate a method that threw SOAPFaultException but xrpcc ignored
> it.
> Of course, even if either of these techniques had worked I would end up
> a 'literal' fault on the wire which isn't necessarily what I require.
> What is the generally accepted technique for doing this?
> Si.