JAX-WS: when input soap validation fails

Posted by Jakob on Stack Overflow See other posts from Stack Overflow or by Jakob
Published on 2010-01-28T20:03:46Z Indexed on 2010/05/16 2:00 UTC
Read the original article Hit count: 316

Filed under:
|

I have created a web service with JAX-WS. When the input SOAP message is not well formed or can not be validated, a soap fault is returned automatically to the caller. I dont want the caller to receive this standard SOAP message but i want to create an own custom SOAP fault.

So if the call looks like this (note Envelope1, its not valid): hello

a default return message is something like this: S:Client Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://schemas.xmlsoap.org/soap/envelope/}Envelope1

I want the return message to be something like this: S:Client My own custom SOAP message!

I have tried to get this to work the whole day, but i cant figure out how to do it. So if someone could help me I would be really glad!

© Stack Overflow or respective owner

Related posts about jax-ws

Related posts about webservice