使用apache cxf加载wsdl时出现异常

时间:2017-03-30 05:37:59

标签: java apache cxf

我使用apache cxf从WSDL文件生成了Web服务客户端。但是从java客户端加载服务类时会抛出异常,如下所示。这里的问题是我们从不同的机器调用此服务。所以称它为localhost不会工作。你能否在不改变服务器中的wsdl的情况下提出解决方案。 Also WSDL contains the xsd import as shown below. <xsd:import schemaLocation="http://localhost/ea/AE_ARCH/Services?xsd=xsd0" namespace="http://tempuri.org/"/>

    javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:163)
    at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:129)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:82)
    at javax.xml.ws.Service.<init>(Unknown Source)
    at org.tempuri.StudyManagementService.<init>(StudyManagementService.java:39)
    at com.ge.med.xed.provider.data.plugin.ea.wcf.EAConnectorTestApp.initializeAndSearchFromEA102(EAConnectorTestApp.java:36)
    at com.ge.med.xed.provider.data.plugin.ea.wcf.EAConnectorTestApp.main(EAConnectorTestApp.java:22)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:87)
    at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:218)
    at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:161)
    ... 6 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'http://localhost/ea/AE_ARCH/Services?xsd=xsd2'.: java.net.ConnectException: Connection refused: connect
    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:830)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:654)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:610)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:320)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:236)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:85)

0 个答案:

没有答案