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
at
org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:102)
at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
</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]