Zainab Aljazzaf Supervisor Dr Hanan Lutfiyya University of
Zainab Aljazzaf Supervisor: Dr. Hanan Lutfiyya University of Western Ontario, Computer science department, Jan 2009
Contents: • Definition • Technologies - SOAP - WSDL - UDDI • Implementation • References University of Western Ontario, Computer science department, Jan 2009
What is WS? • • • Definition. Technologies. Implementation. • A new breed of Web application. • They are self-contained, self describing, modular applications that can be published, located, and invoked across the Web. • They perform functions, which can be anything from simple requests to complicated business processes. • Once a Web service is deployed, other applications can discover and invoke it. University of Western Ontario, Computer science department, Jan 2009
Why WS: • • • Definition. Technologies. Implementation. • A way to expose system functionality and make it available through standard web technologies: - Reduce heterogeneity. - Key to facilitating application integration. - Enable new computing paradigm: Service Oriented Computing. - Reduce application development costs. University of Western Ontario, Computer science department, Jan 2009
WS camps? • • • Definition. Technologies. Implementation. • Web services fall in two categories: 1 - Big Web Services (WS-*). 2 - RESTful Web Services. University of Western Ontario, Computer science department, Jan 2009
Service oriented Architecture (SOA) • • • Definition. Technologies. Implementation. • The Programming paradigm continues to change: Procedural Object Oriented Service Oriented • SOA is a paradigm for organizing and utilizing distributed capabilities that may be under the control of different ownership domains. It provides a uniform means to offer, discover, interact with and use capabilities to produce desired effects consistent with measurable preconditions and expectations. OASIS • SOA is a collection of services that communicate with each other. • SOA provides methods for systems development and integration where systems group functionality around business processes and package these as interoperable services. • Aims at a loose coupling of services with operating systems, programming languages and other technologies. University of Western Ontario, Computer science department, Jan 2009
Service oriented Architecture (SOA) • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
SOA Protocols: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
WS protocols: • • • Definition. Technologies. Implementation. • SOAP (Simple Object Access Protocol) • WSDL (Web Services Description Language) • UDDI (Universal Description, Discovery and Integration) University of Western Ontario, Computer science department, Jan 2009
WS extend web protocols: • • • Definition. Technologies. Implementation. • WS extend WWW protocols for supporting services instead of simple document access: - SOAP extends HTTP: allow service requests. - WSDL extends HTML: allow to describe services. - UDDI extends URI: allow to locate services. University of Western Ontario, Computer science department, Jan 2009
• • • W 3 C: Definition. Technologies. Implementation. If Developers DO have sense: Future applications will exchange their data in XML. We can only pray that all the software vendors will agree SOAP, WSDL, UDDI XML-based documents University of Western Ontario, Computer science department, Jan 2009
XML : • • • Definition. Technologies. Implementation. <? xml version="1. 0" encoding="ISO-8859 -1"? > <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> University of Western Ontario, Computer science department, Jan 2009
SOAP: • • • Definition. Technologies. Implementation. • A lightweight protocol for exchanging structured information in a decentralized, distributed environment. • A communication protocol between applications. • A format for sending messages. • XML-based protocol to let applications exchange information over HTTP. • A platform and language independent • Allows to get around firewalls • A W 3 C recommendation(24. June 2003). University of Western Ontario, Computer science department, Jan 2009
Skeleton SOAP Message • • • Definition. Technologies. Implementation. <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Header>. . . </soap: Header> <soap: Body>. . . <soap: Fault>. . . </soap: Fault> </soap: Body> </soap: Envelope> University of Western Ontario, Computer science department, Jan 2009
• • • SOAP Request: Definition. Technologies. Implementation. <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Header> <m: Trans xmlns: m="http: //www. w 3 schools. com/transaction/" soap: must. Understand="1" soap: actor="http: //www. w 3 schools. com/appml/ </m: Trans> </soap: Header> <soap: Body> <m: Get. Price xmlns: m="http: //www. w 3 schools. com/prices"> <m: Item>Apples</m: Item> </m: Get. Price> </soap: Body> </soap: Envelope> University of Western Ontario, Computer science department, Jan 2009
SOAP Response: • • • Definition. Technologies. Implementation. <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Body> <m: Get. Price. Response xmlns: m="http: //www. w 3 schools. com/prices"> <m: Price>1. 90</m: Price> </m: Get. Price. Response> </soap: Body> </soap: Envelope> University of Western Ontario, Computer science department, Jan 2009
WS example: Temp. Converter • • Definition. Technologies. Implementation. The following is a sample SOAP 1. 1 request and response. POST /In. Stock HTTP/1. 1 Host: www. example. org Content-Type: application/soap+xml; charset=utf -8 Content-Length: length <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soapenvelope" soap: encoding. Style="http: //www. w 3. org/2001/12 /soap-encoding"> <soap: Body xmlns: m="http: //www. example. org/stock"> <m: Get. Stock. Price> <m: Stock. Name>IBM</m: Stock. Name> </m: Get. Stock. Price> </soap: Body> HTTP/1. 1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soapenvelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap -encoding"> <soap: Body xmlns: m="http: //www. example. org/stock"> <m: Get. Stock. Price. Response> <m: Price>34. 5</m: Price> </m: Get. Stock. Price. Response> </soap: Body> </soap: Envelope> University of Western Ontario, Computer science department, Jan 2009
• • • Soap req/resp: Definition. Technologies. Implementation. Example from Net. Beans: SOAP Request: <? xml version="1. 0" encoding="UTF 8"? > <S: Envelope xmlns: S="http: //schemas. xmlsoap. org/ soap/envelope/"> <S: Header/> <S: Body> <ns 2: add xmlns: ns 2="http: //cal 2. org/"> <i>100</i> <j>250</j> </ns 2: add> </S: Body> </S: Envelope> SOAP Response <? xml version="1. 0" encoding="UTF-8"? > <S: Envelope xmlns: S="http: //schemas. xmlsoap. org/soap /envelope/"> <S: Body> <ns 2: add. Response xmlns: ns 2="http: //cal 2. org/"> <return>350</return> </ns 2: add. Response> </S: Body> </S: Envelope> University of Western Ontario, Computer science department, Jan 2009
WSDL: • • • Definition. Technologies. Implementation. • Used to describe Web services: - What the service does? - Where it located? - How to invoke it? (data format and protocol to access the service). • WSDL is a W 3 C recommendation (26. June 2007). University of Western Ontario, Computer science department, Jan 2009
WSDL document: • • • Definition. Technologies. Implementation. Interface Definition Implementation Description University of Western Ontario, Computer science department, Jan 2009
WSDL document: • • • Definition. Technologies. Implementation. <definitions> <types> Defines the data type uses XML Schema syntax </types> <message> Defines the data elements of an operation. Each message can consist of one or more parts (parameters). </message> Interface Definition <port. Type> Describes a web service, the operations that can be performed, and the messages that are involved. </port. Type> <binding> Defines the message format and protocol details for each port. </binding> <service> Describes a web service. Provide network address of the service. </service> </definitions> Implementation Description University of Western Ontario, Computer science department, Jan 2009
WSDL example (abstract) <message name="get. Term. Request"> <part name="term" type="xs: string"/> </message> <message name="get. Term. Response"> <part name="value" type="xs: string"/> </message> <port. Type name="glossary. Terms"> <operation name="get. Term"> <input message="get. Term. Request"/> <output message="get. Term. Response"/> </operation> </port. Type> • • • Definition. Technologies. Implementation. Input parameter Output parameter Port: function library Operation: function Input message Output message University of Western Ontario, Computer science department, Jan 2009
WSDL Binding: • • • Definition. Technologies. Implementation. • WSDL bindings defines the message format and protocol details for a web service. <binding type="glossary. Terms" name="b 1"> <soap: binding style="document" transport="http: //schemas. xmlsoap. org/soap/http" /> <operation> <soap: operation soap. Action="http: //example. com/get. Term"/> <input> <soap: body use="literal"/> </input> <output> <soap: body use="literal"/> </output> </operation> </binding> University of Western Ontario, Computer science department, Jan 2009
WSDL port and operations: • • • Definition. Technologies. Implementation. • A WSDL port describes the interfaces (legal operations) exposed by a web service. University of Western Ontario, Computer science department, Jan 2009
WS: • • • Definition. Technologies. Implementation.
UDDI: • • • Definition. Technologies. Implementation. • A directory for storing information about web services where businesses can register and search for Web services. • Framework for describing and discovering business services, and service providers. • Store web service interfaces described by WSDL. • Communicates via SOAP. • A platform-independent framework. • Other alternatives: eb. XML (Electronic business XML) and DSML (Directory Services Markup Language). • Control of UDDI given to OASIS. University of Western Ontario, Computer science department, Jan 2009
• • • UDDI*: Broader B 2 B Smarter Search Easier Aggregation A mid-sized manufacturer needs to create 400 online relationships with customers, each with their own set of standard and protocols A flower shop in Australia wants to be “plugged in” to every marketplace in the world, but doesn’t know how A B 2 B marketplace cannot get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc. Definition. Technologies. Implementation. Describe Services Discover Services Integrate Them Together * http: //www. authorstream. com/ University of Western Ontario, Computer science department, Jan 2009
UDDI components: • • • Definition. Technologies. Implementation. Business description: - White Pages Obtaining listings of organizations, contact info, list of general services provided Service description: - Yellow Pages Look up information via standardized or userdefined taxonomies. - Green pages Full descriptions of individual web services. Provided by pointers to service descriptions, which are usually stored outside of the registry Who – What - Where - How University of Western Ontario, Computer science department, Jan 2009
WS stack: • • • Definition. Technologies. Implementation. BPEL UDDI WSDL SOAP HTTP University of Western Ontario, Computer science department, Jan 2009
University of Western Ontario, Computer science department, Jan 2009
Net. Beans: • • • Definition. Technologies. Implementation. • A free, open-source Integrated Development Environment (IDE) for software developers. • Get all the tools you need to create professional desktop, enterprise, web, and mobile applications. • Use Java language, C/C++, and even dynamic languages such as PHP, Java. Script, Groovy, and Ruby. • Runs on many platforms including Windows, Linux, Mac OS X and Solaris. • Dedicated Support Available: programming advice, software support, and training credits. • Service Oriented Architecture Support. University of Western Ontario, Computer science department, Jan 2009
Requirement: • • • Definition. Technologies. Implementation. • Apache Axis 2: - The core engine for Web services. - A complete re-design and re-write of the widely used Apache Axis (an implementation of the SOAP). - Provides the capability to add Web services interfaces to Web applications. - Function as a standalone server application. - A server which plugs into servlet engines such as Tomcat. - Has support for RESTful web services. University of Western Ontario, Computer science department, Jan 2009
Architecture: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Cont. • • • Definition. Technologies. Implementation. • Servlet: Java classes that dynamically process requests and construct responses. • Java Servlet API allows a software developer to add dynamic content (embeds HTML in java). • Java's replacement for Common Gateway Interface (CGI) scripts. • Can almost be thought of as an applet that runs on the server side. • Server- and platform-independent. • Servlet lifecycle is governed by the servlet container. University of Western Ontario, Computer science department, Jan 2009
Cont. • • • Definition. Technologies. Implementation. • Java. Server Pages (JSP): Java technology allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. • It embeds Java code in HTML (by using <% and %>). • Enables rapid development of web-based applications that are server- and platform-independent. • Architecturally, JSP may be viewed as a high-level abstraction of servlets. • JSPs are compiled into Java Servlets by a JSP compiler. University of Western Ontario, Computer science department, Jan 2009
Cont. • • • Definition. Technologies. Implementation. • Apache Tomcat is is a servlet container developed by the Apache Software Foundation • An implementation of the Java Servlet and Java. Server Pages (JSP) technologies. • A Web container is the component of a Web server that interacts with the servlets • Tomcat can act as a simple standalone server for Web applications that use HTML, servlets, and JSP. • Provides a "pure. Java“ HTTP web server environment for Java code to run. • Glass. Fish is an open source application server project led by Sun Microsystems for the Java EE platform (Grizzly: the HTTP frontend of the application server). University of Western Ontario, Computer science department, Jan 2009
The Setup : • • • Definition. Technologies. Implementation. • Net. Beans IDE (6. 5) - JDK (5 or 6) - Apache Axis 2 (1. 4) - Java web or application server: - Tomcat web server (6. 0. 1. 8), or - Glass. Fish application server (2) University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Create WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Test WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Test WS: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
Result: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
SOAP req/resp: • • • Definition. Technologies. Implementation. University of Western Ontario, Computer science department, Jan 2009
WSDL: • • • Definition. Technologies. Implementation. <? xml version="1. 0" encoding="UTF-8" ? > - <!-- Published by JAX-WS RI at http: //jax-ws. dev. java. net. RI's version is JAX-WS RI 2. 1. 3. 1 -hudson-417 -SNAPSHOT. --> - <!-- Generated by JAX-WS RI at http: //jax-ws. dev. java. net. RI's version is JAX-WS RI 2. 1. 3. 1 -hudson-417 -SNAPSHOT. --> - <definitions xmlns: wsu="http: //docs. oasis-open. org/wss/2004/01/oasis-200401 -wssecurity-utility-1. 0. xsd" xmlns: soap="http: //schemas. xmlsoap. org/wsdl/soap/" xmlns: tns="http: //cal 2. org/" xmlns: xsd="http: //www. w 3. org/2001/XMLSchema" xmlns="http: //schemas. xmlsoap. org/wsdl/" target. Namespace="http: //cal 2. org/" name="cal_ws. Service"> - <types> - <xsd: schema> <xsd: import namespace="http: //cal 2. org/" schema. Location="http: //localhost: 8081/Calculator 2/cal_ws. Service? xsd=1" /> </xsd: schema> </types> - <message name="add"> <part name="parameters" element="tns: add" /> </message> - <message name="add. Response"> <part name="parameters" element="tns: add. Response" /> </message> - <port. Type name="cal_ws"> - <operation name="add"> <input message="tns: add" /> <output message="tns: add. Response" /> </operation> </port. Type> University of Western Ontario, Computer science department, Jan 2009
Cont. • • • Definition. Technologies. Implementation. - <binding name="cal_ws. Port. Binding" type="tns: cal_ws"> <soap: binding transport="http: //schemas. xmlsoap. org/soap/http" style="document" /> - <operation name="add"> <soap: operation soap. Action="" /> - <input> <soap: body use="literal" /> </input> - <output> <soap: body use="literal" /> </output> </operation> </binding> - <service name="cal_ws. Service"> - <port name="cal_ws. Port" binding="tns: cal_ws. Port. Binding"> <soap: address location="http: //localhost: 8081/Calculator 2/cal_ws. Service" /> </port> </service> </definitions> University of Western Ontario, Computer science department, Jan 2009
References: • • • Definition. Technologies. Implementation. • W 3 C : http: //www. w 3 c. org/ • OASIS: http: //www. oasis-open. org/home/index. php • Net. Beans: http: //www. netbeans. org • Tomcat: http: //tomcat. apache. org/ • Tomcat and Apache web server: http: //www. coderanch. com/t/85639/Tomcat/ Differencebetween-Tomcat-Apache-Web • Tomcate and Glass. Fish: http: //java. dzone. com/articles/glassfish-and-tomcat-whats-the • Servlet and JSP: http: //www. servlets. com/soapbox/problems-jsp. html • Web container and web server: http: //www. coderanch. com/t/176596/Web-Component. Certification-SCWCD/certification/Web-Container-Web-server • Cesare Pautasso, Olaf Zimmermann, Frank Leymann, RESTful Web Services vs. “Big” Web Services: Making the Right Architectural Decision. pp. 805 -814, Proceedings of the 17 th International World Wide Web Conference, ACM Press, China, April 2008. • Seekda: the largest search engine for public Web Service: http: //seekda. com/ • WS standards overview: http: //www. innoq. com/soa/ws-standards/poster/inno. Q %20 WSStandards%20 Poster%202007 -02. pdf University of Western Ontario, Computer science department, Jan 2009
Thank you. . University of Western Ontario, Computer science department, Jan 2009
- Slides: 52