我的要求是为用 SAP 编写的 web 服务创建一个 java 客户端,并且必须部署在 weblogic 中。以及将复杂类型作为输入参数的 Web 方法。
我已经使用 clientgen 创建了存根类。并编写了一个独立的客户端进行测试。
还在类路径 xmlbeans-1.0.jar wlfullclient.jar webserviceclient.jar webservice.jar 中添加了以下 jar
我没有将 wsdl url 提供给 Impl 对象,而是使用静态 wsdl。当我运行应用程序时,它给出了以下错误。使用相同的 wsdl 我正在创建客户端。
javax.xml.rpc.ServiceException: Failed to parse WSDL file:/C:/xxx-LPMS/trunk/build/classes/com/xxx/xxx/webservice/client/TestService_wsdl.wsdl weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Invalid index
at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:169)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:477)
at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:114)
at com.xxx.xxx.webservice.client.TestService_Impl.<init>(TestService_Impl.java:23)
at com.xxx.xxx.webservice.client.TestService_Impl.<init>(TestService_Impl.java:13)
at com.xxx.xxx.schnittstellen.util.StdQmCreateWSClientUtil.initServicePort(StdQmCreateWSClientUtil.java:77)
at com.xxx.xxx.schnittstellen.util.StdQmCreateWSClientUtil.getStdQmCreateCrServiceport(StdQmCreateWSClientUtil.java:70)
at com.xxx.xxx.schnittstellen.util.StdQmCreateWSClientUtil.StdQmCreateCr(StdQmCreateWSClientUtil.java:30)
at com.xxx.xxx.schnittstellen.util.StdQmCreateWSClientUtil.main(StdQmCreateWSClientUtil.java:91)
Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Invalid index
at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:402)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:388)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:78)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:65)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:468)
... 7 more
Caused by: java.io.IOException: Invalid index
at weblogic.xml.domimpl.Loader.load(Loader.java:38)
at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:168)
at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:58)
at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
... 12 more
Caused by: javax.xml.stream.XMLStreamException: Invalid index
at weblogic.xml.stax.XMLStreamReaderBase.prime(XMLStreamReaderBase.java:80)
at weblogic.xml.stax.XMLStreamReaderBase.setInput(XMLStreamReaderBase.java:103)
at weblogic.xml.stax.RecyclingFactory.createXMLStreamReader(RecyclingFactory.java:35)
at weblogic.xml.stax.XMLStreamInputFactory.createXMLStreamReader(XMLStreamInputFactory.java:49)
at weblogic.xml.domimpl.Loader.createXMLStreamReader(Loader.java:60)
at weblogic.xml.domimpl.Loader.load(Loader.java:34)
... 15 more
Caused by: sun.misc.InvalidJarIndexException: Invalid index
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:766)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:679)
at sun.misc.URLClassPath.getResource(URLClassPath.java:158)
at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at weblogic.xml.babel.scanner.ScannerState.<init>(ScannerState.java:86)
at weblogic.xml.babel.scanner.Scanner.<init>(Scanner.java:75)
at weblogic.xml.babel.baseparser.BaseParser.baseScanner(BaseParser.java:172)
at weblogic.xml.babel.baseparser.BaseParser.createScanner(BaseParser.java:164)
at weblogic.xml.babel.baseparser.BaseParser.init(BaseParser.java:213)
at weblogic.xml.babel.baseparser.BaseParser.<init>(BaseParser.java:84)
at weblogic.xml.stax.XMLStreamReaderBase.prime(XMLStreamReaderBase.java:56)
... 20 more