Web Services – SOAP, WSDL, Disco and UDDI
In this tutorial you will learn about Web Services – Understanding Web Services, Simple Object Access Protocol (SOAP), The Web Service Discovery Tool (DISCO), Universal Description, Discovery and Integration (UDDI), Web Service Discovery Language (WSDL).
Web Services – SOAP, WSDL, Disco and UDDI
Understanding Web Services
Interconnectedness engendered by the World Wide Web has created a pressure to create applications that are interoperable and distributable over the network. The direction of effort is towards creating applications that connect to each other regardless of the language or platform in which the application was created.
Web services are externally exposed systems that allow applications to talk to each other and share information over a network. The web service standards are built upon other standards such as HTTP or XML and are not reliant upon any proprietary systems. The Web service is itself a collection of methods that can be called from a remote location so that these methods accept and return parameters and provide for a wide variety of functionalities that can be used internally in the application that is exposed to the public.
The concept behind web services is not new. The ad hoc methods of tying applications together have merely given place to organized methods of communications between applications. Standardized specifications have also lowered costs and shortened development timelines.
Prior to the emergence of Visual Studio.NET in the market a number of technologies attempted to cater to the needs of the Web based world. Let us briefly look at the various technologies that tried to address these issues.
SOAP
Simple Object Access Protocol (SOAP) is a protocol that uses the XML to describe the data and Hyper Text Transfer Protocol (HTTP) to transmit application data. The Web Service and the client application must agree upon a common protocol to facilitate communication. SOAP is a standard communication protocol for interchanging information in a structured format in a distributed environment. Messaging is an example of information exchange between a client and a web service. The calls made by a client application to a web method and the data returned by a web method to the client are the messages that are actually exchanged. A SOAP packet is created when a web client makes a call to the web method. This message contains the name of the web method and the parameters that are needed for making a call to the web method in XML format. The Web method is invoked based on the information available in the SOAP Packet
The System.Runtime.Serialization.Formatters.Soap namespace contains the System.Runtime.Serialization.Formatters.Soap.SoapFormatter class, which can be used to serialize and de-serialize objects in the SOAP format. When building applications that uses the types in this namespace, a reference must be made to the System.Runtime.Serialization.Formatters.Soap.dll assembly. The COM+ SOAP service permits the publishing of a component as a XML Web Service. Clients can continue to access the component using previous methods, but the component is also accessible using WSDL (Web Services Description Language) and SOAP. We will see more of SOAP usage later in the lesson.
Disco and UDDI
The Web Service Discovery Tool (DISCO) is used to discover the URLs of XML Web Services located on a Web server and saves documents related to each XML service on a local disk. The DISCO takes the URL and discovers and produce publishes discovery documents (.wsdl, .xsd, .disco and .dicomap files) as arguments. Some of the options available for use with this tool are:
/d[omain]:domain |
Specifies the domain name to use when connecting to a proxy server that requires authentication |
/nosave |
Does not save the discovered document or results |
/nologo |
Suppresses the Microsoft startup banner display |
/o[ut]:directoryName |
Specifies the output directory in which to save the discovered documents. Current directory is the default one. |
/p[assword]:password |
Specifies the password to use when connecting to a proxy server |
/proxy:url |
Specifies the URL of the proxy server to use for HTTP requests. |
The following command is an example of how the tool can be used to search a specified URL for the discovery of documents. The documents are then saved to the current directory. It will throw an error message if it cannot find discoverable documents at the URL specified.
disco http://www.vbdotnetlearning.com/selflearningservie.disco
To specify a directory to save the documents you can use the /out option as shown below:
disco /out:VBtutorial http://www.vbdotnetlearning.com
Universal Description, Discovery and Integration (UDDI) is a platform independent framework functioning like a directory that provides a mechanism to locate and register web services on the internet. The web service provider makes the web service available to the consumer by describing the web service using a WDSL document and then registering the Web service in the UDDI Directory. The UDDI Directory contains pointers to the Web service and the WDSL document for the Web service. After this is done the Client Applications can discover the Web service using the UDDI Directory. The UDDI specification calls for three elements as given below:
(1) White Pages — These provide business contact information
(2) Yellow Pages — These organize Web services into categories like usage billing service, authorization service and so on.
(3) Green Pages –These Pages provide detailed technical information about individual services.
WSDL
Web Service Discovery Language (WSDL) is a markup language that describes the web service. In order to use this Web service, the Client application developers need to know the methods exposed by the Web service and the parameters to be passed to these methods. It is imperative that access to these methodologies is available at development time and it is just this need that WSDL addresses. A typical WSDL document provides the following information to the developer:
v The Web service available for a given Web site
v The purpose for which these services can be used
v The types of parameters that need to be passed to a Web service
v The format used to access these Web services
v The URL at which a Web Service can be accessed