所有,
我正在使用Axis2
Web 服务。这些服务捆绑.aar file
并部署在WSO2 Application Server(AS)
. 我能够在运行的 WSO2 AS 中部署生成的 .aarWindows environment
以及Linux environment
.
问题是,
当我尝试访问托管在两个环境(Windows 和 Linux)中的 POST 服务时,我就是getting response in Windows while getting the following error in the Linux
环境。
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:178)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:434)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
TID: [0] [ESB] [2013-07-02 04:18:22,576] ERROR {org.apache.synapse.transport.passthru.ServerWorker} - Error processing POST request for : /services/MyService/postRequest {org.apache.synapse.transport.passthru.ServerWorker}
org.apache.axis2.AxisFault: wrong number of arguments
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:211)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:434)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:178)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
... 9 more.
以下是我给出的输入:
URI:
https://localhost:8243/services/MyService/postRequest
Input XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.sample.vijay.com">
<soapenv:Header/>
<soapenv:Body>
<ser:postRequest>
<ser:paramOne>Hello</ser:paramOne>
<ser:paramTwo>All</ser:paramTwo>
<ser:paramThree>This is POST request</ser:paramThree>
</ser:postRequest>
</soapenv:Body>
</soapenv:Envelope>
当我尝试在Windows machine
(Chrome 浏览器-> cREST 插件)中使用 rest 客户端访问上述服务时,它会返回我预期的结果。
但是当我尝试使用相同 URI 的相同请求Linux environment
(仅主机地址更改为 Linux IP)时,最终出现上述错误(想知道可能是什么问题)。
Do I need to change any configuration in Linux machine or WSO2 Application Server in Linux machine?
注意:
当我将 URI 更改为 时https://localhost:8243/services/MyService
,它在 Linux 和 Windows 中都可以正常工作。但我的要求是/postRequest here
在 URI 中包含 Web 方法名称()。
请帮我解决这个奇怪的问题。
提前致谢。
编辑:
我的 services.xml 是:
<serviceGroup name="AxisServices">
<service name="MyService">
<description>
Please Type your service description here
</description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"></messageReceiver>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"></messageReceiver>
</messageReceivers>
<parameter name="ServiceClass" locked="false">com.vijay.sample.service.MyService</parameter>
</service>
我的 Java 类:
package com.vijay.sample.service;
public class MyService {
public String postRequest(String paramOne, String paramTwo, String paramThree) {
// Logic here
return "Success";
}
}