Web Service Samir Tata GET/INT



Similar documents
Distributed Embedded Systems

WSDL Example (Interface) WSDL Example (Implementation) Universal Description, Discovery and Integration. UDDI Usage

Web-Service Example. Service Oriented Architecture

Chapter 6 Registering and Discovering. Web Serv vices: Web services

Introduction. Tom Dinkelaker, Ericsson Guido Salvaneschi, Mira Mezini, TUD

Middleware and the Internet

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

WEB SERVICES. Definition: Web service is a programmable application component that s accessible through standard Web protocols.

Service Oriented Architecture using JAVA

XIII. Service Oriented Computing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

Fundamentals of Web Programming a

Web Services. Distributed Object Systems 11. Web Services, SOAP and NET. Web Applications. Web Services. Web services vs Distributed Objects

T320 E-business technologies: foundations and practice

Introduction to Service Oriented Architectures (SOA)

Creating Web Services in NetBeans

Grid Computing. Web Services. Explanation (2) Explanation. Grid Computing Fall 2006 Paul A. Farrell 9/12/2006

Service Oriented Computing: SOAP, WSDL and UDDI. Dr. Cristian Mateos Diaz ( ISISTAN - CONICET

Ibm. Web Services Conceptual Architecture (WSCA 1.0) May By Heather Kreger IBM Software Group

Service Computing: Basics Monica Scannapieco

4. Concepts and Technologies for B2C, B2E, and B2B Transaction

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Service Oriented Architecture

Service-Oriented Architectures

Introduction into Web Services (WS)

Modeling Web Services with UML

Research on the Model of Enterprise Application Integration with Web Services

Author: Gennaro Frazzingaro Universidad Rey Juan Carlos campus de Mostòles (Madrid) GIA Grupo de Inteligencia Artificial

Joke Server example. with Java and Axis. Web services with Axis SOAP, WSDL, UDDI. Joke Metaservice Joke Server Joke Client.

WEB SERVICES. Revised 9/29/2015

Developing Web Services Applications

Web Services Development In a Java Environment

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

Emerging Technologies Shaping the Future of Data Warehouses & Business Intelligence

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

BUSINESS PROCESS AND EBXML - WEB SERVICES INTEGRATION PLATFORM, REQUIREMENTS, ARCHITECTURES, SECURITY

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

Service-Oriented Architecture and Software Engineering

EHR-IIS Interoperability Enhancement Project. Transport Layer Protocol Recommendation Formal Specification. Version 1.

Web Services Technologies

Oracle SOA Reference Architecture

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

Developing Java Web Services

Consuming, Providing & Publishing WS

Modern XML applications

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

AquaLogic Service Bus

Lesson 4 Web Service Interface Definition (Part I)

B2B E-Commerce: Issues and Enabling Technologies

Enterprise Application Designs In Relation to ERP and SOA

Web Services Description Language (WSDL) Wanasanan Thongsongkrit

ISM/ISC Middleware Module

e-gov Architecture Service Interface Guidelines

Service-Oriented Architecture: Analysis, the Keys to Success!

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

Automating the DEVS Modeling and Simulation Interface to Web Services

Agents and Web Services

T320 E-business technologies: foundations and practice

How To Create A C++ Web Service

Concept, implementation and performance testing of a mobile Web Service provider for Smart Phones

A Quick Introduction to SOA

Technical Track Session Service-Oriented Architecture

Integration of Hotel Property Management Systems (HPMS) with Global Internet Reservation Systems

Java Web Services Training

Service-Oriented Computing and Service-Oriented Architecture

Introduction to Web Services

Oracle Service Bus Examples and Tutorials

Introduction aux Services Web # $ $ "! # $ % & ' ()* + (, ), * ' % & ' -. / (00 * (00 ', 1' 000*

Service Oriented Architectures

Building Web Services with XML Service Utility Library (XSUL)

"! # $ % & ' ()* + (, ), * '. / (00 * " (00 ', 1' 000*

Developing a Web Service Based Application for Mobile Client

Distributed systems. Distributed Systems Architectures

Web-Programmierung (WPR)

Web Services and Service Oriented Architectures. Thomas Soddemann, RZG

SOA GOVERNANCE MODEL

EAI OVERVIEW OF ENTERPRISE APPLICATION INTEGRATION CONCEPTS AND ARCHITECTURES. Enterprise Application Integration. Peter R. Egli INDIGOO.

So You Want an SOA: Best Practices for Migrating to SOA in the Enterprise. Eric Newcomer, CTO

e-science Technologies in Synchrotron Radiation Beamline - Remote Access and Automation (A Case Study for High Throughput Protein Crystallography)

SOA Planning Guide The Value Enablement Group, LLC. All rights reserved.

A standards-based approach to application integration

Introduction to Testing Webservices

Internationalization and Web Services

Service-Oriented Architecture and its Implications for Software Life Cycle Activities

Send your request via a SOAP-Request (e.g. with DotNET/SOAP, Java, PHP) to he following URL of our server:

Developers Integration Lab (DIL) System Architecture, Version 1.0

Unit IV: SOAP protocol, XML-RPC, HTTP, SOAP faults and SOAP attachments, Web services, UDDI, XML security

Design and Implementation of a Framework for Testing BPEL Compositions

Web services with WebSphere Studio: Build and test

Transcription:

Web Service GET/INT 1

Outline Service Orientation Web Service Web Service framework SOAP WSDL UDDI 2

Service orientation 3

Structured Programming A very good thing Promise: Organization and Reuse Procedures, Functions and Data Got computing out of the stone-age Service-orientation Great for its time Monolithic, isolated server applications Asynchronous batch services Synchronous terminal services 4

Object-Orientation A very good thing Promise: Organization and Reuse Classes (Functions and Data grouped) Made developers productive Service-orientation Great for its time Monolithic, isolated c/s applications Fancy, Interactive GUIs Stateful, high-perf, low-scale servers 5

Component-Orientation A very good thing Promise: Organization and Reuse Components (Interfaces grouped) Implementation agnostic Made cross-app interaction work Service-orientation Great! Multi-Layer, Multi-Tier Applications High-Perf, High-Scale Servers 6

The bad things SP, OOP, COP "Programming" paradigms These are about code, not architecture Architecture follows programming model Abstract concept, concrete mapping Mapped into Pascal, C++, CORBA, COM Reuse works only inside each domain Reuse across domains painful, at least. None crosses org. boundaries easily Promote synchronicity Service-orientation 7

Needs There's little "green field" anymore New stuff needs existing stuff Existing stuff needs new stuff Heterogeneous Systems No single OS-family / HW-platform Deal with "Big Bang" Effect Access/Manipulate data from anywhere Service-orientation 8

Wants Reuse and organization Across layers & applications Across organization & trust boundaries Implementation agnostic Standards-based interaction Don't depend on language/platform Dynamic grouping and regrouping Near/Far clustering and distribution Service-orientation 9

Service-Orientation What is a "Service"? Some functional block Location, Platform, Code are irrelevant Implications Always assume remote use Always assume cross-platform use Ignore service's inner implementation Service-orientation 10

SO, OO, CO, and SO Structured Objects Components Services Service-orientation Granularity Very Fine Fine Medium Coarse Contract Defined Private/Public Public Published Reusability Low Low Medium High Coupling Tight Tight Loose Very Loose Dependencies Compile-Time Compile-Time Compile-Time Run-Time Communication Scope Intra-Application Intra-Application Inter-Application Inter-enterprise 11

Assumptions to Avoid Don't think of a service as Transactions, Objects, Functions Synchronous or Asynchronous Stateless or Stateful The actual invocation target Services may be Message destinations (applications) Message handlers (infrastructure) Message carriers (transport) Service-orientation 12

Terminology Message Data exchanged between services Not Objects. Code doesn't travel Context Defines scope of action, conversation Clothes-line for state and infrastructure Destinations Target service or service class. Not "http://somewhere/" Service-orientation 13

So what is a service? Service-orientation There really are just three types of services Message Producer type Act and add stuff to messages Message Consumer type Take stuff from messages and act on it Message Producer/consumer type 14

Examples Service-orientation Transport Authentication Authorization Transactions Monitoring Proxies, Stubs Routing 15

Web Service 16

Today s Web Web designed for application to human interactions Served very well its purpose: Information sharing: a distributed content library. Enabled B2C e-commerce. Non-automated B2B interactions. How did it happen? Web service Built on very few standards: http + html Shallow interaction model: very few assumptions made about computing platforms. Result was ubiquity. 17

What s next? The Web is everywhere. There is a lot more we can do! E-marketplaces. Open, automated B2B e-commerce. Business process integration on the Web. Resource sharing, distributed computing. Current approach is ad-hoc on top of existing standards. e.g., application-to-application interactions with HTML forms. Goal: enabling systematic application-to-application interaction on the Web. Web service 18

Web Service: definition A Web service is a software application identified by a URI, whose interfaces and binding (1) are capable of being defined, described and discovered by XML artefacts and supports direct interactions with other software applications using XML based messages via Internet-based protocols. (W3C definition) Web service (1) An association between an Interface, a concrete protocol and a data format 19

WS Benefits Web service Internet-wide standards Platform/Language independent Growing number of tools Ease of use (compared with CORBA) Support for legacy systems (wrap) Applies to loosely coupled architectures 20

Web Service framework 21

Web Services Framework Web service Service Registry Service Description Find Publish Service Requestor Bind Service Provider Service Service Description 22

Role of the Service Broker The broker is a conceptual unit May consist of several services May be distributed / decentralized Maintains a registry of services That's what UDDI was made for Broker services lookup via UDDI Routing, QoS, Dispatch Trust, Security, Monitoring Web service 23

Role of the Service Provider Provides a set of services Line of business functionality Infrastructure functionality Implements well-known contracts Messages and Conversations Exposes capabilities Context, Transactions, Keeps implementation details secret Web service 24

Role of the Service Consumer Connects and controls services User-driven interactions Workflow-driven interactions May be a service Aggregation Doesn't worry about implementation Only worries about contracts Messages Requested QoS Required Capabilities Web service 25

Web Services Framework Web service Framework can be described in terms of What goes on the wire? Formats and protocols: SOAP. What describes what goes on the wire? Description languages: WSDL. What allows us to find these descriptions? Discovery of services: UDDI. What allows us to build efficient applications? Composition of services: WSFL, BPML, BPEL4WS, XLANG, etc. 26

Web Services Framework XML Messaging Web service Simple Object Access Protocol (SOAP) - is an XML Messaging Protocol that allows software running on disparate operating systems and different environments to make Remote Procedure Calls (RPC) Web Services Description Web Service Description Language (WSDL) is a language that defines the interface of a Web service, required for interaction between a requester and a service provider Web Services Registry Universal Description, Discovery and Integration (UDDI) serves as a business and service registry essential for the widespread use of Web services Web Service Composition WSFL, XLANG, BPEL4WS, DAML-S are some of the XML languages that have been proposed for specifying a Web service composition 27

SOAP Simple Object Access Protocol 28

Presentation Overview What is SOAP? Components of SOAP SOAP Envelope SOAP Encoding Rules SOAP RPC Representation The SOAP Message Exchange Model Examples of SOAP Messages SOAP Security Limitations of SOAP Implications and Conclusions 29

What is SOAP? SOAP stands for Simple Object Access Protocol is a communication protocol specification for invoking methods on servers, services, components, and objects. combines HTTP with XML. is designed to communicate via Internet is platform independent. is language independent. can be used in a large variety of systems ranging from messaging systems to RPC. is simple and extensible. is a format for sending messages 30

Why SOAP? Important for application development to allow Internet communication. RPC calls are not easily adaptable to the Internet. Current RPC methods represent a security problem. SOAP is platform independent. SOAP is language independent. SOAP can be used in a large variety of systems ranging from messaging systems to RPC. SOAP is simple and extensible. SOAP is a format for sending messages. 31

Components of SOAP SOAP consists of three parts: The SOAP Envelope is a construct that defines an overall framework for expressing what is in a message, who should deal with it, and whether it is optional or mandatory. The SOAP Encoding Rules defines a serialization mechanism that can be used to exchange instances of application-defined datatypes. The SOAP RPC Representation defines a convention that can be used to represent remote procedure calls and responses. 32

The SOAP Envelope The Envelope is the top-level container representing the message. The Header is a generic mechanism for adding features to a SOAP message in a decentralized manner without prior agreement between the communicating parties. The Body is a container for mandatory information intended for the ultimate recipient of the message. SOAP Message HTTP Headers SOAP Envelope SOAP Header Headers SOAP Body Method Call & Data 33

The SOAP Encoding Rules Bases the type system is a generalization of the common features found in type systems in programming languages A type is either a simple (scalar) or is a compound type constructed as a composite of several parts, each with a type These types are defined using a XML Schema Encoding Object type + values + XML schema XML instance XML instance + XML schema Object type + values 34

The SOAP RPC Representation One of the design goals of SOAP is to be able to encapsulate and exchange RPC calls using XML. Use this representation along with the encoding mechanism previously described. SOAP relies on Protocol Binding to provide a mechanism for carrying a RPC. An RPC call maps naturally to an HTTP request and an RPC response maps to an HTTP response. Using SOAP for RPC is not limited to the HTTP protocol binding. 35

SOAP Message Exchange Model SOAP messages are fundamentally one-way transmission from a sender to a receiver. SOAP messages are often combined to implement patterns such as request/response. SOAP implementations can be optimized to exploit the unique characteristics of particular network systems (protocols). i.e. SOAP response messages to be delivered as HTTP responses when using HTTP binding. Messages are routed along a message path which allows for processing at one or more intermediate nodes in addition to the ultimate destination. 36

Message Processing A SOAP application receiving a SOAP message must process the message as follows: Identify all parts of the SOAP message intended for that application. Verify that all mandatory parts identified in step 1 are supported by the application for this message and process them accordingly. If the SOAP application is not the ultimate destination of the message then remove all parts identified in step 1 before forwarding the message. 37

SOAP Message Template <soap:envelope Envelop information goes here> <soap:header>... Header information goes here... </soap:header> <soap:body>... Body information goes here... <soap:fault>... Fault information goes here... </soap:fault> </soap:body> </soap:envelope> 38

The Envelope and Header Elements The envelope element Defines XML document as a SOAP message. <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"> </soap:envelope> The header element Contains user defined elements: language and currency. <soap:header> <m:local xmlns:m="http://www.computer.com/local/"> <m:language>fr</m:language> <m:currency>euro</m:currency> </m:local> </soap:header> 39

The body element Must be present in SOAP message. Contains actual message <soap:envelope> <soap:body> <m:sumrequest xmlns:m= urn:myfirstservice > <param1>25</param1> <param2>-25</param2> </m:sumrequest> </soap:body> </soap:envelope> 40

The body element Response <soap:envelope> <soap:body> <m:sumresponse xmlns:m= urn:myfirstservice > <return>0</return> </m:sumresponse> </soap:body> </soap:envelope> Fault (errors that occurred while processing message, Only appears in answers responses) <soap:envelope> <soap:body> <soap:fault> <faultstring>can t sum negative integers</faultstring> </soap:fault> </soap:body> </soap:envelope> 41

Implementations of SOAP Axis Apache Web Services Toolkit (IBM) JAXM (Sun) ZOAP (jboss.org) HP Web Services Platform Microsoft SOAP toolkit (VB, etc.).net Framework (Microsoft) Many others 42

Conclusion SOAP does not mandate an API of any kind. attempt to address the more complex distributed object protocol services such as object activation, marshaling objects/references, garbage collection, or bidirectional communications. prevent using any of the above services but they are simple implementation details that can be layered on top of the SOAP protocol (taking TIME). SOAP is inherently SIMPLE! simply defines how to access services, objects, and servers in a platform-independent manner using HTTP and XML. away allowing an increased level of interoperability. promoting further progress towards developers working together. 43

References http://www.develop.com/soap/soapfaq.htm http://msdn.microsoft.com/library/default.asp?url=/libr ary/en-us/dnsoapspec/html/soapspecindex.asp http://msdn.microsoft.com/library/default.asp?url=/libr ary/en-us/dnmag00/html/soap0300.asp http://www.w3.org/tr/soap/ http://www.microsoft.com/mind/0100/soap/soap.asp http://schemas.xmlsoap.org/soap/envelope http://schemas.xmlsoap.org/soap/encoding http://msdn.microsoft.com/library/default.asp?url=/libr ary/en-us/dnwebsrv/html/xmloverchap2.asp http://www.mybubble.com:8080/mybubbleentserver/m ybubblesoapservices.wsdl http://www.w3schools.com/soap/soap_intro.asp 44

WSDL Web Service Description Language 45

Web service description using WSDL [ref] WSDL Specification of Web services Web services 1 Web services 2 Operation Operation Port WSDL n 1 Operation Operation Port WSDL n 2 Binding WSDL Binding WSDL I/O messages (request/response) constitute a WSDL operation SOAP, HTTP, MINE HTTP/SOAP Request The binding define the concrete elements of the message SOAP, HTTP, MINE 1 service = 1 or several ports 1 port = 1 or several operations Port WSDL n 1 HTTP/SOAP Response Web services 1 HTTP/SOAP Request HTTP/SOAP Response Port WSDL n 2 Web services 2 Server 46

Introduction What is WSDL? stands for Web Service Description Language is an XML document for describing web services represents the behavior of a resource on the Web What can one knows from WSDL? What kind of message is exchanged? How are the message related? (e.q operation input or output) How SOAP messages are exchanged? 47

Structure of WSDL document Interface definition Type Messages Interfaces(Port Types)WSDL1.2 Endpoint Defintion Bindings Protocol html, smtp Encoding Service 48

Structure of WSDL document <definitions> <types>definition of types</types> <message>definition of message</message> <interface>definition of interface </interface> <binding>definition of biding</binding> <services>definition of endpoint </endpoint> </definitions> 49

The <types> element <types> <xsd:schema targetnamespace="urn:xml-soap-address-demo xmlns:xsd="http://www.w3.org/1999/xmlschema"> <xsd:complextype name="phone"> <xsd:element name="areacode" type="xsd:int"/> <xsd:element name="exchange" type="xsd:string"/> <xsd:element name="number" type="xsd:string"/> </xsd:complextype> <xsd:complextype name="address"> <xsd:element name="streetnum" type="xsd:int"/> <xsd:element name="streetname" type="xsd:string"/> <xsd:element name="city" type="xsd:string"/> <xsd:element name="state" type="xsd:string"/> <xsd:element name="zip" type="xsd:int"/> <xsd:element name="phonenumber type="typens:phone"/> </xsd:complextype> </xsd:schema> </types> 50

The <message> element <message name="addentryrequest"> <part name="name" type="xsd:string"/> <part name="address" type="typens:address"/> </message> <message name="getaddressfromnamerequest"> <part name="name" type="xsd:string"/> </message> <message name="getaddressfromnameresponse"> <part name="address" type="typens:address"/> </message> 51

The <porttype> element One-way the endpoint receive an (<input>) message Request-response the endpoint receive an (<input>) message and return the related <output> message or one or several <fault> messages Solicit-response Le point d entrée envoie un message (<output>) et recoit un message corrélé (<input>) ou un ou plusieurs messages de faute (<fault>). Notification the end point send a notification message (<output>) 52

The <porttype> element : example <porttype name="addressbook"> <! One way operation --> <operation name="addentry"> <input message="addentryrequest"/> </operation> <! Request-Response operation --> <operation name="getaddressfromname"> <input message="getaddressfromnamerequest"/> <output message="getaddressfromnameresponse"/> </operation> </porttype> 53

The <binding> element <binding name="addressbooksoapbinding" type="addressbook"> <soap:binding style="rpc transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="addentry"> <soap:operation soapaction=""/> <input> <soap:body use="encoded namespace="urn:addressfetcher2" encodingstyle="http://schemas.xmlsoap.org/soap/encoding/ /> </input> </operation> 54

The <binding> element <operation name="getaddressfromname"> <soap:operation soapaction=""/> <input> <soap:body use="encoded namespace="urn:addressfetcher2" encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded namespace="urn:addressfetcher2" encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> 55

Binding: SOAP and SMTP <definitions...> <types> <schema targetnamespace="http://stockquote.com/stockquote.xsd" xmlns="http://www.w3.org/2000/10/xmlschema"> <element name="subscribetoquotes"> <complextype><all><element name="tickersymbol" type="string"/></all></complextype></element> <element name="subscriptionheader" type="urireference"/> </schema> </types> <message name="subscribetoquotes"> <part name="body" element="xsd1:subscribetoquotes"/> <part name="subscribeheader" element="xsd1:subscriptionheader"/> </message> <porttype name="stockquoteporttype"> <operation name="subscribetoquotes"> <input message="tns:subscribetoquotes"/> </operation> </porttype> 56

The <binding> element <binding name="stockquotesoap" type="tns:stockquoteporttype"> <soap:binding style="document" transport="http://stockquote.com/smtp"/> <operation name="subscribetoquotes"> <input message="tns:subscribetoquotes"> <soap:body parts="body" use="literal"/> <soap:header message="tns:subscribetoquotes" part="subscribeheader" use="literal"/> </input> </operation> </binding> <service name="stockquoteservice"> <port name="stockquoteport" binding="tns:stockquotesoap"> <soap:address location="mailto:subscribe@stockquote.com"/> </port> </service> </definitions> 57

The <service> element <?xml version="1.0"?> <definitions name="urn:addressfetcher" targetnamespace="urn:addressfetcher2" xmlns:typens="urn:xml-soap-address-demo" xmlns:xsd="http://www.w3.org/1999/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- service decln --> <service name="addressbookservice"> <port name="addressbook binding="addressbooksoapbinding"> <soap:address location="http://www.mycomp.com/soap/servlet/rpcrouter"/> </port> </service> </definitions> 58

Using WSDL As extended IDL: WSDL allows tools to generate compatible client and server stubs. Tool support for top-down, bottom-up and meet in the middle development. Allows industries to define standardized service interfaces. Allows advertisement of service descriptions, enables dynamic discovery and binding of compatible services. Used in conjunction with UDDI registry Provides a normalized description of heterogeneous applications. 59

How to use WSDL? How to use Google API with WSDL? Google provide standard wsdl file http://api.google.com/googlesearch.wsdl How to use wsdl file? Many programming languages now understand WSDL and can use this file to automatically invoke Google's API. For example, the WSDL can be imported into.net, converted into Java code using Apache Axis WSDL2Java, or used directly by Perl SOAP::Lite. Axis WSDL2Java tool Generate java classes to connect to the service : ServiceLocator, Service, and mapping to the xml requests and responses of the WebServices using Axis WSDL2Java tool: java org.apache.axis.wsdl.wsdl2java http://api.google.com/googlesearch.wsdl 60

Example (1) : Google API Connect to the WebService GoogleSearchService searchservice = new GoogleSearchServiceLocator(); GoogleSearchPort searchport = searchservice.getgooglesearchport(); Invoke the service GoogleSearchResult searchresult = searchport.dogooglesearch( clientkey, // obtained from www.google.com/apis querystring, // keywords to search on startindex, // start index within result set 10, // maximum returned results true, "", false, "", "", " ); 61

Example (1) : Google API Use the result System.out.println("Google Search Results:"); ResultElement[] res = searchresult.getresultelements(); int lenght = Array.getLength(res); for(int i = 0; i< lenght ; i++){ ResultElement re = (ResultElement) Array.get(res,i); System.out.println("Resultat" +i); System.out.println("Title : " +re.gettitle()); System.out.println("URL : " +re.geturl()); System.out.println("Summary:" +re.getsummary()); System.out.println("Snippet:" +re.getsnippet()); System.out.println(""); } 62

Example (2) String endpoint="http://nagoya.apache.org:5049/axis/services/echo"; Service service = new Service(); Call call = (Call) service.createcall(); call.settargetendpointaddress( new java.net.url(endpoint) ); call.setoperationname(newqname("http://soapinterop.org/","echostring")); Call to addparameter/setreturntype as described in user-guide.html call.addparameter("testparam",org.apache.axis.constants.xsd_string, javax.xml.rpc.parametermode.in); call.setreturntype(org.apache.axis.constants.xsd_string); String ret = (String) call.invoke( new Object[] { "Hello!" } ); System.out.println("Sent 'Hello!', got '" + ret + "'"); 63

UDDI Universal Description, Discovery and Integration 64

Needs Need to make services available Which services are available? Classes, Taxonomies, Locality Regional, legal, trust boundaries Need to find services Static and dynamic Need to negotiate capabilities Security, Context, Transactions, Reliable Messaging Need to find ways to connect 65

UDDI roles UDDI plays three roles :White pages,yellow pages, Green pages White pages address, contact, and known identifiers Green pages Namespace to describe how to use the service, etc... Identifier of who published the service Unique identifier (tmodelkey) of this service for registration Yellow pages industrial categorisations Industry Product/Services Location UDDI services are Web services 66

UDDI Information Model Business Entity (Provider): Information about the entity who offers a service tmodel: Descriptions of specifications for services. 0 n BusinessService: Descriptive information about a particular family of technical offerings 1 n 0 n BindingTemplate: Technical information about a service entry point and construction specs Bindings contain references to tmodels. These references designate the interface specifications for a service. 67

Providers, Services And Bindings Providers Examples: Accounting Department, Corporate Application Server Name, Description, Contact Information Categorization and Identification Information Services Examples: Purchase Order services, Payroll services Name, Description(s) Categorization Information Bindings Description(s), access points, parameters Examples: Access Point (http://...) for Web Service 68

UDDI Implantation <import> <service> <port> <port> UDDI BusinessEntity BusinessService BusinessTemplate BusinessTemplate Interface tmodel <types> <messages> <porttype> <Binding> 69

Implantation UDDI UDDI <wsdl:definitions name="normadresseservice" targetnamespace="http:// "> <import namespace="http:// " location="http:// " /> <wsdl:service name="donormeservice"> <wsdl:port name="normadresseservice " binding="intf:normadresseservicesoapbinding"> </wsdl:service> </wsdl:definitions> <wsdl:definitions name="normadresseservice.interface" targetnamespace="http:// "> <wsdl:message name="getnormeresponse"> </wsdl:message> <wsdl:porttype name="donorme"> </wsdl:porttype> <wsdl:binding name="normadresseservicesoapbinding" type="intf:donorme"> </wsdl:binding> </wsdl wsdl:definitions> Interface <BusinessEntity businesskey=" " <name> Normalisation d'adresse </name> <businessservice servicekey=" "> <name> DoNormeService </name> <BindingTemplates bindingkey=" "> <TmodelInstanceInfo tmodelkey=" "> <overviewdoc> <overviewdocurl>http:// # NormAdresseService </overviewdocurl> </BindingTemplates> </businessservice> </BusinessEntity> <tmodel tmodelkey=" " <name> http:// </name> <overviewdoc> <overviewdocurl>http:// #NormAdresseServiceSo apbinding targetnamespace="http:// "> </overviewdocurl> <categorybag> <KeyedReference tmodemkey=" " keyname="uddiorg:types keyvalue="wsdlspec"/> </ categorybag > </tmodel> 70

UDDI : The vision Advanced Discovery via Portals and Marketplaces Marketplace Marketplace Marketplace UDDI Registries and Protocol Search Portal Search Portal Business Users Technical Users 71

Browser access: example How does one searches? We are searching Web Services of Amazon. 72

Browser access: example AmazonBusiness propose a Web Service This Web Service is called GetBookPrice 73

Publishing with UDDI4J Provider UDDI SOAP Request UDDI SOAP Response UDDI4J HTTP Server UDDI registry SOAP Server UDDI registry WSDL WebService 74

Using UDDI with UDDI4J Client UDDI SOAP Request UDDI SOAP Response UDDI4J HTTP Server UDDI registry SOAP Server UDDI registry Provider WSDL WebService 75

UDDI4J Inquiry API Find find_business find_service find_binding find_tmodel Find details get_businessdetail get_servicedetail get_bindingdetail get_tmodeldetail Publishers API save save_business save_service save_binding save_tmodel Delete delete_business delete_service delete_binding delete_tmodel Security get_authtoken discard_authtoken 76

Program access: UDDI4J // Construct a UDDIProxy object UDDIProxy proxy = new UDDIProxy(); try { // Select the desired UDDI server node proxy.setinquiryurl("inquiryurl"); proxy.setpublishurl("publishurl"); // Pass in userid and password registered at the UDDI site AuthToken token = proxy.get_authtoken("userid","password");... } catch (UDDIException e) {... 77

Program access: UDDI4J try { Vector entities = new Vector(); // Create a new business entity // BusinessKey must be "" to save a new business BusinessEntity be = new BusinessEntity("", BusinessName"); entities.addelement(be); // **** First Save a business BusinessDetail bd=proxy.save_business( token.getauthinfostring(),entities); } catch (UDDIException e) {... 78

Program access: UDDI4J //creating vector of Name Object Vector names = new Vector(); names.add(new Name(config.getProperty("businessName"))); // Setting FindQualifiers to 'exactnamematch' FindQualifiers findqualifiers = new FindQualifiers(); Vector qualifier = new Vector(); qualifier.add(new FindQualifier("exactNameMatch")); findqualifiers.setfindqualifiervector(qualifier); // Find business saved and setting the maximum rows to be returned as 5. BusinessList businesslist=proxy.find_business(names,null,null,null,null,findqualifiers,5); Vector businessinfovector = businesslist.getbusinessinfos().getbusinessinfovector(); for( int i = 0; i < businessinfovector.size(); i++ ){ BusinessInfo bi = (BusinessInfo)businessInfoVector.elementAt(i); System.out.println("Business Name : " + bi.getdefaultnamestring()); System.out.println("Business Key : " + bi.getbusinesskey()); } 79

Program access: UDDI4J // Having the business key, delete Business Entity using the authtoken DispositionReport dr = proxy.delete_business (token.getauthinfostring(), returnedbusinessentity. getbusinesskey()); if( dr.success() ){ System.out.println("Business successfully deleted"); }else{ System.out.println(" Error during deletion of Business\n"+ "\n operator:" + dr.getoperator() + "\n generic:" + dr.getgeneric() ); } 80

Web service examples Google (http://api.google.com/googlesearch.wsdl) Map Quest (http://ww6.borland.com/webservices/mapquest/mapquest.exe/wsdl/imapquest) Trivia Quiz (http://java.rus.uni-stuttgart.de/quiz/quiz.wsdl) Daily Dilbert (http://www.esynaps.com/webservices/dailydiblert.asmx?wsdl) Global Weather (http://live.capescience.com/wsdl/globalweather.wsdl) 81

References Herzum, Peter, Tutorial #20: Web Services and Service Oriented Architectures, OOPSLA 2002, Seattle, WA. Booch, G., Object oriented design with applications, Benjamin-Cummings Publishing Co., Inc., Redwood City, CA, 1990. Kreger, Heather., Web Services Conceptual Architecture (WSCA 1.0), IBM, May 2001, http://www- 3.ibm.com/software/solutions/webservices/pdf/WSCA.pdf. Mani, A. and Nagarajan A., Understanding quality of service for Web Services, IBM DeveloperWorks, January 2002, http://www-106.ibm.com/developerworks/webservices/library/wsquality.html?dwzone=webservices, current October 2002. Parnas, D., On the criteria to be used in decomposing systems into modules. Communications of the ACM, 15(12):1053-1058, December 1972. Reprint: http://www.acm.org/classics/may96/ Yourdon, E. and Constantine, L., Structured Design, Englewood Cliffs, N.J.: Prentice-Hall, 1975. Stevens, M., The Benefits of a Service-Oriented Architecture, Developer.com, http://softwaredev.earthweb.com/msnet/article/0,,10839_1041191,00.html, current October 2002. Szyperski C., Component Software - Beyond Object Oriented Programming, Addison-Wesley, 1998. Tarak, M., WSIL: Do we need another Web Services Specification?, Web Services Architect, January 2002, http://www.webservicesarchitect.com/content/articles/modi01.asp, current October 2002. W3C, W3C Process Document: 5 Technical Reports, http://www.w3.org/consortium/process- 20010719/tr.html, current October 2002. 82

References Bass, Clements, and Kazman, Software Architecture in Practice, Addison-Wesley 1997. Bieber, G., Carpenter, J., Introduction to Service-Oriented Programming (Rev 2.1), http://www.openwings.org/download/specs/serviceorientedintroduction.pdf, current October 2002. Fowler, M., UML Distiled: Applying the Standard Object Modeling Language, Addison-Wesley, 1997. Gamma E., Helm R., Johnson R., Vlissides, J., Design Patterns: Elements of Reusable Object- Oriented Software, Addison-Wesley, 1994. Garlan, D., Software Architecture: a Roadmap, ACM Press, 2000. Herzum, P., Web Services and Service-Oriented Architectures, Executive Report, Vol 4, No. 10, Cutter Distributed Enterprise Architecture Advisory Service, 2002. Meyer, B, Object Oriented Software Construction,Prentice-Hall, 1997, pp. 39-48. OMG, CORBA Basics, http://www.omg.org/gettingstarted/corbafaq.htm, current October 2002. Parnas, D., Clements, P, The Modular Structure of Complex Systems, IEEE, 1984. Stevens, M., Service-Oriented Architecture Introduction, Part 2, Developer.com, http://softwaredev.earthweb.com/msnet/article/0,,10527_1014371,00.html, current October 2002. Stevens, M., Multi-Grained Services, Developer.com, http://softwaredev.earthweb.com/java/sdjjavaee/article/0,,12396_1142661,00.html, current October 2002. Sun, Jini Technology Core Specification: LE-Distributed Leasing, http://wwws.sun.com/software/jini/specs/jini1.2html/lease-spec.html, current October 2002. Sun, Jini Technology Architectural Overview, http://wwws.sun.com/software/jini/whitepapers/architecture.html, 2001, current October 2002. Talking Blocks, Find Bind and Execute: Requirements for Web Service Lookup and Discovery, Whitepaper, January 8, 2001. 83

References Francisco Curbera, Web Services Overview, IBM T.J. Watson Research Center, http://www.llnl.gov/casc/workshops/components_2001/viewgraphs/franciscocurbera.pd Clemens Vasters, Service Oriented Architectures, newtelligence AG, www.newtelligence.com 84