Dennis van der Stelt

I care about technology; I care about users more

Community

Email Notifications

News

  • Addicted to Refactor! Pro
    <div class="sideNavItems">

I read...

I Use...

Tags

Recent Posts

Archives

Blog Subscription Form

  • Email Notifications
    Go

WCF Simple Example

Update : This post was updated and is much more explaining in this post, WCF Simple Example in Visual Studio 2010

On my WCF Introduction post I received a trackback to an example that should be really simple to start WCF with. I'm not here to judge the post (although I could ;-), but it got me thinking. Although I created some small posts on how WCF works, together it might still be too much for people that just want to see the simplest example. So this post is about that example.

There are two ways to present this. In this example I'll use as little code as possible in as few locations as possible. The other way is using the WCF Service Library project that comes with the VS2005 WCF Extension but requires a lot more code, text, etc. More about the in another post.

I'm not judging, but the other post by Ralf Sudelbücher has only one project containing both service, host and client. I'm using two projects, because WCF is all about getting clients to communicate with a service. Let's start.

  1. First, install Visual Studio 2005, .NET Framework 3.0 and the .NET Framework 3.0 WCF/WPF extensions.
    You don't need the SDK. And don't worry about the November 2006 CTP status, this is the latest version.
  2. Open Visual Studio 2005 and create a new console application project, called "Host". 
  3. Add a reference to the project for the System.ServiceModel assembly. It's the core assembly used by WCF.
    If you're using Visual Studio 2008, check out this article if you have problems with adding the service reference.

    add_reference
  4. Add a using statement at the top of your class for System.ServiceModel.
    using System.ServiceModel;
  5. Create a service contract and implement it in the Program.cs file, directly under your Program class. In this example I'm expecting a name and concatenate this to "Hello " and return this immediately.
    [ServiceContract]
    class HelloService
    {
      [OperationContract]
      string HelloWorld(string name)
      {
        return string.Format("Hello {0}", name);
      }
    }
  6. In your Program class, inside the static Main method we need code to host our service. We'll add two endpoints, one for our service and one for extracting the metadata.
        1 static void Main(string[] args)
        2 {
        3   // We did not separate contract from implementation.
        4   // Therefor service and contract are the same in this example.
        5   Type serviceType = typeof(HelloService);
        6 
        7   ServiceHost host = new ServiceHost(serviceType, new Uri[] { new Uri("http://localhost:8080/") } );
        8 
        9   // Add behavior for our MEX endpoint
       10   ServiceMetadataBehavior behavior = new ServiceMetadataBehavior();
       11   behavior.HttpGetEnabled = true;
       12   host.Description.Behaviors.Add(behavior);
       13 
       14   // Create basicHttpBinding endpoint at http://localhost:8080/HelloService/
       15   host.AddServiceEndpoint(serviceType, new BasicHttpBinding(), "HelloService");
       16   // Add MEX endpoint at http://localhost:8080/MEX/
       17   host.AddServiceEndpoint(typeof(IMetadataExchange), new BasicHttpBinding(), "MEX");
       18 
       19   host.Open();
       20 
       21   Console.WriteLine("Service is ready, press any key to terminate.");
       22   Console.ReadKey();
       23 }

    At line 7 we're instantiating our ServiceHost object, specifying a base address at localhost on port 8080.
    At line 15 we're adding our endpoint, using basicHttp, for our service.
    At line 17 we're adding our metadata endpoint. For this we also need to specifiy the MetadataExchange behavior, which we do at line 10, adding it to our ServiceHost at line 12. At line 11 we're enabling HttpGet, which means we can view the metadata using a browser.

    At line 19 we just open the host and everything should work fine. Lines 21 and 22 are waiting on confirmation of a user to close the console application, automatically closing our ServiceHost and thus our service.

    We only need to ad a using statement for the System.ServiceModel.Description because adding a MEX endpoint using code requires this namespace.
    using System.ServiceModel.Description;
  7. Now this is done, let's try and run our service. If all goes well, we'll see the message that the service is ready. You can check it by opening up a browser and visiting http://localhost:8080/
  8. Now we need to create our client. Add a new Windows Forms project called "Client" to our solution.
  9. Right-click the "Host" project and choose "Debug" and then "Start New Instance". Then right-click the "Client" project and select "Add Service Reference". In the dialog that appears type in the address http://localhost:8080/ and press "OK". Now you should have a new folder in your "Client" project with the reference to your service. Stop the service that's still running in the background.
    The System.ServiceModel assembly should be referenced now, the app.config has been added and modified as well as a proxy class under your "localhost" service reference.
  10. On your form in the "Client" project, add a textbox and a button. Double-click the button.
  11. Add three lines to your button-click event.
        1 private void button1_Click(object sender, EventArgs e)
        2 {
        3   localhost.HelloServiceClient proxy = new Client.localhost.HelloServiceClient();
        4   string result = proxy.HelloWorld(textBox1.Text);
        5 
        6   MessageBox.Show(result);
        7 }
  12. Again, right-click the "Host" project and select to start a new instance and do the same for your Windows application. Then fill in your name and press the button.

Congratulations, the most easy and fastest way to create a WCF service. Source-code can be downloaded here.
UPDATE : The zip file was broken, but is now fixed again.

Update : This post was updated and is much more explaining in this post, WCF Simple Example in Visual Studio 2010

Technorati tags: , ,

Comments

Ralf said:

If I inspired you to boil down your previous code to come up with an even simpler scenario to introduce WCF, I´m happy. Maybe we should start a competition on how few lines are necessary to use get started with WCF? ;-)

However, you mentioned twice you wanted to abstain from commenting my sample. Why? What´s wrong with it? I don´t think using two processes is necessary for a WCF introduction. It just makes it more difficult to get the whole thing running. WCF makes process boundaries pretty transparent, so I don´t think they are needed.

Rather much more important I deem separating contract from implementation - which you neglect. Also a WinForms application does not make WCF easier to understand.

Also, do you think meta data exchange makes understanding WCF easier? Hm...

But anyway, I´m happy you took up the challenge ;-)

Cheers

Ralf

# May 14, 2007 12:00 AM

Dennis van der Stelt said:

Hi Ralf,

