我正在尝试使用Axis生成的存根来提供Web服务调用。
当它试图获得响应时,正在运行以下异常。
当我使用以下方式查看我的回复消息时:
String responseMsg = stub._getCall().getMessageContext().getResponseMessage().getSOAPEnvelope().toString();
的System.out.println(responseMsg);
它以SOAP格式提供正确的响应。任何人都可以在预先感谢它帮助我创建问题。
Zuned
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalArgumentException: argument type mismatch
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.IllegalArgumentException: argument type mismatch
at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:157)
at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.hps.webservice.SOAPInterfaceBindingStub.getStatus(SOAPInterfaceBindingStub.java:852)
at com.hps.ws.HPSStatusManagerJob.getApplicationStatusResponse(HPSStatusManagerJob.java:265)
at com.hps.ws.HPSStatusManagerJob.updateStatus(HPSStatusManagerJob.java:84)
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.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
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.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:75)
... 22 more
{http://xml.apache.org/axis/}hostname:admin-PC
java.lang.IllegalArgumentException: argument type mismatch
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2470)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.hps.webservice.SOAPInterfaceBindingStub.getStatus(SOAPInterfaceBindingStub.java:852)
at com.hps.ws.HPSStatusManagerJob.getApplicationStatusResponse(HPSStatusManagerJob.java:265)
at com.hps.ws.HPSStatusManagerJob.updateStatus(HPSStatusManagerJob.java:84)
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.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:157)
at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
... 14 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
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.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:75)
... 22 more
答案 0 :(得分:1)
生成文件的另一种方法是在我的情况下,轴1.4由于兼容性问题而无法正常工作(不确定它是什么)。我们可以在jdk中使用内置的wsimport.exe来生成存根 转到您的jdk bin文件夹并运行命令wsimport -s destinationPath WSDL path 为:
C:\ Program Files \ Java \ jdk1.6.0 \ bin> wsimport -s C:\ sid \ http://?WSDL
之后复制粘贴生成文件夹结构和类
答案 1 :(得分:0)
问题是本地WSDL没有更新,所以我首先更新了本地WSDL,然后再次生成类。
:)