If you're talking about fault codes then yes, in SOAP 1.2 the
soapenvCode_at_Value is an enum of fixed fault codes[1]. IF you want your
own codes they should appear inside Subcode.
"The values of the |Value| child /element information item/ of the
|Code| /element information item/ are restricted to those defined by the
|env:faultCodeEnum| type (see *Table 4*
<
http://www.w3.org/TR/soap12-part1/#tabsoapfaultcodes>). Additional
fault subcodes MAY be created for use by applications or features. Such
subcodes are carried in the |Value| child /element information item/ of
the |Subcode| /element information item/."
I think there is similar requirement in SOAP 1.1 too but there you can
extend it, for example Client.BadRequest - Client is defined by SOAP 1.1
and BadRequest is application defined.
-vivek.
[1]
http://www.w3.org/TR/soap12-part1/#faultcodes
Arun Gupta wrote:
> One of the interop scenarios require the service endpoint to populate
> a custom fault code. Our SOAP 1.2 implementation is throwing a
> SOAPFaultException on that (stack trace below). SAAJ seems to restrict
> the fault codes to only the list given in the spec. I could not find
> such a requirement in the SOAP 1.2 spec [1].
>
> This is happening in SOAP 1.2 only. SOAP 1.1 implementation does not
> seem to be restricting the list of faultcodes that can be specified
> which seems the correct behavior to me. Here is the stack trace:
>
> Caused by: javax.xml.ws.addressing.AddressingException:
> com.sun.xml.messaging.saaj.SOAPExceptionImpl: {http://example.or
> g/echo}EmptyEchoString is not a standard Code value
> at
> w3c.s12.server.WsaTestImpl.createSOAPFault(WsaTestImpl.java:83)
> at w3c.s12.server.WsaTestImpl.echo(WsaTestImpl.java:70)
> ... 37 more
> Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl:
> {http://example.org/echo}EmptyEchoString is not a standard Code
> value
> at
> com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl.checkIfStandardFaultCode(Fault1_2Impl.java:115)
>
> at
> com.sun.xml.messaging.saaj.soap.impl.FaultImpl.setFaultCode(FaultImpl.java:105)
>
> at
> com.sun.xml.messaging.saaj.soap.impl.FaultImpl.setFaultCode(FaultImpl.java:119)
>
> at
> w3c.s12.server.WsaTestImpl.createSOAPFault(WsaTestImpl.java:79)
> ... 38 more
>
> Am I missing some requirement from the spec ? If not then this needs
> to be fixed.
>
> [1] http://www.w3.org/TR/2003/REC-soap12-part1-20030624/#faultcodes
>
> -Arun
--
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.