The single project to get everything going isn't what WCF is about, I think. So that's why I always need at least two projects.

The thing I ment was you were creating client and service by means of multi threading. That doesn't make the example easier to understand, just a lot harder.

The other thing about process boundaries. I'm not sure what you mean there. With WCF you ALWAYS have two process boundaries, because your service/host and client aren't on the same process. In WCF vNext that might be possible, but currently it isn't. Even though you only have 1 project and start everything on multiple threads, still everything is serialized into XML and send cross process boundaries.

# May 14, 2007 10:51 AM

Ralf said:

Hi, Dennis,

I understand what you say, you need two projects. And I agree in the end WCF mostly will be used in such scenarios. But two projects are less easy to set up in VS than one ;-) That´s the only reason I used one project or even just one file. I´m just concerned about getting a WCF sample up and running with the least number of steps and with the least number of files. So I guess we can agree that this is possible only with multithreading like I did it ;-)

In addition, though, I think, WCF is not about a particular "distance" of client and service. It´s perfectly fine to use WCF within the same process, e.g. to cross AppDomain boundaries. And it´s a means to hide "distance" in general so I don´t have to care whether code is running in the same or a different AppDomain or in another process or on another machine. So letting two threads communicate using WCF for me is perfectly valid - albeit maybe a little bit unusual.

What you say about process boundaries does not seem 100% correct to me. You´re right in that messages are always passed between client and service (host). Data always will be serialized. But a process boundary - as you can see in my example - is not necessarily crossed. My client and service host live in the same process and that´s just fine with WCF. However, in a larger scenario I would not just provide a TCP endpoint for intranet communication but also a named pipe endpoint for fastest communication on a single machine - possibly within the same process.

But again: I was not concerned with a real life example of WCF usage but a most easy demonstration.

-Ralf

# May 19, 2007 11:43 AM

Craig Mellon said:

Just like to say thanks for a great article. I just started looking at WCF today, and your article has really helped me get started.
# June 9, 2007 12:05 AM

Earle Beach said:

Thanks a lot! After crashing and burning with MS's "Technology Samples," it's really a great feeling to be able to build a sample that works the first time.
# June 22, 2007 10:38 PM

dylan H said:

Hi,

I just wanted to thank both Dennis and Ralph for your examples. By attempting to create simple example in different ways,  you appeal to varied audiences. Looking at both of your examples will has help get closer to delima I am faced with with.

Thanks

# June 30, 2007 11:50 PM

David T. said:

I wouldn't normally make a WCF project as only one project, so the example of two projects is useful.  However, Ralf's example showed how it could be done in a multi-threaded way - something I would not have known to do.  Thanks to both of you.

# July 19, 2007 4:04 PM

Jeffrey Chilberto said:

WCF example application using headers to pass information between host and client.

# July 26, 2007 3:34 AM

Jeffrey Chilberto said:

The following is an example of passing information in WCF&#39;s operation context message headers. In

# July 26, 2007 3:52 AM

Jeffrey Chilberto said:

The following is an example of passing information in WCF&#39;s operation context message headers. In

# July 27, 2007 1:14 AM

Jeffrey Chilberto said:

The following is an example of passing information in WCF&#39;s operation context message headers. In

# July 27, 2007 1:22 AM

Sanjay said:

Hi Dennis,

Thanks for ur example.

My quest for understanding WCF finally ended by ur example.

# August 21, 2007 12:05 PM

Sivakumar said:

Very nice example with explanation

# September 19, 2007 11:11 AM

Meher said:

Hi... Dennis

I started 3.0 recently and was confused how to start the WCF. Your article is so helpful

Thanks

# October 10, 2007 3:17 PM

Pasquale said:

I couldn't use the example until I had installed not only Visual Studio 2005 and .Net Framework 3.0, but also the "Windows SDK" for .Net (Vista version) and most importantly "Visual Studio 2005 extensions for .NET Framework 3.0" available at: www.microsoft.com/.../details.aspx

Neither this example nor anywhere else I looked explained that.

I can't help wondering where the world will be in 5 years when everyone needs to upgrade from WCF and we are all captive the black magic of this technology.

# October 19, 2007 3:15 PM

Dennis van der Stelt said:

@Pasquale : Just updated the article, you're right, it should've been in there. Other people can thank you for it now. :)

However, you don't need the SDK and your link is to the WF extensions, not the WCF/WPF extensions.

# October 19, 2007 3:28 PM

Pasquale said:

Right, I'm told both WF and WCF/WPF extensions are needed.  Here's the link to the WCF/WPF extensions:

www.microsoft.com/.../details.aspx

# October 19, 2007 3:49 PM

SK said:

Great, Just one word.

ThankYou

# October 25, 2007 5:08 PM

kenny said:

Thank your example, it is pretty helpful and clear to understand the WCF structure in inline code.

you are right, To separate the host and client to different projects makes the route and the concept much more clear, even I modified the binding address from 'localhost' to other '192.168.xxx.xxx' and run the service on other machine, it will be better.

one thing need notifiy is service reference name 'localhost' would be customized to other name by changing the reference name or in its property, it made me confuse at the begining.

Do you have other example using IIS to host the service,config and expose it in web.config? I would like to enjoy it.

# October 31, 2007 4:13 PM

Dennis van der Stelt said:

Kenny, good idea! I'll create an example and tutorial for that. But it'll probably be next week.

# November 1, 2007 10:32 AM

Alan said:

One or Two project samples are nice so long as it's short and simple like this one and i don't see what the fuss is about.

# December 18, 2007 4:03 PM

Dennis van der Stelt said:

Alan, what do you mean with 'the fuss'?

# December 19, 2007 8:26 AM

Sangram said:

Good One

# February 27, 2008 12:54 PM

Waqt said:

Good one it helped me a lot thanx

but can u provide the steps for WCFClassLibrary also

# March 12, 2008 1:16 PM

newbie said:

Nice sample!!!  yes this is what i have been looking for too, nice and simple.  would you happen to have a WF State machine simple sample too?

# March 21, 2008 2:34 AM

jeff said:

Trying to use this with VS 2008 and I cant seem to set the ref to the host service while it is running. Any ideas? All the options on the Client project are grayed out when the host is running.

