Skip to main content

How to change SOAPFault code when sending in invalid XML to JAXWS/Metro

No replies
tmulle
Offline
Joined: 2003-09-11
Points: 0

Hi,
When doing some testing of my webservices I noticed that if I send in unparsable XML to JAXWS/Metro I receive a SOAP Fault which is fine.

But the fault code is "Receiver" and not "Sender" is this correct? I thought the SOAP Standards say this should be technically a client issue.

Is there a way I can control what the code values are? I am using handlers now but I'm guessing they aren't even getting called because the JAXWS/JAXB runtime didn't run because it couldn't parse the incoming xml.

Thanks..
- Tim

Here is the soap fault I'm returned.
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
   <S:Body>
      <S:Fault xmlns:ns4="http://schemas.xmlsoap.org/soap/envelope/">
         <S:Code>
            <S:Value>S:Receiver</S:Value>
         </S:Code>
         <S:Reason>
            <S:Text xml:lang="en">javax.xml.soap.SOAPException: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "sdtud1"
at [row,col {unknown-source}]: [9,27]</S:Text>
         </S:Reason>
      </S:Fault>
   </S:Body>
</S:Envelope>