0

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.

4

2 回答 2

0

您在 wsdl 的第一行中有以下部分吗?

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

如果没有,添加它,它应该没问题。原因是缺少 wsdl 的命名空间声明。

于 2012-05-11T11:14:20.977 回答
0

根据此对话,JAX-WS 的 2.1.5 版本可能生成了不正确的 WSDL,并且您正在使用较新版本的 wsimport。

于 2012-05-10T15:48:23.190 回答