Announcement Announcement Module
Collapse
No announcement yet.
namespace in SoapFault annotation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • namespace in SoapFault annotation

    Hi everyone,

    According to WS-I Basic Profile 1.1
    R1004 When an ENVELOPE contains a faultcode element, the content of that element SHOULD be either one of the fault codes defined in SOAP 1.1 (supplying additional information if necessary in the detail element), or a Qname whose namespace is controlled by the fault's specifying authority (in that order of preference).
    example:
    Code:
    <soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
                xmlns:c='http://example.org/faultcodes' >
      <faultcode>c:ProcessingError</faultcode>
      <faultstring>An error occured while processing the message
      </faultstring>
    </soap:Fault>
    The SoapFault annotation accepts a custom code. Is there a way to specify a namesapce to qualify the custome code?

  • #2
    Apologies! Found it by reading through the code of SoapFaultAnnotationExceptionResolver. Maybe this should be mentioned in the api doc.

    Comment


    • #3
      I'll apologize in advance... I'm looking at the code and I still don't see how the namespace can be specified for a custom fault.

      What did you find?

      Ken

      Comment


      • #4
        SoapFaultAnnotationExceptionResolver uses javax.xml.namespace.QName.valueOf for custom fault codes.
        So you have to write something like this:
        Code:
        @SoapFault(faultCode=FaultCode.CUSTOM, customFaultCode="{http://www.whatever.com}customCode")

        Comment

        Working...
        X