wsimport 给出解析错误 [英] wsimport giving parse error

查看:43
本文介绍了wsimport 给出解析错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 wsimport 导入 WSDL 时,出现奇怪的解析错误.

错误:-

<前>org.xml.sax.SAXParseException:无效的 WSDL 文件:预期{http://schemas.xmlsoap.org/wsdl/}定义在第 1 行找到定义)

我检查了 WSDL,我也很惊讶它的第一个元素不是

而是:

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

这可能是问题吗?Web 服务是外部的,因此我无法控制 WSDL.我知道的一件事是它是由 JAX-WS 2.1.5 生成的.它是我的 wsimport 工具无法理解的自定义 WSDL 吗?如果是,请告诉我如何解决此问题.谢谢.

解决方案

wsdl 第一行有以下部分吗?

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

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

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.

解决方案

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.

这篇关于wsimport 给出解析错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