Web Reference VS. Service Reference

Web Reference vs. Service Reference

Add Web Reference is the old-style, deprecated ASP.NET webservices (ASMX) technology (using only the XmlSerializer for your stuff) - if you do this, you get an ASMX client for an ASMX web service. You can do this in just about any project (Web App, Web Site, Console App, Winforms - you name it).

Add Service Reference is the new way of doing it, adding a WCF service reference, which gives you a much more advanced, much more flexible service model than just plain old ASMX stuff.

Since you're not ready to move to WCF, you can also still add the old-style web reference, if you really must: when you do a "Add Service Reference", on the dialog that comes up, click on the [Advanced] button in the button left corner:

alt text

and on the next dialog that comes up, pick the [Add Web Reference] button at the bottom.

Web Reference used on Visual Studio 2012 instead of Service Reference

I already find the solution.

The problem is Newtonsoft.Json dll on visual studio 2012.

What i did is remove first Newtonsoft.Json dll on reference before adding service reference on my project then add Newtonsoft.Json dll again.

After that you can add service reference that you want on your project.

Visual Studio/SOAP - 'Add Service Reference' vs 'Add Web Service Reference'

The preferred and most useful way is indeed to use Add Service Reference. This will add your service as WCF client side proxy.

Add Web Reference is the "old-style" ASMX/ASP.NET webservice way of doing things.

WCF is the much better choice than ASMX, because:

  • it's newer and will be supported in the future (ASMX is on the way out); if you learn it now, you won't have to learn it later when ASMX is definitely gone
  • it offers much more flexibility in every aspect
  • you can only ever host an ASMX service is IIS, using HTTP as your protocol; WCF can be hosted in IIS; self-hosted in a Windows NT Service; WCF can use HTTP, NetTCP, MSMQ and many more protocols
  • WCF offers a lot more security and other settings, making it much more powerful to use

Yes, WCF has a bad rap about being really hard to learn - I don't really find that to be true. Check out those beginner's resources - very useful indeed!

  • MSDN WCF Developer Center which has everything from beginner's tutorials to articles and sample code
  • Endpoint.TV screen cast series by Aaron Skonnard on WCF (at Channel9) - it's an excellent series going from "Creating your first WCF service" and "Creating your first WCF client" all the way to rather advanced topics. Aaron Skonnard very nicely explains everything in 10-15 minutes screencasts - highly recommended!
  • DotNet Rocks TV Show #122: Miguel Castro on Extreme WCF
  • DotNet Rocks TV Show #135: Keith Elder Demystifies WCF


Related Topics



Leave a reply



Submit