移动二次开发(openMas)cxf根据服务地址使用wsdl2java生成存根报错
--------------cmd------------
C:\Users\DELL>wsdl2java -p org.tempuri -d E:\workspace\ship\src -impl -client ht
tp://111.1.3.11:9080/OpenMasService?wsdl
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsd
l definition from : http://111.1.3.11:9080/OpenMasService?wsdl
Caused by : WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_E
RROR: Problem parsing 'http://127.0.0.1:9080/OpenMasService?wsdl=wsdl0'.: java.n
et.ConnectException: Connection refused: connect
这个WSDL文件有错误。
[quote][/quote]
导入部分是本地的URL地址(127.0.0.1)。
另外 PORT地址也是本地的:
[code="xml"] [/code]
修改的话, 你可以把这个WSDL文档保存下来,然后把两处127.0.0.1地址修改为:
把http://127.0.0.1:9080/OpenMasService?wsdl=wsdl0
改为:http://111.1.3.11:9080/OpenMasService?wsdl=wsdl0
把http://127.0.0.1:9080/OpenMasService
改为http://111.1.3.11:9080/OpenMasService
再用本地修改过的WSDL文件来执行wsdl2java