axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dobri Kitipov (JIRA)" <>
Subject [jira] Commented: (AXIS2-4216) Axis2, SOAP 1.2 SOAP Fault and the Subcode element issue
Date Fri, 06 Feb 2009 09:26:03 GMT


Dobri Kitipov commented on AXIS2-4216:

A JIRA at Apache Commons AXIOM was created :
If the fix is applied then we could optimize the solution/patch applied here and make it simpler
and shorter.

> Axis2, SOAP 1.2 SOAP Fault and the Subcode element issue
> --------------------------------------------------------
>                 Key: AXIS2-4216
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Dobri Kitipov
>             Fix For: nightly
>         Attachments: MessageContextBuilder_patch1.patch
> Hi everybody,
> What I have observed is that the Axis2 interpretation of subcodes is not compliant with
the SOAP 1.2 spec (ref.  
> Currently, if we look into the org.apache.axis2.util.MessageContextBuilder createFaultEnvelope(MessageContext
context, Throwable e) method 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() (, or <soapenv:Code>)
then every next one should be added to the preceding subcode (,or <soapenv:Subcode>
- in other words its parent one subcode).
> I did a fix locally and it works for me. Without the fix every next subcode replaces
the previous one appended to the <soapenv:Code>. At the end the last one wins and it
is set as the single one subcode to the <soapenv:Code> element.
> Here is a sample of a SOAP 1.2 Fault with two subcodes using the fix. Without the fix
the second subcode will replace the one appended to the <soapenv:Code> which is not
> <soapenv:Envelope xmlns:soapenv="">
>     <soapenv:Header xmlns:wsa="">
>         <wsa:Action></wsa:Action>
>         <wsa:RelatesTo>urn:uuid:1E5867D19D085C6BCB1231847612132</wsa:RelatesTo>
>     </soapenv:Header>
>     <soapenv:Body>
>         <soapenv:Fault xmlns:axis2ns2="">
>             <soapenv:Code>
>                 <soapenv:Value>axis2ns2:Sender</soapenv:Value>
>                 <soapenv:Subcode>
>                     <soapenv:Value xmlns:wsse="">wsse:MyException</soapenv:Value>
>                     <soapenv:Subcode>
>                         <soapenv:Value xmlns:wsse="">wsse:InvalidSecurity</soapenv:Value>
>                     </soapenv:Subcode>
>                 </soapenv:Subcode>
>             </soapenv:Code>
>             <soapenv:Reason>
>                 <soapenv:Text xml:lang="en-US">Cannot load password callback class:
>             </soapenv:Reason>
>             <soapenv:Detail/>
>         </soapenv:Fault>
>     </soapenv:Body>
> </soapenv:Envelope>
> Thank you,
> Dobri

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message