You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Paul Fremantle <pz...@gmail.com> on 2005/09/19 12:30:36 UTC

[AXIS2] Too little information on fault

Folks

If I send an incorrect request to the XMethods (Glue-based) Stock Quote 
service, they send back this response...

<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' 
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='
http://www.w3.org/2001/XMLSchema' xmlns:soapenc='
http://schemas.xmlsoap.org/soap/encoding/' soap:encodingStyle='
http://schemas.xmlsoap.org/soap/encoding/'><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>symbol</faultstring><detail><e:electric-detail
xmlns:e='http://www.themindelectric.com/'><class>
java.lang.NoSuchMethodException</class><message>symbol</message><trace>
java.lang.NoSuchMethodException: symbol
at electric.wsdl.PortType.getOperation(PortType.java:121)
at electric.wsdl.WSDL.getOperation(WSDL.java:169)
// etc
at electric.util.ThreadPool.run(ThreadPool.java:105)
at java.lang.Thread.run(Thread.java:479)
</trace></e:electric-detail></detail></soap:Fault></soap:Body></soap:Envelope>

But all I get in my Java stack trace is:

org.apache.axis2.AxisFault: 
at org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(
InOutMEPClient.java:191)
at org.apache.axis2.clientapi.Call.invokeBlocking(Call.java:90)
at XMethodsTest.main(XMethodsTest.java:46)

Wouldn't it be useful to have the full SOAP fault information? 

I'll raise a JIRA unless I've got it wrong and there is more info available.

Paul

Re: [AXIS2] Too little information on fault

Posted by Deepal Jayasinghe <de...@opensource.lk>.
+1 , please create a JIRA for this

Thanks,
 Deepal
................................................................
~Future is Open~

  ----- Original Message ----- 
  From: Paul Fremantle 
  To: axis-dev@ws.apache.org 
  Sent: Monday, September 19, 2005 4:30 PM
  Subject: [AXIS2] Too little information on fault


  Folks

  If I send an incorrect request to the XMethods (Glue-based) Stock Quote service, they send back this response...

  <?xml version='1.0' encoding='UTF-8'?>
  <soap:Envelope xmlns:soap=' http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema ' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' ><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>symbol</faultstring><detail><e:electric-detail xmlns:e=' http://www.themindelectric.com/'><class>java.lang.NoSuchMethodException</class><message>symbol</message><trace>java.lang.NoSuchMethodException: symbol
      at electric.wsdl.PortType.getOperation (PortType.java:121)
      at electric.wsdl.WSDL.getOperation(WSDL.java:169)
      // etc
          at electric.util.ThreadPool.run(ThreadPool.java:105)
      at java.lang.Thread.run(Thread.java:479)
  </trace></e:electric-detail></detail></soap:Fault></soap:Body></soap:Envelope> 

  But all I get in my Java stack trace is:

  org.apache.axis2.AxisFault: 
      at org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(InOutMEPClient.java:191)
      at org.apache.axis2.clientapi.Call.invokeBlocking (Call.java:90)
      at XMethodsTest.main(XMethodsTest.java:46)

  Wouldn't it be useful to have the full SOAP fault information? 

  I'll raise a JIRA unless I've got it wrong and there is more info available.

  Paul



Re: [AXIS2] Too little information on fault

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Mon, 2005-09-19 at 21:40 +0600, Eran Chinthaka wrote:
> Hi Paul and all,
> 
> Let me explain a bit on this fall handling mechanism in client code.
> 
> Call api has two ways of getting notified if there is an error. One
> can either receive the fault as a java exception or he can receive the
> SOAP Fault in SOAP Body.
> 
> The default is you will receive a java exception. But for you to
> receive this error as an exception, the stack trace should come under
> the Detail element,, under Exception element.
> 
> <Envelope>
>     <Header />
>     <Body>
>           <Detail>
>               <Exception> your exception goes here </Exception?
>           </Detail>
>     <Body>
> </Envelope>
> 
> This is sort of a mechanism is for the Call to work well with Axis2
> server.
> 
> But if you want to receive the SOAP fault to the application, just set
> setExceptionToBeThrownOnSOAPFault(false) in the call api. This will
> give you back the Fault which you were looking for, without a java
> exception.

A simple improvement: even when throwing a Java fault, just pass the
SOAPFault as a property of the exception; that way anyone who wants
access to all the fault data can get it.

Also, its good to have direct properties for the normal SOAPFault stuff
in AxisFault: String getFaultCode(), String getFaultString(), OMElement
getFaultDetail() etc.. These can all return null if there's no
associated SOAPFault in the Java exception.

Sanjiva.



Re: [AXIS2] Too little information on fault

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Paul and all,

Let me explain a bit on this fall handling mechanism in client code.

Call api has two ways of getting notified if there is an error. One can 
either receive the fault as a java exception or he can receive the SOAP 
Fault in SOAP Body.

The default is you will receive a java exception. But for you to receive 
this error as an exception, the stack trace should come under the Detail 
element,, under Exception element.

<Envelope>
    <Header />
    <Body>
          <Detail>
              <Exception> your exception goes here </Exception?
          </Detail>
    <Body>
</Envelope>

This is sort of a mechanism is for the Call to work well with Axis2 server.

But if you want to receive the SOAP fault to the application, just set 
setExceptionToBeThrownOnSOAPFault(false) in the call api. This will give 
you back the Fault which you were looking for, without a java exception.

HTH.

Regards,
Chinthaka

Paul Fremantle wrote:

> Folks
>
> If I send an incorrect request to the XMethods (Glue-based) Stock 
> Quote service, they send back this response...
>
> <?xml version='1.0' encoding='UTF-8'?>
> <soap:Envelope xmlns:soap=' http://schemas.xmlsoap.org/soap/envelope/' 
> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
> xmlns:xsd='http://www.w3.org/2001/XMLSchema 
> <http://www.w3.org/2001/XMLSchema>' 
> xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' 
> soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' 
> <http://schemas.xmlsoap.org/soap/encoding/%27>><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>symbol</faultstring><detail><e:electric-detail 
> xmlns:e=' http://www.themindelectric.com/' 
> <http://www.themindelectric.com/%27>><class>java.lang.NoSuchMethodException</class><message>symbol</message><trace>java.lang.NoSuchMethodException: 
> symbol
>     at electric.wsdl.PortType.getOperation (PortType.java:121)
>     at electric.wsdl.WSDL.getOperation(WSDL.java:169)
>     // etc
>         at electric.util.ThreadPool.run(ThreadPool.java:105)
>     at java.lang.Thread.run(Thread.java:479)
> </trace></e:electric-detail></detail></soap:Fault></soap:Body></soap:Envelope> 
>
>
> But all I get in my Java stack trace is:
>
> org.apache.axis2.AxisFault:
>     at 
> org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(InOutMEPClient.java:191)
>     at org.apache.axis2.clientapi.Call.invokeBlocking (Call.java:90)
>     at XMethodsTest.main(XMethodsTest.java:46)
>
> Wouldn't it be useful to have the full SOAP fault information?
>
> I'll raise a JIRA unless I've got it wrong and there is more info 
> available.
>
> Paul
>
>