我怎样才能使它成为有效的 WSDL?

发布于 2024-12-04 10:48:58 字数 470 浏览 1 评论 0原文

我正在尝试从 此 WSDL 使用以下命令:

svcutil /noConfig /language:C# /out:ICatalog.cs http://schemas.opengis.net/csw/2.0.2/profiles/ebrim/1.0/wsdl/2.0/csw-ebrim-interface.wsdl

但是 svcutil 无法读取它,并且 xMethods WSDL 验证器 表示它无效。

这有什么无效的呢?如何让 svcutil 生成我的界面代码?

I'm trying to generate code from this WSDL using the following command:

svcutil /noConfig /language:C# /out:ICatalog.cs http://schemas.opengis.net/csw/2.0.2/profiles/ebrim/1.0/wsdl/2.0/csw-ebrim-interface.wsdl

However svcutil cannot read it, and the xMethods WSDL validator says it's invalid.

What's invalid about it? How can i get svcutil to generate my interface code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┊风居住的梦幻卍 2024-12-11 10:48:58

我不确定 WSDL 是否有效,但您尝试做的事情不会起作用。 Svcutil 只能为版本 1.1 的 WSDL 文件生成代码。您的是 WSDL 版本 2.0。

当给定您的 WSDL 时,您在问题中指出的 WSDL 验证器会返回以下消息:

faultCode=INVALID_WSDL:需要元素“http://schemas.xmlsoap.org/wsdl/:definitions”。

它将文件解析为 WSDL 1.1。并期望根是定义但是在 WSDL 2.0 中将更改为描述

如果您有有效的 WSDL 2.0 文件,Svcutil2 可能能够为您生成代码,但此工具不支持还不稳定。

要验证 WSDL,我想您可以使用 来自 The Woden 项目的验证器,它不是也很稳定,但基本上是我所知道的唯一一个已经通过“玩具项目”状态的项目。

这个想法是这样的:版本 1.1 仍然是采用 WSDL 时“事实上的”语言。没有多少 WS 框架采用 WSDL 2.0,所以(只是我的 2 美分!)我认为最好坚持使用“标准”,直到对 WSDL 2.0 的支持完全成熟。

I'm not sure if the WSDL is valid or not but what you are trying to do won't work. Svcutil can generate code only for WSDL files of version 1.1. Yours is a WSDL version 2.0.

The WSDL validator you pointed in your question returns the following message when given your WSDL:

faultCode=INVALID_WSDL: Expected element 'http://schemas.xmlsoap.org/wsdl/:definitions'.

It parses the file as WSDL 1.1. and expects the root to be definitions, but that changed in WSDL 2.0 to description.

If you have a valid WSDL 2.0 file, Svcutil2 might be able to generate the code for you, but this tool isn't stable yet.

To validate the WSDL, I guess you could use the validator from The Woden project, which isn't stable either, but is basically the only one that I know that has moved passed the "toy project" status.

The idea is this: version 1.1 is still the "de facto" language when taking WSDL. Not many WS frameworks have adopted WSDL 2.0 so (just my 2 cents!) I think it's better to stick with "the standard" untill support is fully matured for WSDL 2.0.

小巷里的女流氓 2024-12-11 10:48:58

尝试添加参考
参考文献>>添加参考> COM>系统.服务模型

try to add reference
References > Add Reference > COM > System.ServiceModel

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文