Hi,

I am trying to invoke a web service Dynamic proxy client.
Everything is working fine except with operations (methods) with void return
value BUT that declares to throw checked Exceptions.

For example, public boolean test() throws SomeException will work fine but
public void test2() throws SomeException generate an error.
The call is made and the server side method is executed but the client
generate this error:

javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: An unknown
message label has been encountered: In
    at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
    at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
    at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
    at
org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:151)
    at
org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:82)
    at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:295)
    at
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:158)

I digged into axis2 code and found that axis consider this operation not to
be OneWay but use a OutOnlyAxisOperationClient at some point not.
Executing the whole thing in debug I found that the variable opClient in
AxisInvocationController:125 is actually a OutOnlyAxisOperationClient.

I think this method should not be considered OutOnly since it is declared as
throwing checked exceptions. Looking at
http://java.sun.com/javaee/5/docs/api/javax/jws/Oneway.html, I understand
that an operation can't be declared OneWay if it declares checked
exceptions.

Any idea how I could be around this? Can I force an operation to be in-out?

My client is created like this:
   Service service = Service.create(new URL(UrlString), new
QName(nameSpaceUri, serviceName));
   TestServiceInterface myProxy = service.getPort(new QName(nameSpaceUri,
portName), TestServiceInterface.class, new AddressingFeature(true), new
SubmissionAddressingFeature(true));

Thank you all!

Manuel

Reply via email to