Dhruvesh Shah
Dhruvesh Shah

Reputation: 121

WebService Client Exception: Cannot Import wsdl:binding

I got the following errors/warnings in the WebService Client program.

I was told that after if I remove the protocols, such as HTTP/GET and HTTP/POST from my web.config, it should work. But I'm using Windows Form.

How can I do the same in Windows Form?

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

Upvotes: 6

Views: 13501

Answers (2)

Mariajina
Mariajina

Reputation: 1

If you are having 2 projects consuming same wcf, then remove the second reference and comment the code where you use the same. You can consume the same after updating the service in the first project.

Upvotes: 0

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364249

If you want to use svcutil for generating service proxy you have to remove everything related to http://schemas.xmlsoap.org/wsdl/http namespace wich is prefixed as http. So you need to remove two bindings and to web service ports. In that case you will also not need two port types and several message types.

Upvotes: 1

Related Questions