0

我已将 Axis jar 版本从 Axis 1.1 升级到 Axis 1.4,升级后我得到了

一般数据错误:15002:请求/响应架构验证错误

升级前:

我们有一个使用 JDK1.3 和 Axis 1.1 编写的遗留代码(客户端/消费者),该代码能够使用我们供应商公开的 Web 服务。

升级后

使用 JDK1.6 和 Axis 1.4 升级消费者后,我需要更新代码,如下所示。

 // oper.setStyle(org.apache.axis.enum.Style.RPC);
// oper.setUse(org.apache.axis.enum.Use.ENCODED);
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);

消费者代码无法使用供应商公开的 Web 服务。

堆栈跟踪

任何提示将不胜感激。

com.tdi.lh.cprm.customerlink.ServiceException: 200:General Data Error:15002:Request/Response Schema Validation Error
at com.tdi.lh.cprm.customerlink.CustomerInsuranceIdentifierFinder.find(CustomerInsuranceIdentifierFinder.java:68)
at CPRMLib.getIINumber(CPRMLib.java:1449)
at CPRMLib.main(CPRMLib.java:2060)
Caused by: 200:General Data Error:15002:Request/Response Schema Validation Error
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 org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
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)
4

1 回答 1

0

经过几天的研究,我找到了上述错误的原因。

我只是使用axis 1.4 jar使用命令重新生成了整个客户端Web服务(存根)代码

SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\commons-discovery-0.2.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\commons-lang-2.4.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\activation.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\axis-ant.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\axis.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\commons-collections-3.2.1.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\commons-configuration-1.6.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\commons-logging-1.1.1.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\db2jcc4.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\jaxrpc.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\log4j-1.2.15.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\mail.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\saaj.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\wsdl4j-1.5.1.jar
SET CLASSPATH=%CLASSPATH%;C:\StockQuote\JDK16\lib\jsse.jar    
java org.apache.axis.wsdl.WSDL2Java https://localhost:8443/axis2/services/StockQuoteService?wsdl

注意:我们根本无法将 Axis1.1 --> 升级到 Axis 1.4。现有代码(之前使用 Axis 1.1 jar 生成)需要使用 Axis 1.4 jar 重新生成。

于 2014-09-06T16:40:33.197 回答