我正在尝试实现HTML解析Web服务,如 ASP.NET Unleashed (第1版)和这篇MSDN文章。到现在为止还挺好!但是,在使用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.

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

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

谢谢!

有帮助吗?

解决方案

Wsdl.exe 默认使用 SOAP 作为要实现的协议,因此尝试检查与Basic Profile的一致性。无论如何, wsdl.exe 处理这个并继续只有一个警告。如果您查看 MSDN文章文件,您会注意到绑定是配置为使用 HttpGet 协议。因此,如果要取消警告,请运行

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

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

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top