# March 28, 2008 7:41 PM

Dennis van der Stelt said:

Jeff, check out the following post I just wrote for the solution:

bloggingabout.net/.../quot-add-service-reference-quot-is-disabled.aspx

# March 28, 2008 9:17 PM

Robbie Huttenhower said:

Great article.  I like simple.

# May 22, 2008 10:50 PM

Sujith said:

Great one, It was really helpfull

# June 3, 2008 8:55 AM

David Rogers said:

Nice simple article. However, I ran into a gotcha immediately:

"HTTP could not register URL http://+:8080/. Your process does not have access rights to this namespace (see go.microsoft.com/fwlink for details)."

Apparently, metadataexchange requires elevated privileges? Is this something I am getting because this is VS2008? Vista Ultimate? Any ideas on how to be able to tell Visual studio to debug with elevated privileges?

Thanks,

David

# June 8, 2008 11:23 PM

Amit Dave said:

Hi

First of all would like to thank you for such an encouragin example;

and am sure this is just a begining would like to have more detail and indepth use of WCF, could you just let us know that how wsdl and wcf are inter-related with each other and more inportantly scenarios suitable for WCF...

thanks again and expect such articles in future as well...

# June 9, 2008 10:55 AM

Dennis van der Stelt said:

@David : It's a Vista 'problem'. Run VS2008 as administrator (which I always do), or check out this article : blogs.msdn.com/.../addressaccessdeniedexception-http-could-not-register-url-http-8080.aspx

@Amit : There are more articles on my weblog, just click the "WCF" tag in the tag-cloud.

I'll make a post about WSDL and MetadataExchange in the future to try and explain it the simple way! :)

For now I can say the "WSDL" is the "WebService Description Language". You can enable it via the metadata service behavior. WSDL is like an "addon" feature on MetadataExchange so that consumers (clients) that don't support metadataexchange are still able to retrieve the WSDL.

# June 24, 2008 12:18 PM

chandru said:

Thank you very much.Its really useful for beginners in WCF.This real time exmaple helped me to understand better.

# July 9, 2008 8:49 AM

Venkat R Y said:

I am new to WCF this example has helped to understand how WCF works... Thanks very much Dennies.

# July 13, 2008 10:22 AM

prabhu said:

Thank you, Simple example has helped lot to understand WCF

# July 24, 2008 6:40 AM

Aravinthan said:

Hi Dennis,

Thanks a million. I am a newbie to the WCF and simply couldn't get a clue of how and where to start. Your simple example gave me a solid starting point. Once again.. thanks a lot and keep up the good work.

# July 24, 2008 1:27 PM

abraham said:

Dennis,

Your's was the first WCF example that I was able to get working successfully, Thank you.

I have been trying one example after another in the hope that I could better wrap my head around WCF concepts once I had a working model to play with.

Your example creates a temporary web service. How does one go about deploying the service to IIS 5 & 6?

Appreciate the hand-holding.

# August 5, 2008 8:44 PM

Kenneth said:

Thanks for the great example. But I wonder if you can tell me why my service reference will not update. I have changed the endpoint addresses to a foreign machine's address and I can view the output in a browser when I navigate to that ip. However, when I try to do "Update Service Reference," it errors out. It is not a firewall issue as I can browse to the machine, but what else could it be?

Thanks.

# August 13, 2008 4:12 PM

sandhya said:

Really this is very nice example for those who started 3.0

can u please give some more examples

thanks and regards

sandhya

# August 14, 2008 3:36 PM

Dennis van der Stelt said:

@abraham: I'll try and post something soon about that.

@Kenneth: Normally you can only see the nice HTML page when going to the service when you're browsing locally on the machine (or server). Maybe you don't have a MEX endpoint on the server so it can't update?

Either way, when from development the service its interface hasn't changed, you should be able to change the url of the service in the web.config or app.config and be fine. You don't have to actually update the service reference, that's just for updating the underlying proxy code, for when you've changed your interface (ie. added new operations, changed parameters, etc).

# August 24, 2008 6:20 PM

Alex said:

thank you, very helpful article !

# October 23, 2008 6:05 PM

Suresh said:

Suresh .... where's the Choclate?

# October 24, 2008 10:38 AM

Pooja said:

HTTP could not register URL http://+:8080/ because TCP port 8080 is being used by another application.

I am getting this exception for each and every WCF example that I try to run.

I am a student and rwally need somebodys help.

Please tell me how to go about it in detail since I am a student I really understand only if told me in detail please.

Thanks

# November 1, 2008 9:13 PM

Dennis van der Stelt said:

@Pooja : That's the problem with students, if you don't tell them in detail, they won't know. That's not what we need at companies! Nah, just kidding! ;)

Anyway, only one application can host something at a specific port. So if some other tool is using 8080, use a different port. You can also use 81, or 8081 or any number. I also like port 1337 :)

It's also possible that Vista doesn't allow you to open the port and that VS2008 (or .NET actually) reports a strange message. Are you running Vista? And if so, are you running VS2008 in Administrator mode?

# November 3, 2008 2:05 PM

abraham said:

"@abraham: I'll try and post something soon about that."

Just a reminder if you can make the time.

I admit once I got your example working I was able to implement a nice prototype that involves queuing messages on MSMQ and processing them asynchronously.

