DISCO UDDI Sandeep Gadde CONTENTS Web Services What
DISCO UDDI -Sandeep Gadde
CONTENTS: Web Services What is DISCO? Disco Client Utilities Disco Redirects Dynamic Discovery UDDI as a better DISCO UDDI Repository UDDI Binding Information UDDI Programmer’s API UDDI - Lite
WEB SERVICES Web services are automated information services that are conducted over the Internet, using standardized technologies and formats/protocols that simplify the exchange and integration of large amounts of data over the Internet. Web services platform elements are SOAP, UDDI, WSDL. Web services use XML to code and decode data, SOAP to transport data.
CONT. . Web Services basically uses HTTP and SOAP to make business data available on the web and executes remote function calls.
SAMPLE WEBSERVICE namespace Web. Service 1 { [Web. Service(Namespace = "http: //tempuri. org/")] public class Service 1 : System. Web. Services. Web. Service { [Web. Method] public string Hello. World() { return "Hello World"; } [Web. Method] public int add(int a, int b) { return a+b; } } }
DISCO Web Services discovery is the process of locating and interrogating web service descriptions, which is a preliminary step for accessing a web service. Discovery file is an XML document with a. disco extension and holds the Web Services information.
SAMPLE DISCO FILE Service 1. disco <disco: discovery xmlns: disco="http: //schemas. xmlsoap. org/disco/" xmlns: scl="http: //schemas. xmlsoap. org/disco/scl/"> <!-- reference to other DISCO document --> <disco: discovery. Ref ref="related-services/default. disco"/> <!-- reference to WSDL and documentation --> <scl: contract. Ref ref=“Service 1. asmx? wsdl“ doc. Ref=“Service 1. asmx"/> </disco: discovery> My. Service (root dir) Service 1. asmx web. config Service 1. disco bin simple. Math. dll complex. Math. dll
DISCO CLIENT UTILITIES There are 2 types of client utilities to discover a Web. Service. - disco. exe tool - Add web ref feature in visual studio. net disco. exe tool is a command line utility provided by microsoft sdk and it is used as follows. c: >disco. exe http: //localhost: 85635/My. Service/service 1. disco
CONT. . An output file with name results. discomap is created that contains information about web services discovered at specified URL. It also downloads all the. disco and. wsdl documents that were discovered. Wsdl. exe is the utility to generated web service proxies from WSDL documents or the. discomap files generated by disco. exe.
CONT. . results. discomap <? xml version="1. 0" encoding="utf-8"? > <Discovery. Client. Results. File xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" xmlns: xsd="http: //www. w 3. org/2001/XMLSchema"> <Results> <Discovery. Client. Result reference. Type= "System. Web. Services. Discovery. Contract. Reference" url="http: //localhost/My. Service/Service 1. asmx? wsdl" filename=“Service 1. wsdl"/> <Discovery. Client. Result reference. Type= "System. Web. Services. Discovery. Document. Reference" url="http: //localhost/My. Service/related-services/default. disco" filename="default. disco" /> </Results> </Discovery. Client. Results. File>
CONT. . Add web reference feature in visual studio. net
CONT. .
CONT. .
DISCO REDIRECTS Disco Redirects help to redirect to disco file, if the user doesn’t know the exact address of the disco file. Disco provide hints in the default page of root directory If the root's default page is an HTML document, you can use the LINK tag to redirect the client to the. disco file: <HTML> <HEAD> <link type='text/xml' rel='alternate' href=‘Sample 1. disco'/> </HEAD> • • • </HTML>
CONT. . If the root's default page is an XML document, you can use the xml-stylesheet processing instruction to accomplish the same thing: <? xml-stylesheet type="text/xml" alternate="yes" href=“Service 1. disco"? >
DYNAMIC DISCOVERY Dynamic discovery is discovering web services dynamically To enable dynamic discovery, a. vsdisco file like the one shown here must be placed in the desired root. <dynamic. Discovery xmlns="urn: schemas-dynamicdiscovery: disco. 2000 -03 -17“ /> Requests for. vsdisco files are handled by namespace, which dynamically generates a DISCO document based on the resources found in the target root directory. System. Web. Services. Discovery. Request. Handler
UDDI Universal Description, Discovery and Integration (UDDI) is a specification for building distributed databases that enable interested parties to “discover” each other’s Web services. Provides easy discovery, sharing, and reuse of Web services and other programmable resources.
UDDI AS A BETTER DISCO UDDI goes beyond DISCO by defining how to interact with a full-fledged Web Service information repository. UDDI specification consists of a programmer’s API along with an XML schema definition of supporting data structures and messages.
UDDI REPOSITORY UDDI repositories contain information about businesses, services, and service bindings as well as additional metadata for categorization purposes. UDDI uses white pages, yellow pages, and green pages to organize information
CONT. . White pages include business name, contact info. Yellow pages include categories based on standard taxonomies. Green pages include the technical specifications and references.
UDDI BINDING INFORMATION UDDI registry contains 4 main types of information: Business, Services, Binding Templates and t. Models. Business-Name, Contact Info, Technical Info of the service. Service-Technical/Business descriptions & categorizations. Each service also exposes binding template info that describes how to connect to and communicate with the given service.
UDDI PROGRAMMER’S API UDDI Programmer’s API is divided as Inquiry API and Publishing API. Inquiry API: Provides operations for retrieving information from the registry. Publishing API: Provides operations for publishing information to the registry.
INQUIRY API Name Description Find_business This locates information about one or more businesses. Find_service This locates services within a registered business. Entity. Find_binding This locates bindings within a registered business. Service. Get_business. Detail This gets business. Entity information for one or more businesses. Get_business Detail. Ext This gets extended business. Entity information. Get_service. Detail This gets full details for a set of registered business. Services. Get_binding. Detail This gets binding. Template information for making service requests. Get_t. Model. Detail This gets details for a set of registered t. Models.
<FIND_BUSINESS> EXAMPLE The following code illustrates how to perform a business lookup by the company's name. <? xml version='1. 0' encoding='utf-8'? > <s: Envelope xmlns: s='http: //schemas. xmlsoap. org/soap/envelope/'> <s: Body> <find_business generic="1. 0" xmlns="urn: uddi-org: api"> <name>XXX</name> </find_business> </s: Body> </s: Envelope>
CONT. . The result of the find_business operation is the info about its services <s: Envelope xmlns: s='http: //schemas. xmlsoap. org/soap/envelope/'> <s: Body> <business. List generic="1. 0" truncated="false" operator=“XXX" xmlns="urn: uddi-org: api"> <business. Infos> <business. Info business. Key="0076 B 468 -EB 27 -42 E 5 -AC 09 -9955 CFF 462 A 3"> <name>XXX</name> <description xml: lang="en">Empowering people through great software. . . </description> <service. Infos> <service. Info business. Key="0076 B 468 -EB 27 -42 E 5 -AC 09 -9955 CFF 462 A 3" service. Key="D 2 BC 296 A-723 B-4 C 45 -9 ED 4 -494 F 9 E 53 F 1 D 1"> <name>UDDI Web Services</name> </service. Infos> </business. Info> ………… </business. Infos> </business. List> </s: Body> </s: Envelope>.
PUBLISHING API Name Description get_auth. Token Requests an authentication token from an operator site. get_registered. Info Requests information currently managed by the user. save_business Registers/updates a business. Entity. save_service Registers/updates a business. Service. save_binding Registers/updates a binding. Template. save_t. Model Registers/updates a t. Model. delete_business Deletes a business. Entity from the registry. delete_service Deletes a business. Service from the registry. delete_binding Deletes a binding. Template from the registry. delete_t. Model Deletes a t. Model from the registry. discard_auth. Token Discards an existing authentication token.
<SAVE_BUSINESS> EXAMPLE <? xml version='1. 0' encoding='utf-8'? > <s: Envelope xmlns: s= 'http: //schemas. xmlsoap. org/soap/envelope/'> <s: Body> <save_business generic="1. 0" xmlns="urn: uddi-org: api"> <!-- retrieved from get_auth. Token API --> <authinfo>fd 3 c 7 a 44 -118 f-413 a-a 2 e 3 -473 a 35379993 </authinfo> <business. Entity business. Key="ee 3 be 846 -d 828 -4 a 38 -a 5 e 4 -3 c 33 f 931 d 122"> <name>Developmentor</name> <description>Services the developer by. . . </description> <business. Services> <!-- service descriptions go here --> </business. Services> </business. Entity> </save_business> </s: Body> </s: Envelope>
UDDI-LITE Microsoft has come up with UDDI-Lite recently, a compromise between DISCO and UDDI. The idea behind this sample was to provide a centralized web service repository that would be easy to maintain, and would integrate with all of the existing. NET DISCObased tools.
CONT. . To implement UDDI-Lite -Web Services are stored in SQL Server DB. -ASP. NET front end to register and unregister Web Services. When client requests. vsdisco file, it automatically generates information stored in SQL Server by mapping requests using System. Web. UI. Page. Handler. Factory class.
CONT. .
SAMPLE CODE TO IMPLEMENT UDDILITE <%@ page language="C#" contenttype="text/xml" enablesessionstate="false" %> <%@ import namespace="System. Data. Sql. Client" %> <% Response. Content. Type = "text/xml"; %> <disco: discovery xmlns: disco="http: //schemas. xmlsoap. org/disco/" xmlns: scl="http: //schemas. xmlsoap. org/disco/scl/"> <% Sql. Connection conn = new Sql. Connection("data source=localhost; initial catalog=uddilite; user id=sa; pwd="); conn. Open(); try { Sql. Command cmd = new Sql. Command("select contract, documentation from contracts"); cmd. Connection = conn; IData. Reader reader = null; reader = cmd. Execute. Reader(); while (reader. Read()) { %> <scl: contract. Ref ref="<%= reader[0]. To. String() %> " doc. Ref="<%= reader[1]. To. String() %>" /> <% } } finally { conn. Close(); } %> </disco: discovery>
CONCLUSION DISCO is ultimately limited by the type and depth of the information that it provides. Microsoft has been heavily involved in the development of UDDI, which is receiving a lot of attention. The bottom line is that DISCO works today and it can help us to get more out of. NET Web Services with little effort. For the future, look for UDDI developments.
REFERENCES http: //msdn. microsoft. com/en-us/magazine/cc 302073. aspx http: //www. cs. odu. edu/~mukka/cs 795 sum 10. net/Lecturenotes/d ay 4/wsuddi. ppt http: //uddi. xml. org/uddi-org
THANK YOU
- Slides: 34