Avatar of Thomasian
Thomasian
Flag for Philippines asked on

WCF Question

I am new to WCF so I read around the internet. I found (at least) 3 ways to make a WCF service, but I don't know the difference.


Using Channel Factory:
http://weblogs.asp.net/ralfw/archive/2007/04/14/a-truely-simple-example-to-get-started-with-wcf.aspx

Using Service Reference:
http://bloggingabout.net/blogs/dennis/archive/2007/04/20/wcf-simple-example.aspx

Using svcutil to generate proxy for client:
http://www.codeproject.com/KB/WCF/WCFWPFChat.aspx


What are the advantages/disadvantages of using each method?

TIA
WCFVisual Basic.NETC#

Avatar of undefined
Last Comment
Thomasian

8/22/2022 - Mon
Roshan Davis

Roshan Davis

ajitha75

I hope you are referring to consuming a Web Service.

1 SvcUtil and ServiceReference are same, in that ServiceReference internally uses SvcUtil to generatre proxy. But it gives a nice UI to do that, in case you are not comfortable with SvcUtil command line

2. SvcUtil is useful in automated build scenarios
3. you cannot use XmlSerializer with Service Reference, hence you have to use Svcutil in that case

4. ChannelFactory is not usable for non-wcf services
5. using ChannelFactory means you need to have binary level reference to the Service Contract
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Thomasian

ASKER
roshmon,

Still reading the links you provided. But the articles doesn't seem to answer by questions.


ajitha75,

For starters, I will be working on TCP (and probably named pipes).

> SvcUtil and ServiceReference are same
SvcUtil.exe creates 2 files (proxy and app.config). Does that mean that I will need to manually regenerate the files every time there are changes to the service?

>. using ChannelFactory means you need to have binary level reference to the Service Contract
Does that mean that it is best to use the ChannelFactory if I have binary reference to the Service Contract?
ASKER CERTIFIED SOLUTION
ajitha75

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Thomasian

ASKER