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.
Friday, November 28, 2003
Friday, November 21, 2003
Web Services
Web Services
Although Web Services can be widely defined as HTTP and XML, a more common modern definition is XML/SOAP/WSDL. They are typically used for computer to computer application invocation when the same technology is not guaranteed. SOAP can be viewed as an XML wrapper used to define the namespace, schema and "method" name of the payload. SOAP is a standard XML namespace governed by W3C. It is human readable, simple and language/technology agnostic. Apache Tomcat w/ Axis and IIS w/ .NET are 2 free servers that can both accept SOAP requests and return SOAP responses.
The other part of web services is WSDL: Web Service Description Language. This is a standard 4 part XML document that defines the message (schema), port, binding and service. The servers mentioned above generate WSDL documents for each web services. There are also utility programs that will generate classes or interfaces from a WSDL, like wsdltojava and xsd.exe.
Document vs. RPC Style
These are the two primary types of web services. RPC or Remote Procedure Call style is similar to extending a method to remote consumers. By default Axis returns RPC style web services. Document style is more free form, using the XML document schema to define the message. The style is defined in the operation section of the WSDL document.
Web Service Consumers
Both Java and .NET languages, like C#, can easily consume SOAP web services. I'll talk more about this next week.
References
http://www-106.ibm.com/developerworks/webservices/library/ws-docstyle.html
http://radio.weblogs.com/0101679/stories/2002/03/16/aGentleIntroductionToSoap.html
http://www.w3.org/TR/SOAP/
XMethods List of Web Services
http://www.xmethods.org/ve2/Directory.po;jsessionid=RuOWqay9nCAzSNSMmolYh-o6(QhxieSRM)
Although Web Services can be widely defined as HTTP and XML, a more common modern definition is XML/SOAP/WSDL. They are typically used for computer to computer application invocation when the same technology is not guaranteed. SOAP can be viewed as an XML wrapper used to define the namespace, schema and "method" name of the payload. SOAP is a standard XML namespace governed by W3C. It is human readable, simple and language/technology agnostic. Apache Tomcat w/ Axis and IIS w/ .NET are 2 free servers that can both accept SOAP requests and return SOAP responses.
The other part of web services is WSDL: Web Service Description Language. This is a standard 4 part XML document that defines the message (schema), port, binding and service. The servers mentioned above generate WSDL documents for each web services. There are also utility programs that will generate classes or interfaces from a WSDL, like wsdltojava and xsd.exe.
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<m:getStateName xmlns:m="http://www.soapware.org/">
<statenum>41</statenum>
</m:getStateName>
</SOAP:Body>
</SOAP:Envelope>
Document vs. RPC Style
These are the two primary types of web services. RPC or Remote Procedure Call style is similar to extending a method to remote consumers. By default Axis returns RPC style web services. Document style is more free form, using the XML document schema to define the message. The style is defined in the operation section of the WSDL document.
Web Service Consumers
Both Java and .NET languages, like C#, can easily consume SOAP web services. I'll talk more about this next week.
References
http://www-106.ibm.com/developerworks/webservices/library/ws-docstyle.html
http://radio.weblogs.com/0101679/stories/2002/03/16/aGentleIntroductionToSoap.html
http://www.w3.org/TR/SOAP/
XMethods List of Web Services
http://www.xmethods.org/ve2/Directory.po;jsessionid=RuOWqay9nCAzSNSMmolYh-o6(QhxieSRM)
Subscribe to:
Posts (Atom)