You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jesse Stockall <js...@symbium.com> on 2006/01/20 21:26:07 UTC

SOAPFaultSubCode is lost on serialization

Using axis2-0.94

When creating a fault with a value and subcode the element added last is
lost when the fault is serialized.

SOAPFactory sf = OMAbstractFactory.getSOAP12Factory();
SOAPEnvelope env = sf.createSOAPEnvelope();
SOAPBody body = sf.createSOAPBody(env);
SOAPFault fault = sf.createSOAPFault(body);
SOAPFaultCode faultCode = sf.createSOAPFaultCode(fault);
SOAPFaultValue faultValue = sf.createSOAPFaultValue(faultCode);
SOAPFaultSubCode subCode = sf.createSOAPFaultSubCode(faultCode;
fault.serialize(System.out);

Will print:

<soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
  <soapenv:Code>
    <soapenv:Value />
  </soapenv:Code>
</soapenv:Fault>

If I create the subcode before the value:

SOAPFactory sf = OMAbstractFactory.getSOAP12Factory();
SOAPEnvelope env = sf.createSOAPEnvelope();
SOAPBody body = sf.createSOAPBody(env);
SOAPFault fault = sf.createSOAPFault(body);
SOAPFaultCode faultCode = sf.createSOAPFaultCode(fault);
SOAPFaultSubCode subCode = sf.createSOAPFaultSubCode(faultCode);
SOAPFaultValue faultValue = sf.createSOAPFaultValue(faultCode);
fault.serialize(System.out);

Will print:

<soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
  <soapenv:Code>
    <soapenv:Subcode />
  </soapenv:Code>
</soapenv:Fault>


fault.getCode().getSubCode() and fault.getCode().getValue() both return
the expected values no matter the order they are created in.

Thanks

Jesse

Re: SOAPFaultSubCode is lost on serialization

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Jesse,

Is this still happening with Axis2 0.95 ?


Jesse Stockall wrote:
> Using axis2-0.94
> 
> When creating a fault with a value and subcode the element added last is
> lost when the fault is serialized.
> 
> SOAPFactory sf = OMAbstractFactory.getSOAP12Factory();
> SOAPEnvelope env = sf.createSOAPEnvelope();
> SOAPBody body = sf.createSOAPBody(env);
> SOAPFault fault = sf.createSOAPFault(body);
> SOAPFaultCode faultCode = sf.createSOAPFaultCode(fault);
> SOAPFaultValue faultValue = sf.createSOAPFaultValue(faultCode);
> SOAPFaultSubCode subCode = sf.createSOAPFaultSubCode(faultCode;
> fault.serialize(System.out);
> 
> Will print:
> 
> <soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>   <soapenv:Code>
>     <soapenv:Value />
>   </soapenv:Code>
> </soapenv:Fault>
> 
> If I create the subcode before the value:
> 
> SOAPFactory sf = OMAbstractFactory.getSOAP12Factory();
> SOAPEnvelope env = sf.createSOAPEnvelope();
> SOAPBody body = sf.createSOAPBody(env);
> SOAPFault fault = sf.createSOAPFault(body);
> SOAPFaultCode faultCode = sf.createSOAPFaultCode(fault);
> SOAPFaultSubCode subCode = sf.createSOAPFaultSubCode(faultCode);
> SOAPFaultValue faultValue = sf.createSOAPFaultValue(faultCode);
> fault.serialize(System.out);
> 
> Will print:
> 
> <soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>   <soapenv:Code>
>     <soapenv:Subcode />
>   </soapenv:Code>
> </soapenv:Fault>
> 
> 
> fault.getCode().getSubCode() and fault.getCode().getValue() both return
> the expected values no matter the order they are created in.
> 
> Thanks
> 
> Jesse
>