I still have run into trouble deploying to IIS however :(

Thanks for getting us all started.

# November 4, 2008 12:34 AM

Dennis van der Stelt said:

@abraham: You're right, and promised is promised. I'll set a reminder in Outlook

# November 4, 2008 8:28 AM

Jeff said:

Excellent example for demonstrating the basics of WCF.  Just what I needed - thanks!

# November 5, 2008 10:42 PM

GiulianoMX said:

Great article, thanks for taking your time an putting it together.

# November 5, 2008 11:50 PM

darge said:

I am using visual studio 08

I created the host and tried to test it using IE7 but it returns an error.

any solution......

# November 7, 2008 10:44 PM

Dennis van der Stelt said:

darge : You seriously can't expect me to help you with so little information.

# November 8, 2008 9:27 PM

Ravi Vaswai said:

Nice Article..Thanks Dennis van der Stelt

# November 13, 2008 8:42 AM

Sunil Kurian said:

Thanks Dennis,

This is a very cute and rich example to start with. Expect more examples to lead us to grow better on different scenarios.

Really appreciate for what you deliver.

regards

Sunil Kurian

# December 9, 2008 6:24 PM

Ran said:

Thanks !

This help to understand

# December 10, 2008 12:39 PM

Vaishnavi said:

All the steps till 8 were successful however I dont find localhost.map and localhost.cs file under Service Reference. app.config is available though. I am stuck with the button event coz of that.

I am using VS 2008. I could see those files in your downloaded code after successfully opening in VS 2008.

Please help.

# December 16, 2008 12:54 PM

Dennis van der Stelt said:

@Vaishnavi : Were you able to create the "Service Reference" in VS2008 in your client project? ie Client Project being the project that would call the service?

# December 16, 2008 1:25 PM

Sujith Balakrishnan said:

Cooollllllllllllllll

# December 17, 2008 8:18 AM

abraham said:

Dennis,

I referenced your arrticle in a submission to CodeProject.

www.codeproject.com/.../WCF_MSMQ_Integration.aspx

Hope that's ok.

# January 4, 2009 6:32 AM

Dennis van der Stelt said:

@abraham : no problem, of course!!!

# January 5, 2009 10:43 AM

arun said:

Hey how can i host service and client on different machines please provide me a url if u already hav a sample on it

# January 19, 2009 11:32 AM

Dennis van der Stelt said:

@arun: Just run the service on another machine and change the url in your web.config on your client... If that's what you mean?

# January 19, 2009 12:34 PM

Neeraj said:

What a great example for a beginer.

Thanks alot for this article.

# February 9, 2009 5:16 PM

Barney said:

I'm a VB.NET programmer and have managed to convert your example, albeit the following line.

localhost.HelloServiceClient proxy = new Client.localhost.HelloServiceClient();

Vb does'nt recognise 'Client.localhost.HelloServiceClient()

Can you help?

Thanks

# March 5, 2009 5:28 PM

Dennis van der Stelt said:

@Barney : Maybe remove Client or Client.localhost altogether. If it does recognize localhost.HelloServiceClient then you're okay, because you need exactly the same on the other end :)

# March 6, 2009 9:45 PM

Sally said:

Hi dennis...I'v successfully done a simple wcf application using your code. I needed to use a wcf service using java client though..Can you help me in this by providing the client code of your apllication in java????

# March 7, 2009 3:49 PM

Dennis van der Stelt said:

@Sally : Java? What's that? :) But seriously, I could not tell you how to do that as I have no idea. But if you lookup how to connect to ASP.NET Webservices from Java or how to do SOAP 1.1 or SOAP 1.2 style services, than you should be okay.

Some examples:

www.codeproject.com/.../WSfromJava.aspx

stackoverflow.com/.../301120

forums.sun.com/thread.jspa

and from MSDN

msdn.microsoft.com/.../ms953968.aspx

As far as I know, you do need some extra framework though. It's not by default in java.

# March 9, 2009 7:40 AM

sally said:

thanks a lot neways...i'l check out d refernces

# March 9, 2009 6:47 PM

Barney said:

Thanks Dennis - did you mangage to get this example to work across two different machines?

So far i've been unable

# March 11, 2009 11:37 AM

Dennis van der Stelt said:

@Barney : Sorry mate, but your last comment can't be approved by the system. Maybe it's because it suspects HTML in the comment. I'll have to look into it.

But... Is your service actually running? If the service isn't running (ie. the host project should be started and doing it's work) than no one will ever be able to find the service.

About the last comment, yes I have! :)

First try to get it working with basicHttp and if that's working, try other bindings. A lot of bindings can give problems with security. For example netTcp is secure by default, but if you don't know that and/or the service is in another domain or in a workgroup, you can run into all kinds of problems.

If you want to use authentication, try to use Windows authentication as it's the easiest. Almost everything else needs X509 certificates.

# March 12, 2009 9:00 AM

Didier M said:

Your simple example was very helpfull. Thanks for making my day.

Didier M

# March 14, 2009 4:13 PM

Marius said:

Hi,

Installed all Net.3.5 SP1 VC 8, wcf framework,

Still getting

------ Build started: Project: wcf_node, Configuration: Debug Any CPU ------

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.Core.dll" /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.Data.dll" /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.dll" /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.ServiceModel.dll" /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.Xml.dll" /reference:"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\wcf_node.exe /target:exe Program.cs Properties\AssemblyInfo.cs

D:\_FL\wcf_node\wcf_node\Program.cs(11,6): error CS0246: The type or namespace name 'OperationContract' could not be found (are you missing a using directive or an assembly reference?)

D:\_FL\wcf_node\wcf_node\Program.cs(11,6): error CS0246: The type or namespace name 'OperationContractAttribute' could not be found (are you missing a using directive or an assembly reference?)

D:\_FL\wcf_node\wcf_node\Program.cs(8,2): error CS0246: The type or namespace name 'ServiceContract' could not be found (are you missing a using directive or an assembly reference?)

D:\_FL\wcf_node\wcf_node\Program.cs(8,2): error CS0246: The type or namespace name 'ServiceContractAttribute' could not be found (are you missing a using directive or an assembly reference?)

# March 18, 2009 8:05 PM

Dennis van der Stelt said:

@Marius : Did you use "Using System.ServiceModel" at the top of your code as I point out in bullet 4?

When your cursor is on the OperationContract or ServiceContract attribute, a small red line should appear, if you didn't include the "Using System.ServiceModel". The text should also be black if you didn't. You can then press CTRL+. (So press CTRL and the . at the same time) and it should popup a small menu that allows you to add the using statement.

If you _did_ use the using statement, both attributes should display in a bluish or greenish color, just like the code snippet 5 displays.

# March 19, 2009 8:56 AM

Barney said:

Dennis

Thanks - got it working over different servers - forgot to amend the app.config to new server name.

Brilliant example by the way

Thanks

# April 2, 2009 12:49 PM

Goran said:

Hello Dennis,

Your sample is excellent and I'm wondering if it's possible to use it in Silverlight application? I've tried that, but there's HelloWorldAsync method that accepts string argument, but returns void. Do you happen to know how to overcome this?

