Servicios web
Transcript of Servicios web
![Page 1: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/1.jpg)
Ferran MontesSergio Soria
1
![Page 2: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/2.jpg)
Contenido
1. ¿Que es un Servicio Web?
2. Representational State Transfer (REST)
3. Simple Object Access Protocol (SOAP)
2
![Page 3: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/3.jpg)
SERVICIO SERVICIO WEBWEB
3
![Page 4: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/4.jpg)
Servicio Web ¿Qué es un Servicio Web?Conjunto de aplicaciones o de tecnologías con
capacidad para interoperar en la Web
¿Para qué sirve?Comunicación entre aplicacionesInteroperabilidad y extensibilidad
Realización de operaciones complejas
4
![Page 5: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/5.jpg)
Servicio Web•¿Cómo funciona?
5
![Page 6: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/6.jpg)
Servicio Web•¿Cómo funciona?
Arquitecturas:
SOA (service-oriented architecture)
SOAPWSDL (Web Services
Description Language)
UDDI (Universal Description, Discovery and Integration)
RESTEmulación HTTP
6
![Page 7: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/7.jpg)
RESTRESTRepresentationaRepresentational State Transferl State Transfer
7
![Page 8: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/8.jpg)
REST
•¿Qué es REST realmente?Arquitectura de software para sistemas hipermedias
distribuidos tales como la Web
•¿Cuál es la motivación de REST?
Capturar las características de la Web que la han hecho tan exitosa
Emular al protocolo HTTP o protocolos similares
8
![Page 9: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/9.jpg)
REST•¿Cómo emulamos HTTP?
Recurso:http://www.ejemplo.com/lista
http://www.ejemplo.com/lista/recurso
HTTP:HTTP AcciónPUT Crear
GET Obtener
POST Actualizar
DELETE Eliminar
9
![Page 10: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/10.jpg)
•¿Cómo emulamos REST?
REST
Sin REST: Con REST:
10
![Page 11: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/11.jpg)
RESTRESTEjemploEjemplo
11
![Page 12: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/12.jpg)
SOAPSOAPSimple Object Simple Object
Access ProtocolAccess Protocol12
![Page 13: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/13.jpg)
SOAPArquitecturaProtocolo de transporte: sobretodo HTTP o SMTP
(petición – respuesta).
Mensaje XML: SOAP Envelope SOAP Header SOAP Body
14
![Page 14: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/14.jpg)
SOAPSOAP Envelope (obligatorio):Namespace (xmlns:soap namespace):
Define el mensaje XML como SOAP.encodingStyle (soap:encodingStyle="URI“):
Define el tipo de datos del mensaje. Puede encontrarse en cualquier parte del mensaje.Se aplica a todos los elementos del mensaje.
15
![Page 15: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/15.jpg)
SOAPSOAP Header (opcional):mustUnderstand (soap:mustUnderstand="0|1“):
Indica si el receptor ha de procesor o no el header.
Actor (soap:actor="URI" ):El valor en incluido en esta etiqueta solo está
disponible para la máquina definida en “URI”. Si no existe
16
![Page 16: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/16.jpg)
SOAPSOAP Body (obligatorio):Contiene el mensaje SOAP destinado a la máquina
final.Formado por los elementos hijo definidos por el
emisor mediante etiquetas.
17
![Page 17: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/17.jpg)
SOAPEjemplo
REQUEST
RESPONSE
18
![Page 18: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/18.jpg)
SOAPVentajas:Extensibilidad
Basado en XML.Neutralidad
Orientado a mensaje, puede utilizar varios protocolos de transporte (HTTP, SMTP, TCP, JMS).
Independencia Plataforma. Lenguaje de programación (Java, .NET, Flex).
19
![Page 19: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/19.jpg)
SOAPDeventajas:XML puede ralentizar el procesado, mala opción en
mensajes grandes.
Mensaje incluido en el cuerpo de HTTP, se requiere mayor análisis desde el firewall.
Poco soporte en Python y PHP.
20
![Page 20: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/20.jpg)
Enlaces de interés
http://www.vogella.com/articles/REST/article.html
http://en.w3schools.com/soap
http://en.wikipedia.org/wiki/SOAP
21
![Page 21: Servicios web](https://reader035.fdocuments.net/reader035/viewer/2022062823/5877b32c1a28ab2c668b5301/html5/thumbnails/21.jpg)
GraciasGracias
22