WEB SERVICES WEB SERVICES



Similar documents
Manejo Basico del Servidor de Aplicaciones WebSphere Application Server 6.0

Schema XML_PGE.xsd. element GrupoInformes. attribute XML_PGE.xsd unqualified qualified

Propiedades del esquema del Documento XML de envío:

Network Communication

DIPLOMADO DE JAVA - OCA

LINIO COLOMBIA. Starting-Up & Leading E-Commerce. Luca Ranaldi, CEO. Pedro Freire, VP Marketing and Business Development

Cambridge IGCSE.

Práctica 1: PL 1a: Entorno de programación MathWorks: Simulink

RPC over XML. Web services with Java. How to install it? Reference implementation. Setting the environment variables. Preparing the system

Curso SQL Server 2008 for Developers

ECCAIRS 5 Instalación

1. DESCRIPCIÓN DE WEB SERVICES DE INTERCAMBIO DE DATOS CON NOTARIOS

Load Testing SOAs which Utilize Web Services

Address Phone & Fax Internet

Bucle for_in. Sintaxis: Bucles for_in con listas. def assessment(grade_list): """ Computes the average of a list of grades

Module 13 Implementing Java EE Web Services with JAX-WS

Ficha técnica de curso Código: IFCAD111

Ranking de Universidades de Grupo of Eight (Go8)

Por qué ExecuTrain? Por qué ExecuTrain? Modalidad de servicio

Dictionary (catálogo)

Spanish Grammar II. Tierra Encantada Charter School. Contact Number: (505)

New Server Installation. Revisión: 13/10/2014

Sales Management Main Features

Interfaces de voz avanzadas con VoiceXML

Sympa, un gestor de listas de distribución para las universidades

How To Know If An Ipod Is Compatible With An Ipo Or Ipo (Sanyo)

Brekeke PBX Web Service

COMPUTACIÓN ORIENTADA A SERVICIOS (PRÁCTICA) Dr. Mauricio Arroqui EXA-UNICEN

FORMACIÓN E-LEARNING DE MICROSOFT

ICT education and motivating elderly people

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

LOS ANGELES UNIFIED SCHOOL DISTRICT REFERENCE GUIDE

learning science through inquiry in primary classroom Overview of workshop

Resumen de Entrevista: Asociación de Agentes de Aduana del Puerto de Manzanillo

BALANCE DUE 10/25/2007 $ STATEMENT DATE BALANCE DUE $ PLEASE DETACH AND RETURN TOP PORTION WITH YOUR PAYMENT

AP SPANISH LANGUAGE 2011 PRESENTATIONAL WRITING SCORING GUIDELINES

BDL4681XU BDL4675XU. Video Wall Installation Guide

Curso SQL Server 2012 para Desarrolladores

LEARNING MASTERS. Explore the Northeast

How To Teach A Security Manager

UNIVERSIDAD FRANCISCO DE PAULA SANTANDER DOMINIOS DE COLISION, SEGMENTACION Y VLAN. Academia Local. Ing. José Martín Calixto Cely

FTPS - FTPSE. Objetivo:

HPN Product Tools. Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Fundamentos de Voz sobre el protocolo IP (VoIP)

CONCEPTS OF INDUSTRIAL AUTOMATION. By: Juan Carlos Mena Adolfo Ortiz Rosas Juan Camilo Acosta

PROCEDIMIENTOPARALAGENERACIÓNDEMODELOS3DPARAMÉTRICOSA PARTIRDEMALLASOBTENIDASPORRELEVAMIENTOCONLÁSERESCÁNER

Verbos modales. In this class we look at modal verbs, which can be a tricky feature of English grammar.

TEACHER GUIDE STRATEGIES ACHIEVE READING SUCCESS. CURRICULUM ASSOCIATES, Inc. STARS SERIES E SPANISH EDITION

Creating Web Services in NetBeans

DIPLOMADO EN BASE DE DATOS

SOLICITUD DE DEVOLUCIÓN, REALIZADA POR UN CONTRIBUYENTE, DE RETENCIONES SOBRE DIVIDENDOS OBTENIDOS A PARTIR DE 1 DE ENERO DE 2011.

JAVA API FOR XML WEB SERVICES (JAX-WS)

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

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

Problem 1 (1.5 points)

Memorial Health Care System Catholic Health Initiatives Financial Assistance Application Form

SUBCHAPTER A. AUTOMOBILE INSURANCE DIVISION 3. MISCELLANEOUS INTERPRETATIONS 28 TAC 5.204

Entry to Year 7 - Information for Parents

Web Services and their support in Java

ICAO State Safety Programme (SSP) Introduction

Level 2 Spanish, 2012

Avocados Australia, PO Box 8005 Woolloongabba Queensland 4102 Australia

Apéndice C: Código Fuente del Programa DBConnection.java

AV-002: Professional Web Component Development with Java

INTERFACE TECHNICAL MANUAL FOR ELECTRONIC TAX INFORMATION EXCHANGE (E-TIE) FOR TAX YEAR 2009

When the transport layer tries to establish a connection with the server, it is blocked by the firewall. When this happens, the RMI transport layer

Tema 7 GOING TO. Subject+ to be + ( going to ) + (verb) + (object )+ ( place ) + ( time ) Pronoun

New words to remember

Curso académico 2015/2016 INFORMACIÓN GENERAL ESTRUCTURA Y CONTENIDOS HABILIDADES: INGLÉS

50399AE Diseño de soluciones Business Intelligence con Microsoft SQL Server 2008

BtoB MKT Trends. El Escenario Online. Luciana Sario. Gerente de Marketing IDC Latin America 2009 IDC W W W. I D C. C O M / G M S 1

Chapter 12 Intellectual Development from One One to Three to Three

Web Services in Eclipse. Sistemi Informativi Aziendali A.A. 2012/2013

DIFFERENTIATIONS OF OBJECTS IN DIFFUSE DATABASES DIFERENCIACIONES DE OBJETOS EN BASES DE DATOS DIFUSAS

Información On Demand Podemos predecir lo que sucederá?

Remote Method Invocation

Middleware and the Internet

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

INFORMATIONAL NOTICE

Monitoreo de Bases de Datos

Tema: Encriptación por Transposición

SLA para aplicaciones en redes WAN. Alvaro Cayo Urrutia

DESIGNING A DESCRIPTOR BASED SYLLABUS PROPOSAL

Entrenamiento a Embajadores Ambassador training

AP SPANISH LITERATURE 2009 SCORING GUIDELINES

Global Art: A Sense of Caring Nos Preocupamos por los Demas

Curso OBJECT-ORIENTED PROGRAMMING IN VISUAL BASIC. (Visual Studio 2008)

Transcription:

From Chapter 19 of Distributed Systems Concepts and Design,4 th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison Wesley/Pearson Education June 2005 1 Topics Introduccion Web Services 2 Introduction Los servicios web son una manera de interacción entre C/S mas general que invocación de programas invocadas por el browser. Los clientes acceden al servicio con el mecanismo de pregunta/respuesta (request/response) donde estas están formateadas como XML y habitualmente transferidas utilizando HTTP. 3 1

Introduction Sirven para acceder servicios que se encuentran en servidores ajenos y por eso deberían de estar seguros. Transport Layer Security TLS no proporciona la seguridad adecuada. XML security sirve mas. B2B services. 4 Introduction Figure 1. Web services infrastructure and components 5 Introduction Marshalling de los mensajes en XML. Se identifica como URI (extension de URL) Se utiliza de modo habitual. SOAP se puede utilizar con HTTP/SMTP etc. La descripcion de servicio proporciona la definicion de la interfaz. Web Service Description Language (WSDL). 6 2

Web Services Una interfaz de SW consiste de un conjunto de operaciones que el cliente puede utilizar vía Internet. Pueden estar proporcionados de diferentes formas (programas, objetos remotos, bases de datos). Se puede manejar en paginas WEB o puede estar totalmente separado de paginas WEB. 7 Web Services Ejemplos: ebay. Amazon, Yahoo, Google. Amazon.com info de productos, compras. 8 Web Services Combinacion de SW. 9 3

Web Services Objetivo principal hacer acceso mas fácil al servicio. Nivel mas bajo R/Wen SOAP, utilizando XML. 10 SOAP permite en una arquitectura C/S al C y al S una interacción asíncrona (pero también síncrona y de eventos). Esta definida como subnorma de XML (esquema) para representar el los mensajes contenido de pregunta/respuesta. Inicialmente SOAP esta basado a HTTP, pero se puede utilizar con varios TP: SMTP, TCP o UDP. Coupling loose/no tanto. 11 SOAP is an XML based protocol for accessing Web Services. SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending messages SOAP communicates via Internet 4

SOAP is platform independent SOAP is language independent SOAP is based on XML SOAP is simple and extensible SOAP allows you to get around firewalls SOAP is a W3C recommendation SOAP especifica: Como XML se utiliza en de representar contenido de mensajes individuales. Como combinan la pregunta (request) y la respuesta (reply). Como el recipiente tiene que interpretar los elementos de XML. Como utilizar HTTP y SMTP para comunicar msg. de SOAP. 15 5

Mensaje del sobre de SOAP 16 Headers establece el contexto, pero también log y audit. El cuerpo (body) esta especifico para cada servicio WEB. Definición formal en SOAP XML namespace. 17 <SOAP-ENV:Envelope xmlns:soap- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/xmlschema-instance" xmlns:xsd="http://www.w3.org/1999/xmlschema"> <SOAP-ENV:Body> <ns1:dogooglesearch xmlns:ns1="urn:googlesearch" SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <key xsi:type="xsd:string">00000000000000000000000000000000</key> <q xsi:type="xsd:string">lo que vamos a buscar google lo sabra</q> <start xsi:type="xsd:int">0</start> <maxresults xsi:type="xsd:int">10</maxresults> <filter xsi:type="xsd:boolean">true</filter> <restrict xsi:type="xsd:string"></restrict> <safesearch xsi:type="xsd:boolean">false</safesearch> <lr xsi:type="xsd:string"></lr> <ie xsi:type="xsd:string">latin1</ie> <oe xsi:type="xsd:string">latin1</oe> </ns1:dogooglesearch> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 6

Ejemplo de request 19 <?xml version='1.0' encoding='utf-8'?> <SOAP-ENV:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/xmlschema-instance" xmlns:xsd="http://www.w3.org/1999/xmlschema"> <SOAP-ENV:Body> <ns1:dogooglesearchresponse xmlns:ns1="urn:googlesearch" SOAPENV: encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"> <return xsi:type="ns1:googlesearchresult"> <documentfiltering xsi:type="xsd:boolean">false</documentfiltering> <estimatedtotalresultscount xsi:type="xsd:int">3</estimatedtotalresultscount> <directorycategories xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:array" ns2:arraytype="ns1:directorycategory[0]"></directorycategories> <searchtime xsi:type="xsd:double">0.194871</searchtime> <resultelements xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:array" ns3:arraytype="ns1:resultelement[3]"> <item xsi:type="ns1:resultelement"> <cachedsize xsi:type="xsd:string">12k</cachedsize> <hostname xsi:type="xsd:string"></hostname> <snippet xsi:type="xsd:string"> <b>...</b> on a simple dialog (via <b>teletype</b>) with... vintage 1970, and to <b>...</b></snippet> <directorycategory xsi:type="ns1:directorycategory"> <specialencoding xsi:type="xsd:string"></specialencoding> <fullviewablename xsi:type="xsd:string"></fullviewablename> </directorycategory>... Ejemplo reply 21 7

A transport protocol is required to send a SOAP message to its destination. SOAP messages are independent of the type of transport used- their envelopes contain no reference to the destination address. 22 Figure 6 illustrates how the HTTP POST method is used to transmit a SOAP message. 23 Figure 6. Use of HTTP POST Request in SOAP client-server communication 24 8

The HTTP headers and body are used as follows: The HTTP headers specify the endpoint address (the URI of the ultimate receiver) and the action to be carried out. The HTTP body carries the SOAP message. As HTTP is a synchronous protocol, it is used to return a reply containing the SOAP reply, as shown in Figure 5. 25 END (Java language) 27 9

Figure 7 shows a web service interface. 28 package ShapeListService; import java.rmi.*; public interface ShapeList extends Remote { int newshape(graphicalobject g) throws RemoteException; int numberofshapes()throws RemoteException; int getversion() throws RemoteException; int getgoversion(int i)throws RemoteException; GraphicalObject getallstate(int i) throws RemoteException; Figure 7. Java web service interface ShapeList 29 The Java interface of a web service must conform to the following rules, some of which are illustrated in Figure 7: It must extend the Remote interface. It must not have constant declarations, such as public final static. The methods must throw the java.rmi.remoteexception or one of its subclasses. Method parameters and return types must be permitted JAX-RPC types. 30 10

The class that implements the interface ShapeList is shown in Figure 8. 31 package ShapeListService; import java.util.vector; public class ShapeListImpl implements ShapeList{ private Vector thelist = new Vector(); private int version = 0; private Vector theversions = new Vector(); public ShapeListImpl(){ version = 0; theversions = new Vector(); public int newshape(graphicalobject g) { version++; thelist.addelement(g); theversions.addelement(new Integer(version)); return thelist.size(); public int numberofshapes(){ return thelist.size(); public int getversion() { return version; public int getgoversion(int i){ return ((Integer) theversions.elementat(i)).intvalue(); public GraphicalObject getallstate(int i) { return (GraphicalObject)theList.elementAt(i); Figure 8. Java implementation of the ShapeListserver 32 There is no main method, and the implementation of the ShapeList interface does not have a constructor. In effect, a web service is a single object that offers a set of procedures. 33 11

Figure 9 shows the ShapeList client main a call through a proxy. 34 package staticstub; import javax.xml.rpc.stub; public class ShapeListClient{ public static void main(string args[]){ try{ Stub stub = createproxy(); stub._setproperty (javax.xml.rpc.stub.endpoint_address_property, args[0]); ashapelist = (ShapeList) stub; System.out.println("Got stub"); int n = ashapelist.numberofshapes(); System.out.println("Number of shapes=" + n); int v = ashapelist.getversion(); System.out.println("Version=" + v); Vector slist = new Vector(n); for(int i=0; i<n; i++){ System.out.println("shape no =" + i); GraphicalObject g = ashapelist.getallstate(i); System.out.println("Got shape " + i); int vers = ashapelist.getgoversion(i); slist.addelement(g); System.out.println("Version number " + vers); g.print(); 35 GraphicalObject g = new GraphicalObject(shapeType,30, 40, 3300, 5500, true); System.out.println("Created graphical object"); int listlength = ashapelist.newshape(g); System.out.println("Stored shape " + shapetype); catch(exception e) {System.out.println("allShapes: " + e.getmessage()); private static Stub createproxy() { return (Stub) (new MyShapeListService_Impl().getShapeListPort()); Figure 9. Java implementation of the ShapeListclient 36 12