Thank you in advance.

Goran

# April 17, 2009 8:33 PM

Dennis van der Stelt said:

Hi Goran,

Yes I do. In Silverlight they don't allow you to wait for the result, because that would mean the screen would lock up. Therefor everything is asynchronous.

There should be an event, called HelloWorldCompleted. You recognize it in the intellisense list by the lightning icon. Select it, type += behind it and press [TAB] a few times.

A new method should be created in which you can handle the return value.

It should look something like:

public void MyButtonClick()

{

 HelloServiceClient svc = new HelloServiceClient();

 svc.HelloWorldCompleted += new EventHandler<HelloWorldCompletedEventArgs>(svc_HelloWorldCompleted);

 svc.HelloWorld("dennis");

}

public void svc_HelloWorldCompleted(object sender, HelloWorldCompletedEventArgs e)

{

 string result = e.Result;

}

But that's from the top of my head, so I could be wrong somewhere.

If it doesn't work, let me know.

# April 17, 2009 9:04 PM

karthikeyan said:

Its very good example.

# June 17, 2009 2:11 PM

Stephen said:

Hi Dennis I like your example! thanks.

# July 30, 2009 9:29 AM

Cool said:

HI,

nice example, could u give an example code of WCF web service returning data from SQL Server.

thanks,

# August 12, 2009 6:23 PM

marek said:

hallo,

i am using from today VS 2008. so i want to try tu use WCF on it. but i couldn't the Service references by the Way above. does anybody have any experience about it?

thanks

# August 19, 2009 7:49 PM

marek said:

ich mean, i couldn't add/create the Service references by the Way above

# August 19, 2009 8:42 PM

Dennis van der Stelt said:

You mean you've got this problem? What's your actual problem?

bloggingabout.net/.../quot-add-service-reference-quot-is-disabled.aspx

# August 21, 2009 9:57 PM

S kapil said:

Good Article

Thanks!

kapil

# August 25, 2009 12:01 PM

S kapil said:

Dennis van der Stelt, Your efforts are appriciated.

I am new to WCF. based on your article, I am able to create and run WCF ..... cool

Thanks

kapil

# August 25, 2009 3:36 PM

Amol Mahajan said:

Its really useful for beginners in WCF.

# September 8, 2009 11:18 AM

fabio said:

hi,

at Host.Open() i get following exception

 Message="HTTP could not register URL http://+:8080/. Your process does not have access rights to this namespace (see go.microsoft.com/fwlink for details).

i visited microsoft link, but is not clear what command i have to key and if i need to open command windows from netsh tool. I'm working with win7.

can you help me?

# September 20, 2009 11:38 PM

Andrew said:

Thank you very much!

This example was exactly what I needed :)

Andrew

# October 3, 2009 8:49 PM

DungDLT said:

Thanks so much!

This sample as a start point!

# December 1, 2009 5:10 PM

bas said:

Hi,

Please tell me how to create client in VS 2005

# January 7, 2010 9:28 PM

Dennis van der Stelt said:

@bas : Maybe this article will help : bloggingabout.net/.../WCF-Part-4-_3A00_-Make-your-service-visible-through-metadata.aspx

It says something about "svcutil" and how to run it. I'm not sure if, after install of .NET 3.0 SDK, the "Add Service Reference" is available in VS2005. If not, use svcutil.exe, that's what VS2008 uses itself.

# January 8, 2010 9:26 AM

dinesh dangi said:

hi,

i am having a problem while running this application,as u are saying right click on host->debug->new instance then click on client -> service refrence ,its not allowing to add service reference ,its showing in disabled form.without doing debug-> new instance ,if I do the same ,then its showing error occured,as its not taking http://local host/8080/ ,saying no service is there.please look into the issue and let me know if you can fix it.

# January 11, 2010 10:29 AM

Dennis van der Stelt said:

# January 11, 2010 11:24 AM

Sumeet said:

Thank you, for writing such a simple example.

It was of great help in understanding the basic concept of WCF.

# February 25, 2010 8:31 AM

Ravi Naik said:

Good 1............

# April 20, 2010 2:12 PM

EATONAllyson19 said:

If you're in uncomfortable position and have no cash to go out from that, you would require to receive the <a href="lowest-rate-loans.com/.../mortgage-loans">mortgage loans</a>. Because that will aid you emphatically. I take collateral loan every single year and feel myself good just because of that.

# April 23, 2010 6:41 AM

Ramana said:

Can u tell how to execute this sample.breif theory how it will work.i am new to wcf.if i will keep host as startup project i am getting some window while clicking on anything it is disappearing but when i keep Client as star up page while clicking on button getting TCP error.can give some solution to this.thax in advance...

# May 11, 2010 9:15 AM

surya said:

Hi

Can anybody plz help me out i am getting this error ...

The HttpsGetEnabled property of ServiceMetadataBehavior is set to true and the HttpsGetUrl property is a relative address, but there is no https base address.  Either supply an https base address or set HttpsGetUrl to an absolute address.

# May 27, 2010 8:57 AM

Dennis van der Stelt said:

@Surya : Sure, perhaps reading this article will help.

bloggingabout.net/.../WCF-Part-6-_3A00_-Address.aspx

# May 28, 2010 10:06 PM

guyjasper said:

hi dennis, i'm having problem after adding a Service Reference. just like some people above, after adding Service Reference, there is no localhost.map / localhost.cs files under Service References. I'm using VS 2008. Host was running fine.

# June 11, 2010 7:22 AM

Dennis van der Stelt said:

"localhost" is the namespace used. When you enter HelloServiceClient, Visual Studio 2008 should be able to help you find the namespace and add the using statements at the top of your code. Be careful though to enter the HelloServiceClient case sensitive, or else VS2008/VS2010 can't help you find the namespace.

Place your cursor in the HelloServiceClient and press CTRL + . or hover your mouse over it and click the widget that opens up.

# June 11, 2010 8:55 AM

guyjasper said:

hi dennis, i was able to make it work. in my project, it created ServiceReference1 (it was the default namespace i used when adding the Servive Reference). HelloServiceClient was an object under ServiceReference1 (as what is displayed in the object browser). i just had to replace "localhost" with "ServiceReference1" and it works. thanks for the tutorial ;)

