求助,关于webservice客户端调用的奇怪问题
情况是这样的,开发了一个webservice服务端,并用cxf生成客户端,在本地测试调用服务端没有问题,打包发送到测试现场,客户端掉不通了,但能正常访问wsdl,说明服务端正常发布了,错误信息如下:
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
... 49 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /html): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.
at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:237)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
private String getBaseItemService(String dimName,String orgCode,String userName,String password,String ip){
URL url;
String xml = "";
try {
String urlPath = ip + "/dna_ws/DataHandleServiceImpl?wsdl";
url = new URL(urlPath);
DataHandleServiceImpl service = new DataHandleServiceImpl(url);
IDataHandleService iservice = service.getDataHandleServiceImplPort();
xml = iservice.getBaseDataItemsByCode(orgCode,userName,password,dimName.toUpperCase());
} catch (MalformedURLException e) {
xml = e.getMessage();
e.printStackTrace();
}
return xml;
}