wrong SOAPFault (faultstring, faultcode touched) serialized
-----------------------------------------------------------

         Key: AXIS2-496
         URL: http://issues.apache.org/jira/browse/AXIS2-496
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug
    Versions: 0.95    
    Reporter: Yves Langisch
    Priority: Critical


Following code (provided by Eran) produces a wrong exception: 

<code>

MessageContext messageContext = null; // you must have to the current message 
context, when you are throwing the fault
         Exception t = new Exception("Eureka, Says Archimedes and runs naked on 
the road");
         SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
         SOAPFaultCode soapFaultCode =
 soapFactory.createSOAPFaultCode();
         soapFaultCode.declareNamespace("http://someuri.org";, "m");
         SOAPFaultValue soapFaultValue =
 soapFactory.createSOAPFaultValue(soapFaultCode);
         soapFaultValue.setText("m:FaultException");
 
 messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME,
 soapFaultCode);
 
         SOAPFaultReason soapFaultReason =
 soapFactory.createSOAPFaultReason();
         SOAPFaultText soapFaultText =
 soapFactory.createSOAPFaultText(soapFaultReason);
         soapFaultText.setText("This is some fault reason");
 
 messageContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, 
soapFaultReason);
         
         SOAPFaultDetail soapFaultDetail =
 soapFactory.createSOAPFaultDetail();
         QName qName = new QName("http://someuri.org";,
 "FaultException");
         OMElement detail = soapFactory.createOMElement(qName, null);
         qName = new QName("http://someuri.org";, "ExceptionMessage");
         Throwable e = t;
         while (e != null) {
             OMElement exception = soapFactory.createOMElement(qName,
 null);
             exception.setText(t.getMessage());
             detail.addChild(exception);
             e = e.getCause();
         }
 
 messageContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, 
soapFaultDetail);
 
throw new AxisFault("Something unusual is happening !!!");

</code>

gives (from Tony Dean's mail):

<?xml version="1.0" encoding="UTF-8" ?> 
> - <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>   <soapenv:Header /> 
> - <soapenv:Body>
> - <soapenv:Fault>
>   <faultcode
> xmlns:fault="http://support.sas.com/xml/namespace/biwebservices/webservicemaker-9.2";>fault:FaultExceptionClient</faultcode>
>  
> 
> <faultstring>com.sas.web.services.maker.FaultExceptionunknown</faultstring> 
>   <faultactor>http://myAxisServer/role/default</faultactor> 
> - <detail>
> - <FaultException
> xmlns="http://support.sas.com/xml/namespace/biwebservices/webservicemaker-9.2";>
>   <ExceptionMessage>Service "myService1234" already
> exists.</ExceptionMessage> 
>   </FaultException>
>   </detail>
>   </soapenv:Fault>
>   </soapenv:Body>
>   </soapenv:Envelope>

Notice the "Cient" text concatentated on the end of "fault:FaultException" in 
the faultcode.  "Client" is your default faultcode. Likewise, notice the 
"unknown" text concatenated on the end of
 "com.sas.web.services.maker.FaultException".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to