# June 11, 2010 10:05 AM

Dennis van der Stelt said:

@guyjasper : Glad it worked! Congrats!

# June 11, 2010 12:02 PM

Krischu said:

Does there exist a newer example for VS2008? I'm getting an error 415 when trying to add a server method and generate the client proxy file.

C:\Users\Krischu\Projects\WCF\WCFSimpleExample>"C:\Program Files\Microsoft

SDKs\Windows\v7.0\Bin\svcutil.exe" localhost/HelloService /out:Proxy

.cs

Microsoft (R) Service Model Metadata Tool

[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]

Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'localhost/HelloService' using

WS-Metadata Exchange or DISCO.

Microsoft (R) Service Model Metadata Tool

[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]

Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from localhost/HelloService

If this is a Windows (R) Communication Foundation service to which you have acce

ss, please check that you have enabled metadata publishing at the specified addr

ess.  For help enabling metadata publishing, please refer to the MSDN documentat

ion at go.microsoft.com/fwlink.

WS-Metadata Exchange Error

   URI: localhost/HelloService

   Metadaten enthalten einen Verweis, der nicht aufgelöst werden kann: "http://

localhost:8008/HelloService".

   Der Inhaltstyp "application/soap+xml; charset=utf-8" wurde von Dienst "http:

//localhost:8008/HelloService" nicht unterstützt. Möglicherweise besteht keine Ü

bereinstimmung zwischen Client- und Dienstbindung.

   Der Remoteserver hat einen Fehler zurückgegeben: (415) Cannot process the me

ssage because the content type 'application/soap+xml; charset=utf-8' was not the

expected type 'text/xml; charset=utf-8'..

HTTP GET Error

   URI: localhost/HelloService

   Fehler beim Downloaden von 'localhost/HelloService'.

   Fehler bei der Anforderung mit HTTP-Status 400: Bad Request.

If you would like more help, type "svcutil /?"

C:\Users\Krischu\Projects\WCF\WCFSimpleExample>pause

Drücken Sie eine beliebige Taste . . .

# June 14, 2010 10:30 AM

Dennis van der Stelt said:

@Krischu : The log says port 8008, but isn't it 8080 in your case, just like in mine?

# June 14, 2010 12:34 PM

Krischu said:

Hi Dennis, thanks for the quick answer. I changed all (hopefully) occurences from 8080 to 8008 (since I have running other services - tomcat - on 8080).

--

Christoph

# June 14, 2010 8:05 PM

Dennis van der Stelt said:

@Krischu : Let me know if it works, or doesn't work. I'm working on an updated version of the example, including more info on how to host it inside a console app and IIS and get more bindings/protocols working.

# June 14, 2010 8:22 PM

Krischu said:

Here again the output. Must have been some problem with cut/pasting the message: (but, as said, I changed 8080 to 8008 on purpose)

C:\Users\Krischu\Projects\WCF\WCFSimpleExample>"C:\Program Files\Microsoft

SDKs\Windows\v7.0\Bin\svcutil.exe" localhost/HelloService /out:Proxy

.cs

Microsoft (R) Service Model Metadata Tool

[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]

Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'localhost/HelloService' using

WS-Metadata Exchange or DISCO.

Microsoft (R) Service Model Metadata Tool

[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]

Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from localhost/HelloService

If this is a Windows (R) Communication Foundation service to which you have acce

ss, please check that you have enabled metadata publishing at the specified addr

ess.  For help enabling metadata publishing, please refer to the MSDN documentat

ion at go.microsoft.com/fwlink.

WS-Metadata Exchange Error

   URI: localhost/HelloService

   Metadaten enthalten einen Verweis, der nicht aufgelöst werden kann: "http://

localhost:8008/HelloService".

   Der Inhaltstyp "application/soap+xml; charset=utf-8" wurde von Dienst "http:

//localhost:8008/HelloService" nicht unterstützt. Möglicherweise besteht keine Ü

bereinstimmung zwischen Client- und Dienstbindung.

   Der Remoteserver hat einen Fehler zurückgegeben: (415) Cannot process the me

ssage because the content type 'application/soap+xml; charset=utf-8' was not the

expected type 'text/xml; charset=utf-8'..

HTTP GET Error

   URI: localhost/HelloService

   Fehler beim Downloaden von 'localhost/HelloService'.

   Fehler bei der Anforderung mit HTTP-Status 400: Bad Request.

If you would like more help, type "svcutil /?"

C:\Users\Krischu\Projects\WCF\WCFSimpleExample>pause

Drücken Sie eine beliebige Taste . . .

# June 14, 2010 8:23 PM

Dannyboy said:

Greeat article.  I'm stuck on step 9.  When i create a new instance of the host, I am unable to right click on the client project and add the reference.  I am using VS 2005.  Any thoughts?

# June 14, 2010 8:54 PM

Dennis van der Stelt said:

@Dannyboy : VS2005 was a long time ago for me, sorry. Is it the problem described here?

bloggingabout.net/.../quot-add-service-reference-quot-is-disabled.aspx

Else check out this article about svcutil.exe

bloggingabout.net/.../WCF-Part-4-_3A00_-Make-your-service-visible-through-metadata.aspx

# June 14, 2010 11:19 PM

prasad said:

nice article i am searching from a long time for like this article thank u so much

# June 15, 2010 6:38 AM

Dennis van der Stelt said:

@Krischu You should probably do http:// and specify the right port number using the svcutil. So it should be something like

svcutil.exe localhost/HelloService /out:Proxy.cs

# June 15, 2010 7:38 AM

Krischu said:

Dennis,

I have no idea, why the :8008 (colon - 8008) did not make it through the cut/paste mechanism into the text area in this blog. Believe me, They are all there in the original statement. So that's definitely not he issue. I'm passing the correct URL to the svcutil command line.

--

Christoph

# June 15, 2010 9:17 AM

Dennis van der Stelt said:

@Krischu: Go to the url of your service with a browser. You might've made a mistake in your service that makes the (http) MEX endpoint not available. The browser will most likely tell you what's wrong.

# June 15, 2010 9:21 AM

Krischu said:

Dennis, you can see it from your own post: The URL is converted to a link. When you hover with the mouse you can see the complete URL in the status bar. This is due the lack of posting code (pre) sections in this blog.

