I'm working on a VB6 app that will do some very simple communication with a web server (passing value and getting back an anwer. Low bandwith and infrequent use).
Someone suggested using WCF or Web Services. I'm wondering what the advantages are vs. just posting to an ASPX p开发者_运维百科age like:
Myserver.com/Functions.ASP?FunctionName=GetValue?UserName=BubbGump and returning some simple, easy to parse text, like one value per line.
Introduction to WCF in ASP.NET and VB.NET has this tidbit about it:
WCF (or Windows Communication Foundation) is a union of technologies developed by Microsoft to make it easier and quicker for developers to build distributed applications. WCF builds on the existing technologies of ASMX, .NET Remoting, MSMQ and DCOM. WCF attempts to unify these technologies and harness the power of all, while simplifying the process of implementation.
Introduction to Windows Communication Foundation from ASP Alliance notes the following:
Windows Communication Foundation (WCF), codenamed Indigo in Microsoft, is the last generation of service oriented technologies for development. It provides all the latest means to help developers build service oriented applications. The result of service oriented design is a distributed system which runs between services and clients. Windows Communication Foundation is Microsoft infrastructure for Service Oriented architecture.
You have probably worked with Web Services in .NET 1.x or 2.0 and may have some experiences with Remoting. Windows Communication Foundation is an enhanced technology to provide the same functionality with better features and reduces the time to develop a distributed system. Web Services and Services are not identical. One main difference is Web Services use HTTP protocol, but Services can use any protocol and this is an important difference.
Lastly, if you do use URLs, then
Myserver.com/Functions.ASP?FunctionName=GetValue?UserName=BubbGump
should be
Myserver.com/Functions.ASP?FunctionName=GetValue&UserName=BubbGump
as the ? is notes the end of the URL while the & is the delimiter on the querystring key/value pairs. Another point is that WCF doesn't require requests to go through IIS which may be of interest in some ways as there can be issues there. Classic ASP can have numerous problems especially if there are those "On Error Resume Next" lines that make the requests go into a zombie mode of just running until the machine crashes completely.
WCF / WebServices is the 'proper' way to do it... You get all the communication infrastructure, stability, fault catching, etc. but there's nothing wrong with the ASP approach that you're suggesting.
When you've implemented your ASP solution and start to see points where you want that something more, then you'll know it's time to move to WCF.
It'll be a more natural progression that way, and the transition may be easier.
精彩评论