我怎样才能使它成为有效的 WSDL? [英] How can i make this a valid WSDL?

查看:26
本文介绍了我怎样才能使它成为有效的 WSDL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

但是 svcutil 无法读取它,并且 xMethods WSDL 验证器 说它无效.

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

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

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

推荐答案

我不确定 WSDL 是否有效,但您尝试执行的操作不起作用.Svcutil 只能为 1.1 版的 WSDL 文件生成代码.您的是 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.

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

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

faultCode=INVALID_WSDL:预期元素http://schemas.xmlsoap.org/wsdl/:definitions".

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

它将文件解析为 WSDL 1.1.并期望根是 definitions但是在 WSDL 2.0 中将更改为 description.

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

如果您有一个有效的 WSDL 2.0 文件,Svcutil2 或许能够为您生成代码,但是这个工具还不稳定.

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.

要验证 WSDL,我想您可以使用 The Woden 项目中的 验证器,它也不稳定,但基本上是我所知道的唯一一个通过玩具项目"状态的.

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.

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

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.

这篇关于我怎样才能使它成为有效的 WSDL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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