You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dobri Kitipov <kd...@googlemail.com> on 2009/01/13 12:59:35 UTC

Axis2 and SOAP 1.2 SOAP Fault and the Subcode element issues

Hi everybody,
first of all I wish you health and love during year 2009.

Currently I am doing a research over exception handling and SOAP Fault (1.1
and 1.2). I am interested in using codes that the could be transfered to the
client and interpreted over there. Doing so I expect that based on the code
the client can react appropriately if possible or just read the error
message.

What I have observed is that the current Axis2 interpretation of subcodes is
not compliant with the SOAP 1.2 spec. Currently, if we look into the
org.apache.axis2.util.MessageContextBuilder
createFaultEnvelope(MessageContext context, Throwable e) we will see that
when List faultSubCodes is iterated the subcode is set to the Code with the
following lines:

                    SOAPFactory sf = (SOAPFactory)envelope.getOMFactory();
                    SOAPFaultSubCode soapFaultSubCode =
sf.createSOAPFaultSubCode(fault.getCode());
                    SOAPFaultValue saopFaultValue =
sf.createSOAPFaultValue(fault.getCode());
                    saopFaultValue.setText(faultSubCodeQName);
                    soapFaultSubCode.setValue(saopFaultValue);
                    fault.getCode().setSubCode(soapFaultSubCode);

In fact only the first subcode should be added to the fault.getCode() then
every next one should be added to the preceiding subcode (,or its parent
one).
I did that fix locally and it works for me.
So if I am right about this issue I can oben a JIRA and apply the patch.

Regards,
Dobri