Introduction to Web Services

Similar documents
Telecommunication Services Engineering Lab. Roch H. Glitho

Web Services. Richard Sinnott.

Web Services. Grid Computing (M) Lecture 6. Olufemi Komolafe 19 January 2007

1.264 Lecture 14. SOAP, WSDL, UDDI Web services

Grid Computing. What is XML. Tags, elements, and attributes. Valid and well formed XML. Grid Computing Fall 2006 Paul A.

ISM Configuration Step by Step Guide SOAP Monitor. Overview. Version 1.1

ISM Configuration Step by Step Guide SOAP Monitor. Overview. Version 1.0

Web Services. GC: Web Services Part 2: Rajeev Wankar

Web services. In plain words, they provide a good mechanism to connect heterogeneous systems with WSDL, XML, SOAP etc.

WSDL. Stop a while to read about me!

Modulo II WebServices

Web Services Description Language

Exercise SBPM Session-4 : Web Services

Sriram Krishnan, Ph.D. NBCR Summer Institute, August 2010

Introduction to Web Services

Web Applications. Web Services problems solved. Web services problems solved. Web services - definition. W3C web services standard

Chapter 9 Web Services

Web Services. Moving towards Service Oriented Architectures. Rensselaer CSCI 4220 Network Programming

Publications Office. TED Website - Notice Viewer WS Technical Specifications Document - Appendix D - NoticeViewer

Why SOAP? Why SOAP? Web Services integration platform

Networks and Services (NETW-903)

WEB SERVICES PXC. (v 0.2) Manel Guerrero Albert Cabellos UNIVERSITAT POLITÈCN NICA DE CATALUNYA

This presentation is a primer on WSDL Bindings. It s part of our series to help prepare you for creating BPEL projects. We recommend you review this

Realisation of SOA using Web Services. Adomas Svirskas Vilnius University December 2005

Introduction to Web Services

Introduction to Web Services

Web-services. Brian Nielsen

Lecture Notes course Software Development of Web Services

Web Services and WSDL

XML Web Service? A programmable component Provides a particular function for an application Can be published, located, and invoked across the Web

SOA & Web services. PV207 Business Process Management

SOAP Web Services Objektumorientált szoftvertervezés Object-oriented software design. Web services 11/23/2016. Outline. Remote call.

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

SOAP / WSDL INTRODUCTION TO SOAP, WSDL AND UDDI, THE COMBO FOR BIG WEB SERVICES SOAP - WSDL - UDDI. PETER R. EGLI peteregli.net. peteregli.

XML Grammar and Parser for the Web Service. Offerings Language

SOAP Introduction Tutorial

This tutorial is going to help all those readers who want to learn the basics of WSDL and use its features to interface with XML-based services.

02267: Software Development of Web Services

Simple Object Access Protocol (SOAP) Reference: 1. Web Services, Gustavo Alonso et. al., Springer

Middleware and the Internet

The Florida State University College of Arts and Sciences. WSDL Importer. Kiran Kaja. Major Professor: Dr. Robert van Engelen

Simple Object Access Protocol (SOAP)

On the Creation of Distributed Simulation Web- Services in CD++

World-Wide Wide Web. Netprog HTTP

Web Services. K.L. Lin

Web-Based Systems. INF 5040 autumn lecturer: Roman Vitenberg

Web Services Foundations: SOAP, WSDL and UDDI

We recommend you review this before taking an ActiveVOS course or before you use ActiveVOS Designer.

Web Services Technical Reference

BEA WebLogic Server. Programming WebLogic Web Services

Tutorial on Fast Web Services

Web Services Description Language (WSDL) Version 1.2

Introduzione ai Web Services

Guide: SOAP and WSDL WSDL. A guide to the elements of the SOAP and WSDL specifications and how SOAP and WSDL interact.

Web Services in Cincom VisualWorks. WHITE PAPER Cincom In-depth Analysis and Review

Understanding ZigBee Gateway

Service Interface Design RSVZ / INASTI 12 July 2006

Using WSDL in a UDDI Registry, Version 2.0

