views:

703

answers:

4

What is the difference between a web reference and a service reference?

+2  A: 

Web Reference

is a wrapper over wsdl.exe and can be used to create proxies for .NET 1.1 or 2.0 clients. Of course this means when you are pointing to a WCF service you have to be pointing to an endpoint that uses basicHttpBinding.

Service Reference

is a wrapper over svcutil.exe and also creates clients proxies. These proxies, however, can only be consumed by .NET 3.0+ clients.

Refer to : The Difference Between “Web Reference” and “Service Reference” for more detail

TStamper
+1  A: 

If you mean the feature from Microsoft of providing services. Web reference is an older way of providing service. See this link : http://blogs.msdn.com/lifenglu/archive/2007/06/20/add-an-old-8-0-style-web-reference-into-an-orcas-vs-9-project.aspx

Basically it does the same think, providing services over web, but WCF gives you alot more options for your application.

Khan
A: 

One references the settings.cs file [which isn't automatically refreshed from the app.config unless you open it and resave it - if you make edits to the app.config that is] and one references the app.config file. The configuration block in the app.config file is slightly different and the structure of the service is slightly different behind the scenes. Your code will interact with the objects slightly differently, but the end result is that they essentially do the same thing. Web References are 2.0 based and the service reference came about in .NET 3.0 or 3.5 [I'm not sure which].

You can still write code for web references, but if your application targets the 2.0 framework, you can't use service references.

BenAlabaster