2010-11-28 38 views
5

我在WebService客戶端程序中收到以下錯誤/警告。WebService客戶端異常:無法導入wsdl:binding

有人告訴我,如果我從我的web.config中刪除協議,例如HTTP/GET和HTTP/POST,它應該可以工作。但我正在使用Windows窗體。

如何在Windows窗體中執行相同操作?

Warning 1 Custom tool warning: Cannot import wsdl:binding 
Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled. 
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.webserviceX.NET']/wsdl:binding[@name='countryHttpGet'] C:\Users\user\Documents\Visual Studio 2010\Projects\PublicWebService\PublicWebService\Service References\CountryInfoWebSrv\Reference.svcmap 1 1 PublicWebService 

Warning 2 Custom tool warning: Cannot import wsdl:port 
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. 
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://www.webserviceX.NET']/wsdl:binding[@name='countryHttpGet'] 
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.webserviceX.NET']/wsdl:service[@name='country']/wsdl:port[@name='countryHttpGet'] C:\Users\user\Documents\Visual Studio 2010\Projects\PublicWebService\PublicWebService\Service References\CountryInfoWebSrv\Reference.svcmap 1 1 PublicWebService 

Warning 3 Custom tool warning: Cannot import wsdl:binding 
Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled. 
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.webserviceX.NET']/wsdl:binding[@name='countryHttpPost'] C:\Users\user\Documents\Visual Studio 2010\Projects\PublicWebService\PublicWebService\Service References\CountryInfoWebSrv\Reference.svcmap 1 1 PublicWebService 

Warning 4 Custom tool warning: Cannot import wsdl:port 
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. 
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://www.webserviceX.NET']/wsdl:binding[@name='countryHttpPost'] 
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.webserviceX.NET']/wsdl:service[@name='country']/wsdl:port[@name='countryHttpPost'] C:\Users\user\Documents\Visual Studio 2010\Projects\PublicWebService\PublicWebService\Service References\CountryInfoWebSrv\Reference.svcmap 1 1 PublicWebService 
+0

你從哪裏獲得WSDL文檔?什麼類型的服務WSDL文檔描述? WSDL僅用於SOAP服務。 WCF支持不使用HTTP GET的SOAP 1.1和SOAP 1.2服務。 – 2010-11-28 10:17:23

回答

0

如果你想使用SvcUtil工具生成服務代理必須刪除相關http://schemas.xmlsoap.org/wsdl/http命名空間至極一切前綴爲HTTP。所以你需要刪除兩個綁定和Web服務端口。在這種情況下,您也不需要兩種端口類型和幾種消息類型。

相關問題