Skip to main content

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

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2003-09-11

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.

- Tim

Here is the soap fault I'm returned.
<S:Envelope xmlns:S="">
      <S:Fault xmlns:ns4="">
            <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>