You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jeremy Nix <Je...@sfsltd.com> on 2005/04/12 22:59:05 UTC

Error Handling in Axis: one-way RPC call with no return value

I have an Axis method defined that will accept a message as input, but
returns nothing as output.  I've declared that a fault can be thrown.  A
snippet of my WSDL is below:

<wsdl:operation name="setTitleSearch">
 <wsdl:input message="tns:MessageSetTitleSearchIn" />
 <wsdl:fault message="tns:MessageError" />
</wsdl:operation>

I'm having 2 issues with this one-way architecture.  The first involves
my Junit test that creates a client that calls this Axismethod.  The
client works as expected except the test completes and closes the JVM
before a connection/request was successfully created to call my Axis
method.

The 2nd problem I found while manually setting a breakpoint after the
remote method call which allowed the JVM time to execute the remote
procedure call.  In my Axis method, an error occurred, and I threw an
AxisFault.  The client never catches wind of this exception.

I'm pretty sure that both of these issues are related to the fact that
the one-way architecture that I am using is not waiting for some sort of
generic Axis response noting that the process has completed
successfully.  Is it better for me to always return an output message
(possibly blank)?  Does this avoid the scenario that I'm running into?

Thanks in advance for any guidance.

_______________________
Jeremy Nix
Senior Application Developer
Southwest Financial Services, LTD.
(513) 621-6699 x1158
www.sfsltd.com



Re: Error Handling in Axis: one-way RPC call with no return value

Posted by Anne Thomas Manes <at...@gmail.com>.
This scenario is not a supported message exchange pattern (MEP). One
way messages cannot return faults. I suggest you define a
request/response MEP where the response message is empty:

<wsdl:message name="MessageSetTitleSearchOut"/>

<wsd:operation name="setTitleSearch">
  <wsdl:input message="tns:MessageSetTitleSearchIn"/>
  <wsdl:output message="tns:MessageSetTitleSearchOut"/>
  <wsdl:fault message="tns:MessageError"/>
</wsdl:operation>

Anne

On Apr 12, 2005 4:59 PM, Jeremy Nix <Je...@sfsltd.com> wrote:
> I have an Axis method defined that will accept a message as input, but
> returns nothing as output.  I've declared that a fault can be thrown.  A
> snippet of my WSDL is below:
> 
> <wsdl:operation name="setTitleSearch">
>  <wsdl:input message="tns:MessageSetTitleSearchIn" />
>  <wsdl:fault message="tns:MessageError" />
> </wsdl:operation>
> 
> I'm having 2 issues with this one-way architecture.  The first involves
> my Junit test that creates a client that calls this Axismethod.  The
> client works as expected except the test completes and closes the JVM
> before a connection/request was successfully created to call my Axis
> method.
> 
> The 2nd problem I found while manually setting a breakpoint after the
> remote method call which allowed the JVM time to execute the remote
> procedure call.  In my Axis method, an error occurred, and I threw an
> AxisFault.  The client never catches wind of this exception.
> 
> I'm pretty sure that both of these issues are related to the fact that
> the one-way architecture that I am using is not waiting for some sort of
> generic Axis response noting that the process has completed
> successfully.  Is it better for me to always return an output message
> (possibly blank)?  Does this avoid the scenario that I'm running into?
> 
> Thanks in advance for any guidance.
> 
> _______________________
> Jeremy Nix
> Senior Application Developer
> Southwest Financial Services, LTD.
> (513) 621-6699 x1158
> www.sfsltd.com
> 
>