以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 最新动态 & 业界新闻 』  (http://bbs.xml.org.cn/list.asp?boardid=35)
----  [求助]WebService问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=35&rootid=&id=69432)


--  作者:tjd123
--  发布时间:11/13/2008 4:00:00 PM

--  [求助]WebService问题
小弟近来用AXIS做WEB SERVICE远程调用,下面是异常代码:
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalArgumentException: java.lang.ClassCastException@29ba89
faultActor:
faultNode:
faultDetail:
 {http://xml.apache.org/axis/}stackTrace:java.lang.IllegalArgumentException: java.lang.ClassCastException@29ba89
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at cn.com.freshpower.autoClient.DistributorPortSoapBindingStub.getModuleAvailability(DistributorPortSoapBindingStub.java:1791)
 at cn.com.freshpower.testClient.TestClient.main(TestClient.java:150)

 {http://xml.apache.org/axis/}hostname:tangjd-5f922d0a

java.lang.IllegalArgumentException: java.lang.ClassCastException@29ba89
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at cn.com.freshpower.autoClient.DistributorPortSoapBindingStub.getModuleAvailability(DistributorPortSoapBindingStub.java:1791)
 at cn.com.freshpower.testClient.TestClient.main(TestClient.java:150)

下面的是测试代码:userDetails是一个自定义类型UserDetails的实例,调用其他接口(这些接口仅有UserDetails参数)能正常返回结果,一加入其他参数:Calendar、枚举就出上面的异常,请各位大侠给点意见!
ModuleAvailabilityParameters eModuleAvailabilityParameters = new ModuleAvailabilityParameters();
        eModuleAvailabilityParameters.setUserDetails(userDetails);
        eModuleAvailabilityParameters.setStartDate(Calendar.getInstance());
        eModuleAvailabilityParameters.setCityCode(new CityCode("PER"));
        eModuleAvailabilityParameters
                .setAvailabilityStatus(AvailabilityStatus.value2);
        eModuleAvailabilityParameters.setSessionID("777");
        PassengerMix[] passengerConfiguration=new PassengerMix[1];
        passengerConfiguration[0]=new PassengerMix("2A1C-10");
        eModuleAvailabilityParameters.setPassengerConfiguration(passengerConfiguration);
        client.getModuleAvailability(eModuleAvailabilityParameters);


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
44.922ms