Oracle Communications Network Charging and Control. Web Services Description Language Reference Guide Release 6.0.1

Web Services Overview

Using WSDL in a UDDI Registry, Version 2.0

Artix ESB. Bindings and Transports, Java Runtime. Version 5.5 December 2008

ID2208 Programming Web Services

C exam. IBM C IBM WebSphere Application Server Developer Tools V8.5 with Liberty Profile. Version: 1.

XML Messaging: Simple Object Access Protocol (SOAP)

Programming Web Services in Java

Invoking Web Services. with Axis. Web Languages Course 2009 University of Trento

WSDL Document Structure

Java CAPS 6 Update 1 Exposing MTOM-capable Java CAPS Classic Web Service Contents Introduction

IndySoap Architectural Overview Presentation Resources

Cisco CallManager 4.1(2) AXL Serviceability API Programming Guide

Case study group setup at catme.org Please respond before Tuesday next week to have better group setup

Sophisticated Simplicity In Mobile Interaction. Technical Guide Number Information Services - Synchronous SOAP. Version 1.3

XML.com: A Web Services Primer Page 1 of 10

Web Services: Introduction and overview. Outline

Data Transport. Publisher's Note

Lecture Notes course Software Development of Web Services


Sophisticated Simplicity In Mobile Interaction. Technical Guide Number Information Services - Asynchronous SOAP. Version 1.3

02267: Software Development of Web Services

SOAP Specification. 3 major parts. SOAP envelope specification. Data encoding rules. RPC conventions

Distributed Internet Applications - DIA. Web Services XML-RPC and SOAP

CHAPTER 2 WEB SERVICES DESCRIPTION LANGUAGE

COP 4814 Florida International University Kip Irvine. Inside WCF. Updated: 11/21/2013

Web Services Development for IBM WebSphere Application Server V7.0

Implementing a Ground Service- Oriented Architecture (SOA) March 28, 2006

Using WSDL in a UDDI Registry, Version 2.0

SOAP (Simple Object Access Protocol)

Thomas Schmidt haw-hamburg.de SOAP. Message Exchange SOAP Message Structure SOAP Encoding Programming Issues

SOAP Introduction. SOAP is a simple XML-based protocol to let applications exchange information over HTTP.

TRB-COMPUTER INSTRUCTORS COMPUTER SCIENCE. PG-TRB MATERIALS

Interface Control Document

Dr. Cesare Pautasso Computer Science Department Swiss Federal Institute of Technology (ETHZ)

Introduction to Web Service

Göttingen, Introduction to Web Services

Architecture of the CORBA Component Model. Comparing CORBA and.net: IIOP and SOAP

SOA and Webservices. Lena Buffoni

Introduction to Web Services & SOA

Java Web Service Essentials (TT7300) Day(s): 3. Course Code: GK4232. Overview

Comments on this document should be sent to (public archives). It is inappropriate to send discussion s to this address.

Transcription:

20 th July 2004 www.eu-egee.org Introduction to Web Services David Fergusson NeSC EGEE is a project funded by the European Union under contract IST-2003-508833

Objectives Context for Web Services Architecture Standards XML Schema SOAP WSDL UDDI Introduction to web services, 20 th July 2004-2

Contents INTRODUCTION ARCHITECTURE PROTOCOLS XML SOAP SOAP Deployment WSDL Introduction to web services, 20 th July 2004-3

INTRODUCTION Introduction to web services, 20 th July 2004-4

The concept of web services Web services is a messaging system which allows communication between objects. Messages can be synchronous or asynchronous. This system is loosely coupled (ie. Services should not be dependent on each other). Introduction to web services, 20 th July 2004-5

W3C view of Web Services The World Wide Web is more and more used for application to application communication. The programmatic interfaces made available are referred to as Web services. http://www.w3.org/2002/ws/ Introduction to web services, 20 th July 2004-6

W3C definition of a Web Service A web service is a software system identified by a URI, whose public interfaces and bindings are defined and described using XML. Its definitions can be discovered by other software systems. These systems may then interact with the web service in a manner prsecribed by its definition, using XML-based messages conveyed by Internet protocols. Introduction to web services, 20 th July 2004-7

