shijuse
shijuse

Reputation: 291

.net-WCF How do we create a client programatically?

How do I create a client programatically?

Upvotes: 2

Views: 193

Answers (3)

Jith
Jith

Reputation: 1701

Open Visual Studio command prompt and move to client application folder using change directory command and type

svcutil.exe http://your_service_url/your_service_name.svc?wsdl

This will generate a configuration file (output.config) and a client class. Client class name will be your_service_nameClient Next you need to copy the <system.serviceModel> section from output.config to your App/Web config. Now your client application is ready to consume the service. You can create client class object and invoke service methods.

Hope this will help you

Upvotes: 3

Robert Scheibler
Robert Scheibler

Reputation: 169

If you are new to WCF check out this site:

http://msdn.microsoft.com/en-us/netframework/dd939784.aspx

If you are only interested in learning how to create a client, this is the video for you:

http://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Creating-Your-First-WCF-Client/

Upvotes: 1

Nate
Nate

Reputation: 30636

You'll need to start the svcutil.exe process -- it could be done from a program, but it will generate source code, not binary code.

Upvotes: 1

Related Questions