当调用JAXWS Java使用者存根构造函数时,我得到以下异常。当我尝试通过。 SOAPUI一切正常,能够得到正确的响应。它是多个应用服务器(Websphere 7.x群集)设置的Web服务器。消费者代码看起来不错提供者代码很好,因为它在SOAPUI中工作。 Web Server存在一些问题,Web服务器可能会使用HTML而不是XML进行响应。通过Java使用者尝试时,App Server无法获取请求,并且没有日志。我们在没有Web服务器设置的本地应用程序服务器中进行了测试不知道问题在哪里?有人可以帮忙吗?我正在使用WebSphere附带的Axis2来托管Web服务。 Web Sphere读取实现类中的注释以部署Web服务。自动生成WSDL。 WSDL位置我没有在实现文件中指定,如果它指定不起作用。我没有提供配置文件(web.xml等)。它不是HTTPS Web服务。我可以telnet到Web服务服务器并通过telnet获取WSDL。
javax.xml.ws.WebServiceException: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://ip:port/AppName/ServiceName'.: (http://ip:port/AppName/ServiceName%27.:) org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.loadDefinition(WSDL4JWrapper.java:754)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.getDefinition(WSDL4JWrapper.java:670)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:224)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.<init>(WSDL4JWrapper.java:156)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1191)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:245)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:168)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:142)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)
at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:76)
at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:212)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:71)
at javax.xml.ws.Service.<init>(Service.java:67)
at somepackage.servicename.<init>(servicename.java:42)...more are here hidden to maintain confidential
Caused by:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://ip:port/AppName/ServiceName'.: (http://ip:port/AppName/ServiceName%27.:) org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2315)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2390)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2356)
at org.apache.axis2.jaxws.util.WSDL4JWrapper$13.run(WSDL4JWrapper.java:745)
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.loadDefinition(WSDL4JWrapper.java:742)
... 70 more
Caused by:
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2305)
... 75 more </pre>
答案 0 :(得分:1)
我不确定您的wsdl检索出了什么问题,但是如果您可以从远程服务中提取wsdl(以及它导入的任何文件)并直接将它们与您的客户端打包在一起,这将避免从每个调用的远程服务中检索wsdl,除了在您的情况下不工作,也会降低性能。您的客户端wsdllocation将更改为file:///(某事)。如果您使用的是RAD或WDT等开发人员工具,则可以选择自动检索wsdl并将其与客户端打包在一起。