Hi,

I feel the exception is coming out before your custom fault envelope
creation gets executed. Just try debugging the code and check exactly
where exception pops up.

-- Chinthaka

[EMAIL PROTECTED] wrote:
> Hi,
> I've got problems in the ErrorHandling in Axis2. I followed some hints 
> formerly made in some newsgroup:
> For more details: 
> http://marc.theaimsgroup.com/?l=axis-user&m=113983896626701&w=2
> 
> 1) Extend the service implementation class to access the MessageContext:
> 
>       public void setOperationContext(OperationContext opctx) throws 
> AxisFault {
>           this.inMsgCtx = 
> opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
>           this.outMsgCtx =    
> opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
>       }
> 2) If the Error occurs, create the SOAPFault and put it to the 
> MessageContext, like this:
>               SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory(); 
>               SOAPFault soapFault = soapFactory.createSOAPFault();
>               SOAPFaultCode faultCode = 
> soapFactory.createSOAPFaultCode(soapFault);
>               faultCode.setText("Server:UserException");
>               SOAPFaultDetail soapDetail = 
> soapFactory.createSOAPFaultDetail(soapFault);
>               soapDetail.setText("details of the error...");
>               
> outMsgCtx.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
>               
> outMsgCtx.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, 
> soapDetail);
>               System.out.println("### Throwing AXIS-Fault");
>               throw new AxisFault("This is the Reason For Exception", "this 
> is fault Code");
> 
> The SOAP-Response looks like this. all the coding I did, did not had any 
> effects on the result:
>               ...
>               <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:237)
>                      at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>                      at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
>                      at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>                      ....
>                   </Exception>
>                 </detail>
>               </soapenv:Fault>
>                ....
> 
> 
>               <soapenv:Fault>
> 
> Any hints on what I am missing / doing wrong are very appreciated. I did not 
> use WSDL2Java, or skeletons. 
> Thank in adavance.
> 
> Bille
> ______________________________________________________________________
> XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!          
> Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to