在使用SOAP服务时,我收到此错误。我只是得到它是什么原因。一切都适用于调用没有参数的服务方法。当我尝试使用参数调用方法时,我不知道为什么没有传递参数。此消息适用于SOAP 1.1
我的SOAP消息是:
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
<S:Header/>
<S:Body>
<ns2:addPerson xmlns:ns2="http://service.accounting.cassit.com/">
<fName xsi:type="xsd:string">vbn</fName>
<lName xsi:type="xsd:string">yyyy</lName>
<gender xsi:type="xsd:string">879</gender>
<age xsi:type="xsd:int">90</age>
</ns2:addPerson>
</S:Body>
</S:Envelope>
,例外是:
org.apache.cxf.interceptor.Fault: null while invoking public boolean com.aqi.service.PersonServiceImpl.addPerson(java.lang.String,java.lang.String,java.lang.String,int) with params [null, null, null, null].
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:159)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:133)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
答案 0 :(得分:1)
我刚刚找到解决问题的方法。而不是使用参数名称参数,例如&#39; fName&#39;,&#39; lName&#39;它将输入作为arg0,arg1。 :)这不仅是问题。这里讨论Actuall问题。我需要解决紧急问题,以便将当前问题更准确地作为一个新问题。感谢thermz,特别是NDA。
How to pass parameters through a SOAP Message to consume a parameterized method of a webservice