Web Services Web services are Applications that enable messaging and remote procedure calls over a network or the Internet often using XML and HTTP Benefits This allows us to hide the details of how a service is implemented; only URL and data types are required It is largely irrelevant to the client whether the service is developed with Java or ASP.NET or if it is running on Windows, Linux or any other platform Introduction to web services, 20 th July 2004-8

W3C Web Services glossary http://www.w3.org/tr/2004/note-ws-gloss-20040211/ Introduction to web services, 20 th July 2004-9

Architecture Introduction to web services, 20 th July 2004-10

Web services architecture overview Consumer (1) CONSUMER (CLIENT) Transport protocol (eg.http) PROVIDER (SERVER) INTERNET (TCP/IP) Transport protocol (eg.http) Introduction to web services, 20 th July 2004-11

Web services architecture overview Consumer (2) CONSUMER (CLIENT) PROVIDER (SERVER) HTTP SOAP envelope Introduction to web services, 20 th July 2004-12

Web services architecture overview Consumer (3) CONSUMER (CLIENT) PROVIDER (SERVER) HTTP SOAP envelope rpcrouter Introduction to web services, 20 th July 2004-13

Web services architecture overview Provider (1) CONSUMER (CLIENT) PROVIDER (SERVER) Container (eg. Tomcat) Servlet Introduction to web services, 20 th July 2004-14

Web services architecture overview Provider (2) CONSUMER (CLIENT) PROVIDER (SERVER) Web server (eg. Apache) Container (eg. Tomcat) Servlet Introduction to web services, 20 th July 2004-15

Web services architecture overview Message transport (1) CONSUMER (CLIENT) HTTP SOAP PROVIDER (SERVER) Container (eg. Tomcat) Servlet envelope Introduction to web services, 20 th July 2004-16

Web services stack Application rpcrouter SOAP HTTP Application (servlet) Web server SOAP HTTP TCP/IP TCP/IP Infrastructure (Data link) Infrastructure (Data link) Introduction to web services, 20 th July 2004-17

Business mail analogy The SOAP envelope is analogous to a business letter with an address within a distant organisation. It gives the information needed to get it from the sender s building to the recipient s building. The transport protocol is analogous to the carrier used for transport between buildings. (eg. FedEx.) The web server and container act like the local services for the recipient which place the message in his/her pigeonhole. Introduction to web services, 20 th July 2004-18

Protocols Introduction to web services, 20 th July 2004-19

Examples context The examples in this talk relate to the Java Web Services implementation as this open source. Other implementations (.NET) have different details but a similar overall concept. Introduction to web services, 20 th July 2004-20

Communication and standards Efficient (or indeed any) communication is dependent on a shared vocabulary and grammar. Because web services deals with inter-organisation communication these must be universal standards. Introduction to web services, 20 th July 2004-21

Underlying standards The basic standards for web services are: XML (Extensible Markup Language) SOAP (Simple Object Access Protocol) WSDL (Web Services Description Language) UDDI (Universal Description, Discovery and Integration) Introduction to web services, 20 th July 2004-22

The state of standards XML 1.0 fairly stable, although Schema are in the process of replacing DTDs (currently Schema 1.1 being worked on). SOAP 1.2 WSDL 2.0 (coming out, 1.2 current) UDDI version 3 (Aug 2003) Plus BPEL 1.1 (Business Process Execution Language) choreography description language (web services work flows) started January 2003. Standards are still volatile and in the process of development. Introduction to web services, 20 th July 2004-23

Web Services Architecture Web Services involve three major roles Service Provider Service Registry Service Consumer Three major operations surround web services Publishing making a service available Finding locating web services Binding using web services Introduction to web services, 20 th July 2004-24

Web Services Use Case consumer Interact User Interface Binding Service Discover Registry provider Implement Service Publish Introduction to web services, 20 th July 2004-25

Making a service available (1) In order for someone to use your service they have to know about it. To allow users to discover a service it is published to a registry (UDDI). To allow users to interact with a service you must publish a description of it s interface (methods & arguments). This is done using WSDL. Introduction to web services, 20 th July 2004-26

