TechBubbles

WCF Sample in Visual studio 2008

Introduction

This post explains the procedure to develop the sample Service and Client  in Visual studio 2008. Get an overview on WCF and WCF Terms.

1. Start open  Visual studio 2008, Select new project option from file menu

WCF Start

2. Select the ServiceApplication template from the project templates.

3. Service describes the operations that perform in a service contract.

WCF-Service

4.Declare the service contract in Iservice.cs interface and implement in the above Service class.

WCF-Interface

5. To test this service, you will need to create a client and use it to call the

    service. You can do this using the svcutil.exe tool from the command line with

    the following syntax: Generating a client using svcutil.

  svcutil.exe http://localhost:53391/Service.svc?wsdl

WCFClient

6. The above command generates a code file and configuration file contains the client class. Add the two files to your client application and use the generated client class to call the service.

Generatedclient

7. Client class which call the service looks like

callingservice

8. The generated client configuration file looks like

ClientConfig

9. The service configuration file looks like

service-config

Conclusion

The above post explains shows the standard way to create a service and client and calling the service. The Next posts explains each feature in depth. 

3 Comments so far

  1. DotNetKicks.com August 21st, 2008 2:14 pm

    Developing WCF Sample in VS 2008…

    You’ve been kicked (a good thing) - Trackback from DotNetKicks.com…

  2. Madhavrao September 28th, 2008 5:13 am

    I think you missed one important point. Hosting of WCF Service. You haven’t covered it in your article. This blog I think is targeted towards beginner, so it should have been end-to-end solution. This is just constructive remark to your post. Nothing personal.

  3. [...] post explains how to host a WCF service that we defined in the previous article WCF sample in VS 2008. Specifically we host the WCF service in .NET console [...]

Leave a reply