title: Axis 2 WebService : wrong number of arguments when invoking method
body: <p>I'm trying to set up a webservice using axis2. 
  I've created a Dynamic Web Projet under Eclipse, using Apache Tomcat 7 and the dynamic web version 2.5. I've added the Axis 2 Facets to the configuration. </p>
  
  <p>I have the following class : </p>
  
  <pre><code>package com.jo.ws;
  
  public class Test {
      public int add(int a, int b) {
          return a + b;
      }
  }
  </code></pre>
  
  <p>I then created a WebService for the projet, using the Bottom up Java bean Web Service, and adding my Test class to the service implementation. 
  I chose the "Start Service" in the slider, and changed Apache Axis in the configuration to Axis 2. I then generated a default services.xml file using the default option. </p>
  
  <p>I can access my projet on the web at the following adress :</p>
  
  <pre><code>http://localhost:8888/Axis2WS/
  </code></pre>
  
  <p>This displays the Axis 2 page, and I can see my service is active</p>
  
  <pre><code> http://localhost:8888/Axis2WS/services/listServices 
  </code></pre>
  
  <p>The wsdl is correctly generated and displayed </p>
  
  <p>I can post it if needed. </p>
  
  <p>But now if I do this : </p>
  
  <pre><code>http://localhost:8888/Axis2WS/services/Test?method=add&amp;a=2&amp;b=1
  </code></pre>
  
  <p>I get this :</p>
  
  <pre><code>&lt;soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt;
  &lt;soapenv:Text xml:lang="en-US"&gt;wrong number of arguments&lt;/soapenv:Text&gt;
  &lt;/soapenv:Reason&gt;
  </code></pre>
  
  <p>I also got the error in my Eclipse console log, with the following stack trace : </p>
  
  <pre><code>[ERROR] wrong number of arguments
  java.lang.IllegalArgumentException: wrong number of arguments
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:178)
      at     org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.ja    va:117)
      at     org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMe    ssageReceiver.java:40)
      at     org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114    )
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
      at     org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
      at     org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
      at     org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServ    let.java:837)
      at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at     org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav    a:303)
      at     org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at     org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at     org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at     org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at     org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at     org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      at     org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:    607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Any idea what I'm doing wrong ? </p>
  
  <p>Thanks for your help !</p>