My company is planning to implement a solution in multiple applications that will help to validate mailing addresses at the point of data entry. We're using UPS's Extended Address Validation (XAV) web service API to validate the addresses.
Our current plan is to build a .NET web service that can be used to communicate between our 开发者_如何学Pythonapplications and the UPS API. We have applications in VB6, classic ASP, and .NET 2.0, so we'd like to implement a solution that can be easily consumed by each of these programming environments.
What are our (Microsoft) options for designing a web service that can be consumed by multiple clients? In particular, is there a way to design a single web service that can respond with JSON (in case we want to validate our web page using javascript) in addition to XML?
I'm new to designing web services and want to make sure we consider all of our options. I've heard terms like asmx, WCF, OData, etc., but I don't know which frameworks will support what we're trying to do and where to start.
I'd recommend looking at implementing them as WCF services. You can specify multiple bindings for how to call the services, including HTTP, TCP, MSMQ, etc all of which can be achieved through configuration.
Generating the proxy class to use in .NET is really trivial (using svcutil.exe) and should give you some idea of what would be required to implement in another language. You should be able to use the .NET proxy class in VB6 or classic ASP (vbscript) using COM interop (I haven't tried with WCF, but it should work the same as any other interop scenario),the soap toolkit or the XMLHttpRequest object. Take a look at this introductory article on the subject.
To use WCF, you'll need at least .NET 3.0, but the flexibility over XML web services (asmx) is more than worth it.
You probably will want to build the service in WCF, and then expose it using appropriate 'bindings'. You may need more than 1 binding-config but that is where WCF starts to pay of.
Having said that, I'm not sure how to link up VB6. Does it have Webservice libs?
The best way to use a web service from VB6 is to create a .NET class that accesses the service, then expose that class as a COM object. VB6 can then use the COM object.
精彩评论