C# wsdl.exe 导致“未找到 SOAP 1.1 绑定”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/251079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 19:57:03  来源:igfitidea点击:

wsdl.exe results in "SOAP 1.1 binding was not found"

c#asp.netweb-serviceswsdl

提问by devlord

I'm trying to implement an HTML Parsing web service as described in Chapter 23 of ASP.NET Unleashed(1st ed.) and this MSDN article. So far, so good! However, I do get an annoying warning when using wsdl.exe to generate the class:

我正在尝试实现一个 HTML 解析 web 服务,如ASP.NET Unleashed(第一版)和这篇 MSDN 文章的第 23 章所述。到现在为止还挺好!但是,在使用 wsdl.exe 生成类时,我确实收到了一个烦人的警告:

Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.

Warning: This web reference does not conform to WS-I Basic Profile v1.1.
SOAP 1.1 binding was not found: WS-I's Basic Profile 1.1 consists of 
implementation guidelines that recommend how a set of core Web services
specifications should be used together to develop interoperable Web 
services. For the 1.1 Profile, those specifications are SOAP 1.1, 
WSDL 1.1, UDDI 2.0, XML 1.0 and XML Schema.

For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.

I'd like to conform to the specification if possible. I looked at the recommended pageand found a couple pages on w3.org, but didn't find a concrete example of what xml elements I need to include in order to conform.

如果可能,我想符合规范。我查看了推荐页面并在 w3.org 上找到了几个页面,但没有找到我需要包含哪些 xml 元素以符合要求的具体示例。

In lieu of posting my xml, I'll just say the wsdl roughly conforms to what is used in the MSDN article (except I fixed the invalid URL for the XMLSchema on w3.org by adding ".dtd").

代替发布我的 xml,我只是说 wsdl 大致符合 MSDN 文章中使用的内容(除了我通过添加“.dtd”修复了 w3.org 上 XMLSchema 的无效 URL)。

Thanks!

谢谢!

采纳答案by Panos

Wsdl.exeuse by default SOAPas the protocol to implement and in consequence tries to check the conformance to the Basic Profile. Anyway, wsdl.exehandles this and continues with only a warning. If you check the MSDN article file, you will note that the binding is configure to use HttpGetprotocol. So, if you want to suppress the warning, run

Wsdl.exe默认情况下使用SOAP作为要实现的协议,并因此尝试检查与基本配置文件的一致性。无论如何,wsdl.exe处理这个并继续只发出警告。如果您查看MSDN 文章文件,您会注意到绑定被配置为使用HttpGet协议。所以,如果你想抑制警告,运行

wsdl.exe /protocol:HttpGet <url or path> 

However, the resulting proxy class is the same with the previous one.

但是,生成的代理类与前一个相同。

Side note: You don't have to fix any URL that defines a namespace, since it is not used as URL but as identifier. Although many namespaces look like URLs, they need not point to actual resources on the Web. The namespace http://www.w3.org/2001/XMLSchemais defined by W3C in XML Schema recommendation.

旁注:您不必修复任何定义命名空间的 URL,因为它不是用作 URL 而是用作标识符。尽管许多名称空间看起来像 URL,但它们不需要指向 Web 上的实际资源。命名空间http://www.w3.org/2001/XMLSchema由 W3C 在XML 模式推荐中定义。