--

Christoph

# June 15, 2010 9:22 AM

Krischu said:

Hah! I figured it out:  

<pre>

svcutil http://localhost:8008/?wsdl  /out:proxy.cs

</pre>

(localhost : 8008 that is in the above line, in case it gets eaten by the blog formatting again :)

--

Christoph

# June 15, 2010 9:38 AM

Dennis van der Stelt said:

@Krischu : Contact me via the contact form. We'll discuss this over email further! :)

# June 15, 2010 11:08 AM

Enrico said:

Hi

i have tried this sample with Visual Studio 2008 but don't working. I can't do the steps from 9 in avant ... where is my mistake? Thanks in advance

# June 15, 2010 3:02 PM

Dennis van der Stelt said:

@Enrico : What exactly can't you do? Did you try this:

bloggingabout.net/.../quot-add-service-reference-quot-is-disabled.aspx

# June 15, 2010 4:08 PM

Enrico said:

Hi Dennis

thanks you for your help, i solve it!!! When i run the application appeare the next error: "HTTP could not register URL http://+:8080/. Another application has already registered this URL with HTTP.SYS."

I think because i have publish the Host application in localhost, so how can i un-publish? Thank again

# June 15, 2010 4:55 PM

Dennis van der Stelt said:

@Enrico

There might be two problems. In more secure versions of Windows (Vista, 7) you can't just register addresses on ports, because you're not allowed. Run Visual Studio as Administrator and it works.

The other thing is that there is already running something on that port. There can't be two listeners on the same port. So either shutdown the first application, or change the port number in your wcf service.

# June 16, 2010 9:11 AM

Enrico said:

Hi

now all working good. I have the next question: is necessary that the service is always active for consume it from client? In test enviroment if the service it's not live i cant consume it from client, there si something wrong yet or it's normal so? Thanks in advance

# June 16, 2010 9:31 AM

Dennis van der Stelt said:

@Enrico: YES! :)

But you can also host in IIS and then IIS will bring the service to life when the first call takes place. IIS will also tear it down after 20 minutes of inactivity.

# June 16, 2010 10:04 AM

Krischu said:

Caveat: When you go to VS2008 you will still see that there are different Menu items in the area of "Add Service Reference" vs. "Add Web Reference", depending on whether to set the project based on Net 2.0, 3.0 or 3.5.

--

Christoph

# June 16, 2010 10:26 AM

Enrico said:

For Host the service in IIS i must Publish it in IIS, after i must create the proxy client with svcutil tool?

# June 16, 2010 10:43 AM

Dennis van der Stelt said:

@Enrico: Either that or with "Add Service Reference" in Visual Studio :)

# June 16, 2010 10:51 AM

Dennis van der Stelt said:

It’s been a long, long time since I wrote the original WCF Simple Example post. It was even before Visual

# June 16, 2010 8:36 PM

Sree said:

Hey,

Thank you so much for your wonderful article.Cheers.

# June 17, 2010 2:40 PM

Freshdls said:

Your sample is excellent and I'm wondering if it's possible to use it in Silverlight application? I've tried that, but there's HelloWorldAsync method that accepts string argument, but returns void. Do you happen to know how to overcome this? I wish to use http://www.evildrome.com for all my downloads.

# June 19, 2010 5:29 AM

paulhar333 said:

Excellent article, keep up the good work. I read a lot of forums on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your forum.

Thanks.

<a href="http://servetechnology.com" rel="dofollow">Serve Technology</a>  

# July 3, 2010 9:55 AM

Ray said:

Great series of posts thanks so much for your time in writing them and answering questions. What a good web samaritan you are! ;.)

Question please: I created a web service from a msdn article-basichttpbinding and I can only get to the /MEX endpoint. I can't browse to the svc or svc?wsdl

How do I enable this for sharepoint?

TIA.

Ray

# September 12, 2010 10:33 PM

sandeep said:

Hiiiii   Dennis

i am getting folling error ..please help over that

Could not connect to localhost/HelloService. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8081.

# September 16, 2010 1:01 PM

sandy said:

can u give example for two machine client and server  connected through LAN

# September 17, 2010 1:45 PM

SNS said:

Hi Dennis,

Awesome man, Really simple & nice blog for understanding WCF.

Thanks

SNS

# October 10, 2010 10:40 PM

Rajendra prasad said:

Hi Dennis,

I have created same as you given in blog.host application executed correctly then i created Client Application same as you given.Here am getting error at local and client.am included namesapce(service refrence added in client).the following code written i client application.

using System.ServiceModel;

using System.ServiceModel.Description;

localhost.HelloServiceClient proxy = new Client.localhost.HelloServiceClient();    

string result = proxy.HelloWorld(textBox1.Text);    

MessageBox.Show(result);

please help where done mistake in my application.

Thanks & Regards,

Rajendra prasad.

# October 27, 2010 12:52 PM

Dennis van der Stelt said:

Rajendra,

The mistakes are most likely in the configuration. And as you don't provide the error message itself, I really don't see how I can help you.

# October 27, 2010 4:36 PM

Rajendra Prasad said:

Hi Dennis,

I have created same as you given in blog.host application executed correctly then i created Client Application same as you given.Here am getting error at local and client.am included namesapce(service refrence added in client).the following code written i client application.

using System.ServiceModel;

using System.ServiceModel.Description;

localhost.HelloServiceClient proxy = new Client.localhost.HelloServiceClient();    

string result = proxy.HelloWorld(textBox1.Text);    

MessageBox.Show(result);

while running am getting error as below listed:

The type or namespace name 'localhost' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'Client' could not be found (are you missing a using directive or an assembly reference?)

my configuaration file code listed below:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

   <system.serviceModel>

       <bindings>

           <basicHttpBinding>

               <binding name="BasicHttpBinding_HelloService" closeTimeout="00:01:00"

                   openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

                   allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

                   maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

                   messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

                   useDefaultWebProxy="true">

                   <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

                       maxBytesPerRead="4096" maxNameTableCharCount="16384" />

                   <security mode="None">

                       <transport clientCredentialType="None" proxyCredentialType="None"

                           realm="" />

                       <message clientCredentialType="UserName" algorithmSuite="Default" />

                   </security>

               </binding>

           </basicHttpBinding>

       </bindings>

       <client>

           <endpoint address="localhost/HelloService" binding="basicHttpBinding"

               bindingConfiguration="BasicHttpBinding_HelloService" contract="ServiceReference1.HelloService"

               name="BasicHttpBinding_HelloService" />

       </client>

   </system.serviceModel>