Making a service available (2) Once you have published a description of your service you must have a host set up to serve it. A web server is often used to deliver services (although custom application application communication is also possible). This is functionality which has to be added to the web server. In the case of the apache web server a container application (Tomcat) can be used to make the application (servlet) available to apache (deploying). Introduction to web services, 20 th July 2004-27

The old transfer protocols are still there. Like the grid architecture web services are layered on top of existing, mature transfer protocols. HTTP, SMTP are still used over TCP/IP to pass the messages. Web services, like grids, can be seen as a functionality enhancement to the existing technologies. Introduction to web services, 20 th July 2004-28

XML All Web Services documents are written in XML XML Schema are used to define the elements used in Web Services communication Introduction to web services, 20 th July 2004-29

SOAP Actually used to communicate with the Web Service Both the request and the response are SOAP messages The body of the message (whose grammar is defined by the WSDL) is contained within a SOAP envelope Binds the client to the web service Introduction to web services, 20 th July 2004-30

WSDL Describes the Web Service and defines the functions that are exposed in the Web Service Defines the XML grammar to be used in the messages Uses the W3C Schema language Introduction to web services, 20 th July 2004-31

UDDI UDDI is used to register and look up services with a central registry Service Providers can publish information about their business and the services that they offer Service consumers can look up services that are available by Business Service category Specific service {We will see an example of a UDDI server on XMethods in the demonstration} Introduction to web services, 20 th July 2004-32

XML Introduction to web services, 20 th July 2004-33

What is XML XML stands for extensible markup language It is a hierarchical data description language It is a sub set of SGML a general document markup language designed for the American military. It is defined by w3c. Introduction to web services, 20 th July 2004-34

How does XML differ from HTML? HTML is a presentation markup language provides no information about content. There is only one standard definition of all of the tags used in HTML. XML can define both presentation style and give information about content. XML relies on custom documents defining the meaning of tags. Introduction to web services, 20 th July 2004-35

What is a Schema? A schema is the definition of the meaning of each of the tags within a XML document. Analogy: A HTML style sheet can be seen as a limited schema which only specifies the presentational style of HTML which refers to it. Example: in HTML the tag <strong> pre-defined. In XML you would need to define this in the context of your document. Introduction to web services, 20 th July 2004-36

A minimal XML document value <?xml <?xml version= 1.0?>?> <document name= first >Jim</document> A tag An attribute Closing tag Introduction to web services, 20 th July 2004-37

Valid and well formed A correct XML document must be both valid and well formed. Well formed means that the syntax must be correct and all tags must close correctly (eg < > </ >). Valid means that the document must conform to some XML definition ( a DTD or Schema). (Otherwise there can be no definition of what the tags mean) Introduction to web services, 20 th July 2004-38

Using namespaces in XML To fully qualify a namespace in XML write the namespace:tag name. eg. <my_namespace:tag> </my_namespace:tag> In a globally declared single namespace the qualifier may be omitted. More than one namespace: <my_namespace:tag> </my_namespace:tag> <your_namespace:tag> </your_namespace:tag> can co-exist if correctly qualified. Introduction to web services, 20 th July 2004-39

Namespaces in programming languages In C/C++ defined by #includes and classes (eg. myclass::variable). In PERL defined by package namespace, $local and $my (eg. mypackage::variable). In JAVA defined by includes and package namespace (eg. java.lang.object) Defines the scope of variables Introduction to web services, 20 th July 2004-40

Schema <?xml <?xml version="1.0"?> version="1.0"?> <xs:schema <xs:schema xmlns:xs=http://www.w3.org/2001/xmlschema xmlns:xs=http://www.w3.org/2001/xmlschema xmlns= document" xmlns= document" > > <xs:element <xs:element name name = = DOCUMENT > DOCUMENT > <xs:element <xs:element name= CUSTOMER"> name= CUSTOMER"> </xs:element> </xs:element> </xs:element> </xs:element> </xs:schema> </xs:schema> Simple schema saved as order.xsd <?xml <?xml version= 1.0?> version= 1.0?> <DOCUMENT <DOCUMENT xmlns= document xmlns= document xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation= order.xsd > xsi:schemalocation= order.xsd > <DOCUMENT> <DOCUMENT> <CUSTOMER>sam <CUSTOMER>sam smith</customer> smith</customer> <CUSTOMER>sam <CUSTOMER>sam smith</customer> smith</customer> </DOCUMENT> </DOCUMENT> XML document derived from schema. Introduction to web services, 20 th July 2004-41

SOAP Introduction to web services, 20 th July 2004-42

Request Response Web Services Currently the most common implementation of Web Services Work in a very simple request response paradigm For Example: A Weather Service simple request for weather in an area, simple response with the weather report An Airline special offers service travel agents would simply make requests for latest offers and would receive the offers as a response Introduction to web services, 20 th July 2004-43

SOAP messages SOAP provides a standard envelope within which a message can be delivered. SOAP is mechanism (protocol) for transferring information (messages) between applications which may be widely distributed. SOAP says nothing about the content of the message the sender and the receiver must understand the message for themselves. SOAP is part of a communication stack. Introduction to web services, 20 th July 2004-44

SOAP Structure(1) Each SOAP message will have: An Envelope A Header (optional) A Body The Body may contain a Fault element Transport protocol MIME header SOAP ENVELOPE SOAP HEADER SOAP BODY Fault Introduction to web services, 20 th July 2004-45

SOAP Structure(2) The envelope wraps the entire soap document The header contains allows additional information to be passed as well as the body of the document e.g. authentication The body element contains the core of the SOAP document this will contain either the RPC call or the XML message itself The fault information will contain any exception information Introduction to web services, 20 th July 2004-46

Anatomy of a SOAP message <?xml version= 1.0 encoding= UTF-8?> <SOAP-ENV:Envelope xmlns:soap_env= http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi= http://www.w3c.org/1999/xmlschema-instance xmlns:xsd= http://www.w3c.org/1999/xmlschema > <SOAP-ENV:Header> </SOAP-ENV:Header> <SOAP_ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Introduction to web services, 20 th July 2004-47

SOAP protocol binding SOAPAction = urn:soaphttpclient-action-uri Host = localhost Content-Type = text/xml; charset=utf-8 Content-Length = 701 <SOAP-ENV:Envelope xmlns:soap_env= http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi= http://www.w3c.org/1999/xmlschema-instance xmlns:xsd= http://www.w3c.org/1999/xmlschema > </SOAP-ENV:Envelope> Introduction to web services, 20 th July 2004-48

SOAP RPC SOAP RPC messages contain XML that represents a method call or method response The SOAP XML will be converted into a method call on the server and the response will be encoded into SOAP XML to be returned to the client Objects passed in SOAP messages are converted to XML representations and have to be extracted on reciept. Introduction to web services, 20 th July 2004-49

SOAP Faults SOAP errors are handled using a specialised envelope known as a Fault Envelope A SOAP Fault is a special element which must appear as an immediate child of the body element <faultcode> and <faultstring> are required. Introduction to web services, 20 th July 2004-50

A SOAP fault <?xml version= 1.0 encoding= UTF-8?> <SOAP-ENV:Envelope xmlns:soap_env= http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi= http://www.w3c.org/1999/xmlschema-instance xmlns:xsd= http://www.w3c.org/1999/xmlschema > <SOAP_ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope> <SOAP-ENV:Fault> <faultcode>soap-env:server</faultcode> <faultstring>test fault</faultstring> <faultactor>/soap/servlet/rpcrouter</faultactor> <detail>.. </detail> </SOAP-ENV:Fault> Introduction to web services, 20 th July 2004-51

SOAP Attachment Large quantities or binary data may not fit well into a XML SOAP message. In which case it can be sent out of band by attaching it to a SOAP message Analogy : email attachments. Transport protocol MIME header SOAP ENVELOPE SOAP HEADER SOAP BODY FAULT Attachment Introduction to web services, 20 th July 2004-52

Attaching a file to a SOAP message To add a file to a SOAP message a tag is added within the body of the message. <?xml version= 1.0 encoding= UTF-8?> <SOAP-ENV:Envelope xmlns:soap_env= http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi= http://www.w3c.org/1999/xmlschema-instance xmlns:xsd= http://www.w3c.org/1999/xmlschema > <SOAP_ENV:Body> <attachment href= {URL} /> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Introduction to web services, 20 th July 2004-53

SOAP Deployment Introduction to web services, 20 th July 2004-54

Deployment: Making the container aware of a servlet The web server has to be aware of the interface and exposed methods of a servlet in order to use it. Using Tomcat as an example this can be done in a number of ways. 1. Enter the values manually into the SOAP admin page from a Deployment descriptor. 2. You can use the SOAP manager application from the command line 3. You can manually edit Tomcat s WEB-INFO/web.xml file 4. You can create a WAR file and place it in Tomcat s webapps folder 5. You can use ANT Introduction to web services, 20 th July 2004-55

Using a WAR file A WAR file is basically an archive description of a servlet installation (JAR and WAR naming derives from UNIX TAR java archive, web archive, tape archive). Example: placed in Tomcat s webapps folder it can be interpreted by the container. Introduction to web services, 20 th July 2004-56

Deployment Descriptor A SOAP manager file <isd:service xmlns:isd= http://xml.apache.org/xml-soap/deployment id= urn:stockonhand > <isd:provider type= java scope= Application methods= getqty > <isd:java class= StockQuantity /> </isd:provider> <isd:faultlistener>org.apache.soap.sever.domfaultlistener</isd:faultlistener> </isd:service> Some containers (Tomcat) provide GUIs for deployment Introduction to web services, 20 th July 2004-57

SOAP Implementations There are several implementations of the SOAP Specification Apache Axis GLUE Most J2EE application servers contain a SOAP implementation.net (C#) has a SOAP implementation PERL also has a SOAP implementation (SOAP::Lite). Introduction to web services, 20 th July 2004-58

WSDL Introduction to web services, 20 th July 2004-59

The function of WSDL WSDL describes a service s exposed interface It is what a client sees of your service WSDL includes information about The data types it uses Parameters it requires and returns Groupings of functionality The protocol to be used to access the service The location or address of the service Introduction to web services, 20 th July 2004-60

WSDL Structure A WSDL document is an XML document <?xml version="1.0" encoding="utf-8"?> <definitions> <types> <! define the types here using XML Schema </types> <message> <! XML messages the web service uses are defined here </message> <porttype> <! define the input and output parameters here - </porttype> <binding> <! define the network protocol here </binding> <service> <! location of the service </service> </definitions> Introduction to web services, 20 th July 2004-61

<import> element <definitions targetnamespace= urn:3950 xmlns= http://schema.xmlsoap.org/wsdl/ xmlns:xsd= http://www.w3c.org/2001/xmlschema xmlns:soap= http://schemas.xmlsoap.org/wsdl/soap/ xmlns:soapenc= http://schemas.xmlsoap.org/soap/emcoding/ xmlns:tns= urn:3950 > <import namespace= http://nesc.ac.uk location= http://nesc.ac.uk/ez.xsd /> Acts like C/C++ #include, or Java import. Incorporates external namespaces Introduction to web services, 20 th July 2004-62

Namespaces WSDL uses a number of different namespaces including XML Schema Namespaces http://www.w3.org/2000/10/xmlschema http://www.w3c.org/2001/xml-schema-instance WSDL Namespaces http://schemas.xmlsoap.org/wsdl/soap/ http://schemas.xmlsoap.org/wsdl/ SOAP Namespaces http://schemas.xmlsoap.org/soap/encoding http://schemas.xmlsoap.org/soap/envelope Introduction to web services, 20 th July 2004-63

The <types> The types element contains XML Schemas defining the datatypes that are to be passed to and from the web service <types> <schema targetnamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2000/10/xmlschema"> <element name= PDU type = PDU > <xsd:simpletype name = KnownProximityUnit > <xsd:restriction base= xsd:string > <xsd:enumeration value= character /> <xsd:enumeration value= word /> <xsd:enumeration value= sentence /> <xsd:enumeration value= paragraph /> <xsd:enumeration value= section /> <xsd:enumeration value= chapter /> </xsd:restriction> </xsd:simpletype> </element> </schema> </types> Introduction to web services, 20 th July 2004-64

The <message> The <message> element is used to define the messages that will be exchanged between the client and the service These message elements contain <part> elements, which will be using types defined in the types element <message name="getlasttradepriceinput"> <part name="body" element="xsd1:tradepricerequest"/> </message> <message name="getlasttradepriceoutput"> <part name="body" element="xsd1:tradeprice"/> </message> All the parts are namespace qualified Introduction to web services, 20 th July 2004-65

The <porttype> The types and messages have been defined, but they have not been defined in terms of where they fit in the functionality of the web service This is done within <porttype> and <operation> elements <porttype name="stockquoteporttype"> <operation name="getlasttradeprice"> <input message="tns:getlasttradepriceinput"/> <output message="tns:getlasttradepriceoutput"/> </operation> </porttype> A porttype is analogous to a class An operation is analogous to a method in that class Introduction to web services, 20 th July 2004-66

Grid Services A mechanism for creating grid services, which add state to Web Services, is to extend the porttype. (eg. in Globus Toolkit 3) Globus Toolkit (using Axis) takes care of creating bindings in WSDL and service definitions for the developer. Introduction to web services, 20 th July 2004-67

Types of <operation> There are four distinct types of operation Synchronous Request-response - The service receives a message and sends a reply Solicit-response - The service sends a message and receives a reply message Asynchronous One-way - The service receives a message Notification - The service sends a message All of these can be defined in WSDL Introduction to web services, 20 th July 2004-68

Defining the type of operation Presence and order of input/output elements defines the type of operation. Request-response <input><output> Solicit-response <output><input> One-way <input> only Notification <output> only Introduction to web services, 20 th July 2004-69

The <binding> element This element is used to define the mechanism that the client will actually use to interact with the web service There are three possibilities 1. SOAP 2. HTTP 3. MIME The most common choice is currently SOAP The binding element defines the protocol specific information for the porttypes previously defined Introduction to web services, 20 th July 2004-70

The binding tag <binding name= ez3950soapbinding type= tns:ez3950porttypes > The <binding> tag indicates that we will map a <Port Type> to a protocol <soap:binding style= rpc transport= http://schemas.xmlsoap.org/soap/http/ > Indicates we will be using the SOAP binding extensions to map the operations. The alternative to rpc is document. ( to use GET/POST use <http:binding > to use MIME use <mime:binding..> ) Introduction to web services, 20 th July 2004-71

<binding> Example Below is an example of a binding element for SOAP <binding name="stockquotesoapbinding type="tns:stockquoteporttype"> <soap:binding style="document transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getlasttradeprice"> <soap:operation soapaction="http://example.com/getlasttradeprice"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> Introduction to web services, 20 th July 2004-72

<service> The final component of a WSDL file is the <service> element The <service> element defines <port> elements that specify where requests should be sent <service name="stockquoteservice"> <port name="stockquoteport" binding="tns:stockquotebinding"> <soap:address location="http://example.com/stockquote"/> </port> </service> The <soap:address> subelement identifies the URL of the service The precise content of <port> elements will be dependent upon the mechanism, i.e. SOAP, HTTP or MIME Introduction to web services, 20 th July 2004-73

Xmethods Xmethods is a UDDI registry which exposes all the components of the services it holds for examination. You can examine the WSDL through a browser and see the SOAP messages constructed by the service. http://www.xmethods.com Introduction to web services, 20 th July 2004-74

Xmethods front page Introduction to web services, 20 th July 2004-75

Service descriptions Introduction to web services, 20 th July 2004-76

SOAP message Introduction to web services, 20 th July 2004-77

WSDL view Introduction to web services, 20 th July 2004-78

Pseudocode Introduction to web services, 20 th July 2004-79

Objectives Context for Web Services Architecture Standards XML Schema SOAP WSDL UDDI Introduction to web services, 20 th July 2004-80

THE END Questions? Introduction to web services, 20 th July 2004-81