Simple axis 2 service fails invocation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Simple axis 2 service fails invocation

Paul Nibin
Hi all,

       I am trying to invoke a simple web service.

public class SimpleTestVoid
    public void printMessage() throws Exception
        System.out.println( "Hello world" );

The WSDL is generated fine. Generated the client. But when invoking the service, I am getting an exception.

java.lang.UnsupportedOperationException: An access occurred that is not valid.
        at org.apache.axis2.description.InOnlyAxisOperation.getMessage(
        at org.apache.axis2.util.MessageContextBuilder.createOutMessageContext(
        at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(
        at org.apache.axis2.receivers.AbstractMessageReceiver.receive(
        at org.apache.axis2.engine.AxisEngine.receive(
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
        at org.apache.axis2.transport.http.AxisServlet.doPost(

I debugged some part of the code.

When the service is deployed, according to the signature of the method, it is creating a InOnlyAxisOperation with "robust-in-only" as the message exchange pattern( it is not taking any input params and throwing an exception).


     if ("void".equals(method.getReturnType().getName())) {
            if (method.getExceptionTypes().length > 0) {
                operation = AxisOperationFactory
            } else {
                operation = AxisOperationFactory

If MEP_CONSTANT_IN_ONLY message exchange pattern is used, then all works fine. But if there a method which does not take any input parameters and throws some exception, then this issue comes.

org.apache.axis2.description.AxisOperationFactory.getAxisOperation(int mepURI)

            case WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY : {
                abOpdesc = new InOnlyAxisOperation();

So when the invoking the method using a client, in org.apache.axis2.util.MessageContextBuilder.createOutMessageContext(MessageContext inMessageContext)

if (ao != null){

Since a0 is a org.apache.axis2.description.InOnlyAxisOperation, the following getMessage is invoked, so it is throwing this UnsupportedOperationException.

public AxisMessage getMessage(String label) {
        if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
            return (AxisMessage) getChild("inMessage");
        } else {
            throw new UnsupportedOperationException(Messages.getMessage("invalidacess"));

If any more info is required please let me know. Hoping for a response..

Please.. I need help with this one...