Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between web Reference and Service reference in Visual Studio?

The only difference I know from visual studio point of view,for adding WCF service you have to take service reference and for web service you have to take web reference.

Thanks

like image 419
BreakHead Avatar asked Jun 13 '11 09:06

BreakHead


People also ask

What is service reference in Visual Studio?

The WCF Web Service Reference tool is a Visual Studio connected service extension that lets you connect your . NET 5+, . NET Core, or ASP.NET Core project to a web service.

What is a web reference?

A Web reference enables a project to consume one or more XML Web services. Use the Add Web Reference Dialog Box to search for Web services locally, on a local area network, or on the Internet. After adding a Web reference to your current project, you can call any methods exposed by the Web service.

How do I add a Web service reference to a web application?

To add a Web Reference You can also open the Add Web Reference dialog box in the Solution Explorer pane by right-clicking References and selecting Add Web Reference. In the Web reference name box, rename the Web reference toExcelWebService. Click Add Reference to add a Web reference for the target Web service.


1 Answers

If cou click on the "Advanced..." button in the "Add Service Reference"-Dialog you get a short explanation at the bottom under "Compability":

Add a Web Reference instead of a Service Reference. This will generate code based on .NET Framewrok 2.0 Web Service technoligy.

Basicaly that means "Web Refrences" are .net 2.0 compatible, but as you already mentioned WCF needs Service reference, but you can also use Service Reference for e.g. basic SOAP-Services, but then you need .net >2 to link/run that assembly.

like image 72
Christoph Fink Avatar answered Sep 23 '22 04:09

Christoph Fink