-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Thilina,
Please see comments inline. Thilina Gunarathne wrote: > Hi all, > Recently I tried throwing an exception from an custom written Axis2 > message receiver. I was using SOAP12. But my Axis2 client was unable > to parse the resulted SOAPFault correctly... By inspecting the > messages I noticed that the SOAPFault was sent with a http-400 status > code, which made the client to ignore the body content of the message > after parsing only the http error codes... > > * Further debugging showed me Axis2 defaults to FaultCode Sender if > the faultcode is null and if the there isn't a SOAPEnvelope (line 484- > MessageContextBuilder), which is the exact case when throwing an > exception from the messageReceiver... Yes this I did intentionally. The reason is that if there is no fault code, what will be the default fault code? When I was writing this code I searched this in SOAP 1.2 spec[1] and WS-I BP also but couldn't find one. So I assumed whatever the service implementation is always correct and it is client that is always wrong if there is a problem :). Well you have to make either the sender or receiver guilty if you have to guess at one point. So I selected to make sender guilty. That is why you will see env.Sender is the fault code is not set by the service or handler when it is throwing faults. > > * Then in the AxisServlet (line 385) when using SOAP12 we are setting > the response http status code to BAD_REQUEST(400) if the FaultCode is > sender which was the result of the SOAPFault with http-400... According to RFC2616 HTTP 400 is the correct HTTP status code if the fault is with the client. Also according to SOAP 1.2 HTTP binding[2] status code should be 400 when the fault code is Sender > > * Axis2 client does not process the body of the message if the http > status code is 400... I think this can be a bug in Axis2 code as status code 400 doesn't mean it should not process this. Rather Axis2 client should invoke InFaultFlow (Deepal, do we still have fault flows? ;) ). Chinthaka -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGgdctjON2uBzUhh8RAsAhAKC04r9Y5RrQdMsjImH3+KOLo1wV3wCfXygV dTSjJsYBMD4qovOP65UjGjg= =YuRj -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
