creating custom axis fault (application specific faultCode, ReasonCode, and 
detail)
-----------------------------------------------------------------------------------

         Key: AXIS2-800
         URL: http://issues.apache.org/jira/browse/AXIS2-800
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug

  Components: core  
    Versions: 1.0    
 Environment: windows
    Reporter: Tony Dean


Previously I was able to send customized axis fault by doing the following:

----------------------------------------------------------------------------------------------------------------------------------------------
messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, 
soapFaultCode);
messageContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, 
soapFaultReason);
messageContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, 
soapFaultDetail);

AxisFault axisFault = new AxisFault("Some message");
throw axisFault;
----------------------------------------------------------------------------------------------------------------------------------------------

Now I try to do the same thing in 1.0 as follows:

MessageContext messageContext = _operationContext.getMessageContext("Out");
if (messageContext != null) {
    messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, 
soapFaultCode);
    messageContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, 
soapFaultReason);
    messageContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, 
soapFaultDetail);
}

AxisFault axisFault = new AxisFault("Some message");
throw axisFault;
----------------------------------------------------------------------------------------------------------------------------------------------

It just returns a general axis2 fault similar to the following:

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header 
/><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>unknown</faultstring><detail><Exception>org.apache.axis2.AxisFault&#13;
        at 
org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:102)&#13;
        at 
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37)&#13;
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454)&#13;
        at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284)&#13;
        at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:136)&#13;
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)&#13;
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)&#13;
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)&#13;
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)&#13;
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)&#13;
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)&#13;
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)&#13;
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)&#13;
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)&#13;
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)&#13;
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)&#13;
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)&#13;
        at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)&#13;
        at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)&#13;
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)&#13;
        at java.lang.Thread.run(Thread.java:534)&#13;
</Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

Is this the best way to return customized faults?  If not how?  Is so I need 
this fixed.



-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to