Thursday, 3 April 2008

WCF Hello World Part -1

This is my first posting on WCF, i thought I would start with Hello World on WCF and i dont know to what extent WCF will take me!. For a reader who finds this posting, this is would be a head start on WCF and am gonna discuss challenges and issues on WCF in part by part.

so, here i am.

first of all I would like to brief What tools i will be using at the moment.

1. Visual Studio 2008 for this posting.

I may wish to revisit this part again for my next posting.

Ok then. Lets fire up Visual Studio 2008 and create WCF Service by name WCFHelloWorld as shown in fig below:



So When i have created, Visual Studio creates some files for me. those are

1. Service1.svc
2. IService1.cs
3. Web.Config
4. App_Code folder with web project settings and references.

What might interests is 2 files 1 and 2 from above. In eariler version of .Net, you would have created Web Services and seen asmx files instead.

now, I am gonna rename those files to fit into my demonstration as WCFHelloWorld.

So, I rename Service1.svc as WCFHelloWorld.svc and IService1.cs as IWCFHelloWorld.cs.

I leave it with you, how you rename the files and organise and make it compilable at least for now. finally i get my compilable as shown below:





Note: Keep in mind that WCF is a runtime for Web Services. In earlier versions of .Net, Asp.Net was runtime for Web Services. now WCF is runtime for Web Services and .Net remoting!. Those who have worked on .Net Remoting, here is a good news, now they can enjoy exploring separate runtime!.


When you build is succeeded, press F5 and opens in browser as shown below:



At this moment, I have created web service and launched it. In next part of this demo, will create a client and consume this web service.

I have tried to make it simple, hence have not been able to delve in detail but taking this as an example, in some part later of this demo will go in depth, until then bye...

----------------end of part -1 ------------

No comments: