Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I consume a WCF service using a local WSDL file?

Tags:

wcf

wcf-client

I need to consume a WCF service based on a (preferably single) wsdl file.

The environment is VS-2008 (sp1), and I will be using a customized "Add Service Reference" macro to generate an error handling proxy. I want to be able to do this, by supplying a WSDL file that I get from the service provider (I do not want to supply a host URL).

How can this be done?

like image 540
Assaf Stone Avatar asked Sep 27 '09 09:09

Assaf Stone


People also ask

How do you consume WCF service?

With the service running, right click the project that will contain the WCF client proxy and select Add > Service Reference. In the Add Service Reference Dialog, type in the URL to the service you want to call and click the Go button. The dialog will display a list of services available at the address you specify.

Does WCF use WSDL?

You can use WCF to export WSDL documents from a ServiceDescription instance for your service. WSDL documents are automatically generated for your service when you publish metadata endpoints.

What is WSDL in WCF service?

WSDL stands for Web Service Description Language. The WCF service exposes the WSDL document for the clients, to generate proxies and the configuration file. The WSDL file provides the following information for the consumers of the WCF service.

How do I create a SOAP based WCF service?

STEP 1: Create a new WCF service application. Configure service for both basicHttpBinding and webHttpBinding, So in Web. Config file define two endpoints - one each for SOAP and REST. The binding for SOAP is basicHttpBinding and for REST is webHttpBinding.


1 Answers

Sure - you can copy the path+filename for the WSDL and paste that into the "Add Service Reference" dialog box in Visual Studio (or just type int the full path + WSDL file name).

enter image description here

Alternatively, you can use the svcutil.exe command line utility to convert the WSDL file to your client proxy class.

like image 125
marc_s Avatar answered Oct 23 '22 21:10

marc_s