</configuration>

please help where done mistake in my application.

Thanks & Regards,

Rajendra prasad.

# October 28, 2010 9:04 AM

Dennis van der Stelt said:

First, your configuration is wrong. It says the endpoint its address is at "localhost/HelloService" and that's not a uri. It's probably "localhost/HelloService" or "localhost/HelloService" if you've followed the tutorial correctly.

When you created the service reference, something was different than in my example or initial setup. At the bottom of the screen you specify the namespace. As shown in this screen:

bloggingabout.net/.../4784.CreateServiceReference_5F00_34697BA6.png

In that screenshot, it says "ConsoleClient" and in the tutorial above it suspects that "localhost" is there. That's your problem when it says it can't find localhost. It's not a WCF problem, it's a .NET namespace/type problem that's found at compile time.

# October 28, 2010 9:22 AM

Joyjit said:

Extremely helpful example. Thanks Dennis.

# October 28, 2010 10:53 AM

Shri said:

good exmaple.

steps to test the project:

==========================

1) run host project(open only host project and run)

2) then only you will be able to add "http://localhost:8080/" to the client project

3)now run client project and test it.

Note: add servicereference is nothing but addwebreference.

# November 2, 2010 5:18 PM

Jessi Singh said:

Dennis & Ralf, thank you both for this lovely article. Please keep the articles coming that make understanding new concepts easy.

Thanks again,

Jessi

# December 17, 2010 12:23 AM

vincent said:

Hi Dennis, good article for startup. I was wondering what MEX endpoint for, I commented the line and I can still browse from IE and call the service in the windows app. So what's it used for?

# January 6, 2011 5:03 PM

Friend said:

Very nice article ...thanks a lot friend...keep it up

# January 8, 2011 6:48 AM

Dennis van der Stelt said:

@vincent: The MEX endpoint is for discovery of the contracts. In other words, without it you should not be able to discover what actions (commands/methods) are available and what they require as input.

The fact that your HTTP endpoint is still visible, can have multiple reasons. For example, in .NET 4.0 the MEX endpoint is automatically added to the service, even if you don't specify it! :)

# January 11, 2011 9:26 AM

jony said:

Could not connect to localhost/HelloService. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8080. help

# January 16, 2011 5:12 PM

Dennis van der Stelt said:

@Jony : It's really hard with so little information. It's on localhost so I presume you can connect to it. Sometimes going over machine boundaries makes problems harder. But it could be all kinds of problems. Server not running, not running correctly, binding not setup, etc, etc, etc...

# January 17, 2011 9:12 AM

Ashish said:

Thanks buddy, Its Great

# January 20, 2011 4:01 PM

Steve said:

It's a great smaple for me to start lean WCF. Thanks!

# February 15, 2011 7:36 PM

Ritesh said:

Hey thanx a lod buddy, you know i also implemented image upload through ajax using REST webservice its GREAT!!!!. I needed a mechanism to upload images ajax based on my website http://www.jalandharsearch.com and it worked like a charm.Thanks again

# February 21, 2011 8:54 AM

Huzefa said:

Hi,

I tried implementing the service but I am getting the 'AddressAccessDeniedException' Http could not register the url....

I have read all the above comments and have tried to do the following:

1.Run as admin. (am using vista, VS2010)

2. tried to change the port no. from 8080 to 1337 or 8081 but still the same. I checked my port 8080 or nay of these are not used by any other application.

3. when I try to run it as admin, I am getting the following error:

VS cannot start debugging because the target c:\...Host.exe is missing. Please build and retry.

I would really appreciate if you could help. I am going crazy trying to grasp wcf since past one week, but fail. Finally reading the comments and article here, got some HOPE!

# February 21, 2011 10:50 PM

Dennis van der Stelt said:

@Huzefa : Try the following article as well:

bloggingabout.net/.../wcf-simple-example-in-visual-studio-2010.aspx

I really, really need to create a webcast of this and show how easy it _should_ be. Of course there can be all sorts of problems due to things not working because of security settings, for example.

When you say, run as admin, do you mean run under the local administrator account (!) or that you select "Run as administrator" from the context menu, when you right-click on VS2010 icon?

And can you specify what ...host.exe is completely? Is it svchost.exe or something else?

# February 22, 2011 8:03 AM

Huzefa said:

Run as administrator as in from the context menu by right-click. By ...host.exe , I meant the path in my C:\ drive where the error message is pointing that the host.exe should be present.

# February 23, 2011 2:09 AM

Max said:

Nice work done, most of our customer ask for this, I will share this article in our knowledge base.

# March 3, 2011 8:16 AM

Eslam said:

hi,thanks for your illustration but i have an error which is ' Error 2 The type or namespace name 'localhost' could not be found (are you missing a using directive or an assembly reference?) E:\Documents and Settings\Eslam Farag\My Documents\Visual Studio 2008\Projects\WebSite\Client_Consume\Code.cs 23 15 Client_Consume

'

so,could you mind helping me,Thanks for your kind wishes.

# May 28, 2011 2:29 AM

Charlie D said:

Here is a great article to help you when you are starting a WCF project: msdn.microsoft.com/.../hh27311

# August 14, 2011 4:05 PM

Dennis van der Stelt said:

@Charlie D : Page not found?! :)

# August 15, 2011 8:14 AM

Shirish Bhavthankar said:

Thanks a lot. Nice.

# November 21, 2011 10:35 PM

Windows Apps said:

Thank you, this is a great article. I'm looking for an example of starting a WCF SOAP Project in VB.NET, can anyone recommend a website? Thank you.

# January 29, 2012 3:08 PM

Dennis van der Stelt said:

Should be exactly the same, except for syntactic stuff that differs from VB en C#. Like defining variables and such.

# January 30, 2012 11:08 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 7 and 6 and type the answer here: