wsimport giving parse error

血红的双手。 提交于 2019-12-12 04:07:38

问题


I am getting strange parsing error when I try to import a WSDL using wsimport.

Error:-

org.xml.sax.SAXParseException: Invalid WSDL file: expected 
{http://schemas.xmlsoap.org/wsdl/}definitions found definitions at line 1)

I checked the WSDL and I am also surprised the first element of it is not

<wsdl:definitions ...>

But rather:

<definitions   xmlns:soap="https://schemas.xmlsoap.org/wsdl/soap/" ...>

Could this be the problem? The web service is external, so I dont have any control over the WSDL. One thing I know is that it is generated by JAX-WS 2.1.5. Is it a customized WSDL that my wsimport tool is not able to understand? If yes please tell me how to resolve this problem. Thanks.


回答1:


Based on this conversation, the 2.1.5 version of JAX-WS might have generated an incorrect WSDL and you are using wsimport from a newer version.




回答2:


Do you have following part in the first line of the wsdl?

<definitions   ...   xmlns="http://schemas.xmlsoap.org/wsdl/">

If not, add it and it should be fine. Reason would be, that the namespace declaration for the wsdl is missing.



来源:https://stackoverflow.com/questions/10537471/wsimport-giving-parse-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!