Friday, November 28, 2003

Microsoft and Web Services

Microsoft and Web Services
Microsoft has been one of the leaders in driving the definition of SOAP web services. Microsoft's web service story is strong, and the future direction of Microsoft appears to depend on a SOAP web services backbone. So much so that they are calling it a programming paradigm switch from Object Oriented Architecture to Services Oriented Architecture (SOA). Here is a link to a slide from a recent Microsoft web presentation on this topic: http://stitch/IOSTEST/obj%20to%20serv.bmp.

.NET Web Services
The simplest way to write a web service is to write an asmx program. This example is a C# web service , which I've put out at the following link:
http://stitch/IOSTEST/ATest.txt. When you run the web service, at http://stitch/IOSTEST/ATest.asmx, it shows you a list of methods. You can click "Service Description" to get the WSDL describing this web service. If you want to deploy this locally, you will need IIS running and the .NET platform installed. The default style of a .NET web service is document.
In visual studio, you can also create a web service with a wizard, which walks you through creating a program similar to the one shown here.


Consuming Web Services in Visual Studio
In addition to a SOAP api for .NET, Visual Studio .NET has a built in web service proxy creation utility, allowing you to call a web service as if it was a local class. The proxy handles the SOAP communication and some naming conversion if needed. To use it, you create a "Web Reference" using a URL of the WSDL. Then you can work with the class as if it was local. This makes it pretty simple. Both rpc style and document style web service proxy classes can be created as a Web Reference.

Consuming Web Services in Office
The new version of Microsoft Office has some built in support for web services, specifically, the new application InfoPath. InfoPath is a forms painter that can use XML, ADO, or web services as a data source. For web services, you tell it the URL of the WSDL and it parses the schema to determine the element names which are mapped to fields. You can drag fields onto the form and change the field properties, like color, check box, background color, etc. Then you can add a button and map the button to "submit" to the web service. This sends a SOAP request to the web service and the response data is populated back to the form.


No comments: