2008-10-30 182 views
3

我试图实现一个HTML解析web服务,如第版的第23章中描述的那样,ASP.NET Unleashed(1st ed。)and this MSDN article。到现在为止还挺好!但是,当使用wsdl.exe生成类时,我确实遇到了一个烦人的警告:wsdl.exe导致“找不到SOAP 1.1绑定”

 
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. 

我想尽可能符合规范。我查看了recommended page并在w3.org上找到了几页,但没有找到具体的例子来说明我需要包含哪些xml元素以符合。

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

谢谢!

回答

6

Wsdl.exe默认情况下使用SOAP作为实施协议并因此尝试检查是否符合基本配置文件。无论如何,wsdl.exe可以处理这个问题,只会继续发出警告。如果您检查MSDN article file,您会注意到绑定配置为使用HttpGet协议。因此,如果要禁止警告,请运行

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

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

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

相关问题