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 Yves Langisch <li...@langisch.ch> on 2006/02/02 20:53:12 UTC

[Axis2] SOAPFault details are being lost

Hi,

I'm trying to setup some kind of proxy webservice. My service method 
looks as follows:

     public OMElement Operation1(OMElement element) throws Exception {
         OMElement result = null;
         try {
             Options options = new Options();
             EndpointReference er = new 
EndpointReference("http://localhost:9700/nextWS");
             options.setTo(er);

             options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
             options.setUseSeparateListener(false);
             options.setSoapAction("\"Operation1\"");

             ServiceClient client = new ServiceClient();
             client.setOptions(options);

             result = client.sendReceive(element);
         } catch (AxisFault axisFault) {
	    // do some work
	    ...
	    // throw fault back to client		
             throw axisFault;
         }
         return result;
	}

If I get back a SOAPFault from the called webservice I just would like 
to give this SOAPFault back to the client without any modifications. 
Especially the detail element should not be touched. With the code above 
and a fault like this

...
<faultString>Fault occured</faultString>
<detail>
    <myBusinessFault>
	<a>info</a>
    </myBusinessFault>
</detail>	

the faultString is copied into the detail element (on the wire back to 
the client). The original detail is lost as it is null. I have not 
possibility to get the details (myBusinessFault) in my catch.

I already changed some Axis source and was able the get the details 
correctly as OMElement. But throwing it in the catch caused the details 
to be lost again on the wire.

This is not the correct behaviour, isn't it?

Thanks
Yves

Re: [Axis2] SOAPFault details are being lost

Posted by Davanum Srinivas <da...@gmail.com>.
Yes this is wrong behavior. Needs work. Please create a bug so that we
can track it.

thanks,
dims

On 2/2/06, Yves Langisch <li...@langisch.ch> wrote:
> Hi,
>
> I'm trying to setup some kind of proxy webservice. My service method
> looks as follows:
>
>      public OMElement Operation1(OMElement element) throws Exception {
>          OMElement result = null;
>          try {
>              Options options = new Options();
>              EndpointReference er = new
> EndpointReference("http://localhost:9700/nextWS");
>              options.setTo(er);
>
>              options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>              options.setUseSeparateListener(false);
>              options.setSoapAction("\"Operation1\"");
>
>              ServiceClient client = new ServiceClient();
>              client.setOptions(options);
>
>              result = client.sendReceive(element);
>          } catch (AxisFault axisFault) {
>             // do some work
>             ...
>             // throw fault back to client
>              throw axisFault;
>          }
>          return result;
>         }
>
> If I get back a SOAPFault from the called webservice I just would like
> to give this SOAPFault back to the client without any modifications.
> Especially the detail element should not be touched. With the code above
> and a fault like this
>
> ...
> <faultString>Fault occured</faultString>
> <detail>
>     <myBusinessFault>
>         <a>info</a>
>     </myBusinessFault>
> </detail>
>
> the faultString is copied into the detail element (on the wire back to
> the client). The original detail is lost as it is null. I have not
> possibility to get the details (myBusinessFault) in my catch.
>
> I already changed some Axis source and was able the get the details
> correctly as OMElement. But throwing it in the catch caused the details
> to be lost again on the wire.
>
> This is not the correct behaviour, isn't it?
>
> Thanks
> Yves
>


--
Davanum Srinivas : http://wso2.com/blogs/