Web Service Protocols

Web Service - Web Services Protocols Web By Dr Atanu Rakshit Email [email protected] [email protected] [email protected] Enterprise

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Web Services Protocols Web By Dr. Atanu Rakshit Email: [email protected] [email protected] [email protected] Enterprise Application Integration Enterprise List of References ‘Enterprise Application Integration’ by David S. Enterprise Linthicum, Addison-Wesley, 1999 Linthicum, ‘Enterprise Application Integration’ by W. A. Ruh, Enterprise F. X. Maginnis, W. J. Brown, Wiley, 2000 F. URL: www.eai.ittoolbox.com URL: www.eai.ittoolbox.com www.eaijournal.com www.eaijournal.com EAI – Course Outline EAI EAI – An Overview Data Level EAI Application Interface Level EAI Method Level EAI User Interface Level EAI The EAI Process Methodology EAI and Middleware EAI – Course Outline EAI Transactional Middleware and EAI Messaging Oriented EAI Distributed Objects and EAI Database Oriented Middleware and EAI Java Middleware and EAI XML and EAI E – Business and EAI Process Automation and EAI Future Trends in EAI Web Services Protocols An Overview An Road Map Road Part I: Introduction to Web Services What is a Web Service? Impact / Architectural Overview Part II: Web Service Protocols XML-RPC and SOAP WSDL and UDDI Part I: Part Introduction to Introduction Web Services Web Introduction Introduction Today, the principal use of the World Wide Web is for Today, interactive access to documents and applications. In almost all cases, such access is by human users, typically working through web browsers… typically The Web can grow significantly in power and scope if The it is extended to support communication between applications, from one program to another. applications, -- From the W3C XML Protocol Working Group -Charter Charter What is a Web Service? Service? What is a Web Service? What A Web Service is any service that: Is available over the Internet or private (intranet) Is networks networks Uses a standardized XML messaging system Is not tied to any one operating system or Is programming language programming A Basic Web Service Basic XML XML Computer A: Language: Perl Operating System: Windows 2000 Computer B: Language: Java Operating System: Linux XML Messaging XML There are several There alternatives for XML messaging: messaging: XML Remote XML Procedure Calls (XML-RPC) (XML-RPC) SOAP Regular XML Regular transported over HTTP transported Any of these options Any are valid. are XML-RPC SOAP HTTP POST/GET XML Document Web Services Defined Web Although not required, a web service may also Although have two additional (and desirable) properties: have a web service should be self describing. web self a web service should be discoverable. web discoverable Web Services: Self Describing Self If you publish a new web service, you should also If publish a public interface to the service. publish At a minimum, you should include human-readable At documentation so that others can easily integrate your service. service. If you have created a SOAP service, you should also If include a public interface written in a common XML grammar. grammar. Web Services: Discoverable Discoverable If you create a web service, there should be a If relatively simple mechanism to publish this fact. fact. Likewise, interested parties should be able to Likewise, easily discover your service. easily The discovery service could be completely The decentralized or completely centralized. decentralized Web Services: Summary Web To summarize, a complete web service is any To service that: service Is available over the Internet or private (intranet) Is networks networks Uses a standardized XML messaging system Is not tied to any one operating system or Is programming language programming Is self-describing via a common XML grammar Is discoverable via a simple find mechanism What Are Web Services? What Web Service #1 Web Service #2 Web site Client (Web User) Local Web Service Web Service #3 Standard HTTP Using SOAP over HTTP Internet The Impact of Web Services Web Web Services in Action Web To understand the impact of web services, To consider basic e-commerce functionality. consider For example, Amazon sells books through its For web site. web Customers can purchase books and check on order Customers status. status. The Web Today: Human Centric The HTTP GET: “What is the status of my order?” Web Browser Web Server HTTP Response with HTML Page: “Leaving the warehouse at 3 pm today.” This illustrates a human-centric web, where humans are the primary actors This human-centric where initiating web requests. initiating It also represents the primary model on which most of the web operates It today. today. Web Services: Application-Centric Web Web With web services, we move from a humancentric web to an application-centric web. centric application-centric In other words, conversations between In applications occur as easily as conversations between web browsers and servers. between The Application-Centric Web The XML Request: “What is the status of my order?” Web Server Inventory Application On to human users XML Response: “Leaving the warehouse at 3 pm today.” On to other applications The order status is now a web service. Applications can therefore connect to the order status service Applications directly. directly. Application-Centric Web Application-Centric There are numerous areas where an There application-centric web would be extremely helpful: helpful: credit card verification package tracking shopping bots single sign-on registration calendar, email, etc. The Semantic Web The Tim Berners Lee, the original inventor of the WWW, Tim is now arguing for a Semantic Web. Semantic Berners Lee: The next stage is development of the Berners Web is the Semantic Web. Web The Semantic Web vision is also application centric. Berners Lee has also argued that web services are in Berners fact an actualization of the Semantic Web Vision. fact Haven’t we seen this before? Haven’t An application-centric web is not a new notion. For years, developers have created For CGI applications, Java Servlets and CORBA applications designed primarily for use by other applications. The crucial difference is that most of these systems The consisted of ad-hoc solutions. consisted With web services, we have the promise of some With standardization. standardization. Standardization will lower the barrier to application Standardization integration. integration. The Long-term Vision: Automated Web The In the long-term, web services offer the promise of In the automated Web. automated “Just-in-time” integration: If services are easily discoverable, self-describing, and If stick to common standards, it is possible to automate application integration. application For example, consider a company, Mega Electric For (ME) that wants to buy parts from Widgets,Inc. (ME) ME wants to automatically integrate inventory with ME Widgets, Inc. order status service. Widgets, Just-In-Time Integration Just-In-Time 1 Discover Services Service Registry Retrieve Service 2 Description ME “Smart” Inventory Application Widgets Inc. Server Service Description 3 Invoke Remote Service Order Status Service Hype Vs Reality Hype How close are we to creating “Just-in-time” How integration? integration? Currently, only some processes can be automated: automatic registry query automatic invocation of service However, no mechanism exists for automating business no relationships. relationships. no mechanism exists for evaluating the quality of no services. services. Industry Landscape Industry Many companies are investing heavily in web services. Currently many competing frameworks for building web Currently services. services. Three main contenders: Microsoft .NET IBM Web Services Sun Open Net Environment (ONE), Java All frameworks share a commitment to the same web services All standards. standards. Standardization Standardization The World Wide Web Consortium is heavily involved in The standardizing web services. standardizing SOAP is the first specification to be standardized. http://www.w3c.org/2002/ws/ Web Services Interoperability Organization (WSI) Industry organization Designed to speed up the standardization/compliance process. http://www.ws-i.org/ Web Services Architecture Architecture Web Service Architecture Web There are two ways to view the web service There architectural framework: architectural 1) 2) Examine individual roles of each web service Examine actor actor Examine the emerging web service protocol Examine stack. stack. Web Service Roles Web Three major roles in web services: Service Provider: provider of the web service. Service Requestor: any consumer of the web Service service. service. Service Registry: logically centralized directory of Service services. services. Web Service Roles Web Discover 1 Services Service Requestor Service Registry 2 Invoke Service Service Provider Web Service Protocol Stack Web Service transport: responsible for transporting messages. Examples: HTTP, BEEP (Blocks Examples: Extensible Exchange Protocol) Extensible XML messaging: responsible for encoding messages in common XML format. format. Examples: XML-RPC, SOAP Service Description: responsible for describing an interface to a specific web service. web Example: WSDL Service Discovery: responsible for centralizing services into a common search registry. search Web Service Protocol Stack Web Discovery UDDI Description WSDL XML Messaging XML-RPC, SOAP, Custom XML Transport HTTP, SMTP, FTP, BEEP Part II: Part Web Service Web Protocols Protocols XML Messaging Messaging Option 1: XML-RPC Option XML-RPC: protocol that uses XML messages to XML-RPC: perform Remote Procedure Calls (RPC.) perform Platform independent; diverse applications can talk Platform to each other. to XML-RPC is the easiest way to get started with web XML-RPC services. services. Simpler than SOAP Simpler data structures for transmitting data. XML-RPC Example XML-RPC Here is a sample XML-RPC request to a Here weather service: weather <?xml version="1.0" encoding="ISO-8859-1"?> <methodCall> <methodName>weather.getWeather</methodName> <params> <param><value>10016</value></param> </params> </methodCall> “Give me the current weather conditions in zip code: 10016.” XML-RPC Example XML-RPC Here is a sample Weather response: <?xml version="1.0" encoding="ISO-8859-1"?> <methodResponse> <params> <param> <value><int>65</int></value> </param> </params> </methodResponse> “Current temperature is 65 degrees” Option 2: SOAP Option SOAP: used to stand for “Simple Object SOAP: Access Protocol” Access XML-Based protocol for exchanging XML-Based information between computers. information Currently a formal recommendation of the Currently World Wide Web Consortium (W3C.) World SOAP Message Format SOAP SOAP Message Envelope (Required) Header (Optional) Body (Required) Fault (Optional: Response only) SOAP 1.1 Example SOAP Here is a sample SOAP request to a weather Here service: service: <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <ns1:getWeather xmlns:ns1="urn:examples:weatherservice" SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-encoding/"> <zipcode xsi:type="xsd:string">10016</zipcode> </ns1:getWeather> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAP 1.1 Example: SOAP Here is a sample SOAP response: <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <ns1:getWeatherResponse xmlns:ns1="urn:examples:weatherservice" SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-encoding/"> <return xsi:type="xsd:int">65</return> </ns1:getWeatherResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> WSDL & UDDI WSDL WSDL WSDL WSDL: Web Service Description Language. WSDL is an XML grammar for specifying an WSDL interface for a web service. interface Specifies Specifies location of web service methods that are available by the web service data type information for all XML messages WSDL is commonly used to describe SOAP services. WSDL In a Nutshell WSDL <definitions>: Root WSDL Element <types>: What data types will be transmitted? <message>: What messages will be transmitted? <portType>: What operations (functions) will be supported? <binding>: What SOAP specific details are there? <service>: Where is the service located? WSDL Excerpt: Weather Service WSDL <message name="getWeatherRequest"> <part name="zipcode" type="xsd:string"/> </message> <message name="getWeatherResponse"> <part name="temperature" type="xsd:int"/> </message> <portType name="Weather_PortType"> <operation name="getWeather"> <input message="tns:getWeatherRequest"/> <output message="tns:getWeatherResponse"/> </operation> </portType> WSDL Excerpt: Weather Service WSDL … <service name="Weather_Service"> <documentation>WSDL File for Weather Service</documentation> <port binding="tns:Weather_Binding" name="Weather_Port"> <soap:address location="http://ecerami.com/soap/servlet/rpcrouter"/> </port> </service> </definitions> So What? So Given a WSDL file, a developer can Given immediately figure out how to connect to the web service. web Eases overall integration process. Better yet, with WSDL tools, you can Better automate the integration… automate WSDL Invocation Tools WSDL For example, IBM has a tool called Web For Services Invocation Framework (WSIF). Services Given a WSDL file, the tool will automatically Given automatically invoke the service. invoke A number of other tools from Microsoft, number GLUE, and open source projects also do this. GLUE, WSIF: Example WSIF: Invoke WSIF with the Weather WSDL File; specify method name and zip Invoke code parameter: code java clients.DynamicInvoker java http://localhost:8080/wsdl/WeatherService.wsdl getWeather 10016 getWeather generates the following output: Reading WSDL document from Reading 'http://localhost:8080/wsdl/WeatherService.wsdl' 'http://localhost:8080/wsdl/WeatherService.wsdl' Preparing WSIF dynamic invocation Executing operation getWeather Result: temperature=65 Done! UDDI UDDI UDDI: Universal Description, Discovery and UDDI: Integration. Integration. Currently represents the discovery layer in the Currently discovery protocol stack. protocol Originally created by Microsoft, IBM and Originally Ariba. Ariba. Technical specification for publishing and Technical finding businesses and web services. finding UDDI: Two Parts UDDI: Part I: Technical specification specification for building a distributed directory of businesses and specification services. services. XML format for specifying businesses and services. API for querying/publishing to the registry. Part II: Implementation UDDI Business Registry, fully operational implementation of the UDDI specification. specification. Businesses can publish services here. Businesses can discover services here. Currently maintained by IBM, Microsoft, etc. What is UDDI? Universal Description Discovery and Integration Industry-wide initiative supporting web services Specifications Schemas for service description Schemas for business (service implementers) Schemas description description Developed on industry standards (XML, HTTP, Developed TCP/IP, SOAP) TCP/IP, Applies equally to XML and non-XML web services Implementation Public web service registry and development Public resources resources What Problems Do We Solve? Broader B2B Smarter Search Easier Easier Aggregation Aggregation Web Service Visibility An organization needs to An create 400 electronic relationships with partners, each with its own standards and protocols protocols Describe Describe Services Services A small business wants to small be “plugged in” to every marketplace in the world, but doesn’t know how but Discover Discover Services Services A B2B marketplace cannot B2B get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc. insurers, Provide a standards-based Provide profile for all electronic services that are provided. Includes web sites, other electronic resources electronic Integrate Them Together Publish for Publish Accessibility Accessibility UDDI Registry Entries UDDI Standards Bodies, Standards Agencies, Programmers, Publishers register specifications for their Service Types Service Service providers register Service precise information about themselves and their Web services services Business name General business description Contact info Any number of languages Names, phone numbers, fax numbers, web sites, etc. Known identifiers List of unique identifiers for a business D-U-N-S, Thomas, domain name, stock ticker symbol, other Business categories 3 base taxonomies in V1 Industry: NAICS (Industry codes - US Govt.) Product/Services: UNSPSC (ECCMA) Location: Geographical taxonomy (ISO 3166) …easy extension in upcoming releases New set of information businesses use to describe how to “do e-commerce” with them Nested model Business process (functional) Service specifications (technical) Binding information (implementation) Programming/platform/ implementation agnostic Services can also be categorized How UDDI Works How Software companies, standards Software bodies, and developers populate the registry with descriptions (specifications) of types of services (specifications) 1. 4. 2. Marketplaces, search Marketplaces, engines, and business applications query the registry to discover services at other companies and to facilitate integration integration UDDI Registry Implementers Implementers populate the registry with registry descriptions of descriptions their businesses and the services they expose they Implementations 3. Service Types 5. UDDI Registry assigns a programmatically unique identifier to each service and registration Large businesses apply Large the same architecture and technologies internally internally Public Registry Operation Public Peer registry nodes (websites) Information registered with any node Registrations replicated on a daily basis Complete set of IBM “registered” records available at all nodes Common set of SOAP APIs supported other by all nodes Compliance enforced by business contract other All technologies applied Interoperability verified constantly Developers Applications Marketplaces queries UDDI.org Microsoft End Users HP (planned) UDDI Roadmap UDDI V1 V2 V3 “Registration” “Integration” “Aggregation” September 2000 March 2001 December 2001 Ongoing Industry Standards Body All Together Now! Now! Using the Protocols Together Using Step 1: Find Services via UDDI Retrieve Service Description File: WSDL or XML-RPC Instructions Step 2: Step 3: Create XML-RPC or SOAP Client Step 4: Invoke Remote Service Q&A Q&A Thank You ...
View Full Document

This note was uploaded on 07/15/2011 for the course ECO 2023 taught by Professor Mr.raza during the Summer '10 term at FAU.

Ask a homework question - tutors are online