web servicesrrossel/papers/ws.pdfseguridad acercamiento construccion web services jws tcpmonitor...
TRANSCRIPT
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Web Services
Richard [email protected]
23 de noviembre de 2004
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
TOC
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Definicion
I Aplicaciones Autocontenidas y Modulares
I Basado en estandares (XML,HTTP)
I Aplicaciones se anuncian por la red
I Son los bloques de construccion para sistemasdistribuidos abiertos.
I Ensamblaje 6= Desarrollo
Figura: Componentes
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Definicion
I Compuestas con otros servicios WEB
I Web Services predominantemente B2BI Ejemplos,
I Cotizacion de StockI Mapas de rutasI Bolsa de ValoresI Autenticacion
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Ejemplo
I Un Web Service puede usar varios Web Service, porejemplo, sistema de turismo.
Figura: Aplicacion para el Turismo
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Modelo
I Interaccion entre 3 roles:I Proveedor de ServicioI Servicio de RegistroI Cliente
I Operaciones implican:I PublicacionI BusquedaI Ligamiento, conexion
I Artefactos:I Web Service Software moduleI Descripcion
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Modelo
Figura: Modelo Web Service
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Roles
Proveedor de Servicio Dueno del servicio, Plataforma a lacual los host acceden a los servicios
Servicio de Registro Deposito de descripciones deservicios. Proveedores publican servicios yclientes buscan servicios junto a sudescripcion
Cliente Cliente que requiere cierto servicio,Aplicacion que invoca un servicio.
I Un browser manejado por una personaI Aplicacion sin una interfaz de usuario
(otro webservice)
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Operaciones
Publicacion Proveedores publican su servicio a uno omas registros de servicios (o cancelan)
Busqueda Clientes usan uno o mas registros paradescubrir los servicios
Ligamiento Clientes negocian con proveedores para usarlos servicios
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Artefactos
Servicio Modulo de software la cual es accedido atraves de una red y ofrecida por unproveedor de servicios
Descripcion Detalles de la interfaz e implementacion delservicio. Publicados al servidor de registro oal cliente.
I Tipos de DatosI OperacionesI informacion de LigamientoI Ubicacion de servicio (URL)I Puede incluir meta-datos para facilitar
descubrimiento y uso
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Workflow
1. Descritas mediante un lenguaje
2. Se publican en algun registro
3. Clientes buscan servicios en registros
4. Una vez encontrada se liga
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Workflow
Figura: Workflow Web Service (Modelo UDDI/SOAP)
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Servicios y Protocolos
WSDL Web Service Description Language, describeel servicio, ubicacion, funciones, y comoacceder a esta.
UDDI Universal Description Discovery andIntegration, define una forma de publicar ydescubrir informacion de servicios Web
SOAP Simple Object Access Protocol, protocolopara iniciar las conversaciones con unservicio UDDI.
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
WSDL
I Documento XML que contiene informacion acercade la interfaz, semantica, y administracion
I Estandarizado por la W3C
I WSDL define solo un servicio (generalmente)I La descripcion del servicio se divide en dos:
I Implementacion del ServicioI Interfaz del Servicio
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
WSDL
I Implementacion del Servicio:
Service Servicio que se ofrecePort donde se ubica el servicio
I Interfaz del Servicio
Binding , Protocolo de comunicacionPortType que operaciones provee servicioMessage define entrada y salida de parametros
de una operacionType Tipo de dato usado por el servicio
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
WSDL
Figura: Descripcion de un servicio basico
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Estructura WSDL
Figura: Estructura WSDL
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Ejemplo WSDL
Figura: Ejemplo WSDL
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Tipos de Operaciones
One way Operacion solo recibe mensaje
Request Response Operacion puede recibir y enviar
Solicit Response Enviar solicitud y esperar respuesta
Notification Enviar mensaje pero no espera
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Ejemplo One Way
Figura: Ejemplo One Way
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
UDDI
I Universal Description, Discovery and Integration
I Permite registrar y publicar servicios WEB
I Tres secciones:
Blanca Informacion del proveedor de servicioAmarilla Servicios clasificados por especialidad,
ubicacion, etc.Verde Informacion tecnica
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
SOAP
I Protocolo para iniciar las conversaciones con unservicio UDDI.
I Crea un bloque XML con datos necesarios paraacceder al servicio
I Consta de dos partes (o cuatro):
Envoltura que hay en el mensaje y quien debe deatenderlo
header Informacion del header (opcional)body Informacion de llamadas y respuestasFault Informacion acerca de los errores
ocurridos durante el procesamiento(opcional)
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Estructura SOAP
Figura: Estructura SOAP
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Ejemplo Peticion SOAP
Figura: Ejemplo SOAP - Peticion
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Ejemplo Respuesta SOAP
Figura: Ejemplo SOAP - Respuesta
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Seguridad
I SSL, provee sistema de encriptamiento de datosentre cliente/servidor.
I Provee ademas autenticacion de una y dos vıas.
I Pero SSL no es suficiente
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Seguridad
I SSL falla en tradicionales formas de ataques, porejemplo Buffer Overflow
I Ejemplode la vulnerabilidad de SOAP::Lite, la cual ejecutabanHTTP::DAEMON::ClientConn::send file(“/etc/passwd”)
I Se debe validar el contenido de los mensajes
I Tecnologıa Seguridad XML provee de seguridad alWeb Service, que no provee SSL
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
XML Security
XML Schema Asegura la estructura del mensaje, paraevitar el envıo de datos maliciosos
XML Signature Genera una firma digital para evitar queel mensaje sea modificado por terceros
XKMS (XML Key Management Specification) esun servicio web que da acceso a usuariosregistrados mediante sistemas de llaves.
SAML Permite a los proveedores de Web Servicesautorizar u autenticar usuarios que no estanregistrados
Para mas informacion ver paper “Is SSLenough security for first-generation WebServices?”,http://www.webservices.org
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Una Acercamiento a WS
Escenario I Motor de busqueda de Memorias parael DI UTFSM
I Lenguaje Java para desarrollar laaplicacion
I La aplicacion es explotada comoServicio Web
El ciclo de vida del software es desarrollado,explotado y admnistrado completamemtepor herramientas Open Source.
Figura: Ciclo de Vida de un WS
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Herramientas
I FC Linux
I Servidor de Aplicaciones Apache Tomcat
I Motor SOAP (Toolkit) Apache Axis
I J2SDK
I Browser Konqueror
Figura: Contenedor Web Services
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Apache Axis
I Es una coleccion de paquetes jar
I Se instala como una aplicacion en Tomcat (webapps)
I La version actual esta escrita en Java
I Implementacion en C++ esta en desarrollo
I Tambien nos da soporte para WSDL
I Una herramienta para monitorear trafico TCP/IP
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Deployment
I Existen dos maneras de hacer un deploy a un WebService.
I Vıa JWSI Vıa WSDD
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
JWS
I Java Web Service (JWS) es solo un archivo javapero con extension jws
I Axis encuentra el *.jws, lo compila automaticamente
I Luego publica los metodos de la clase como unwebservice
I Ventaja:I Es la forma mas rapida de crear un webserviceI Simple para crearI Simple para hacer el deploy y accederlo
I Desventajas:I Se requiere del conocimiento de las fuentes de la
claseI No soporta autenticacion o control de accesoI No hay transparencia remotaI Dificil para publicar
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Ejemplo JWS
I Dos programas
Aplicacion Paper.jwsCliente PaperClient.java
I JWS no permite usar empaquetamiento
I Probar con TCPmonitor
I Class en $TOMCAT HOME/webapp/axis/WEB-INF/jwsClasses
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
TCPmonitor
I Permite chequear los mensajes SOAPI Trabaja como un proxy
I Cliente llama al monitor con una peticion SOAPI Monitor despliega la paticion SOAP y lo envia al
servidor localI SOAP despliega la respuesta y la reenvia al cliente
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
WSDD
I Web Service Description Deployment
I Formato XML
I Especificacion de Axis, no de W3C/WS Estandar
I Se compila “a mano” las fuentes y se llama aAdminClient
I AdminClient realiza el deploy de acuerdo al *.wsdd
I De la misma manera se realiza en undeploy
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Deploy
Figura: Deploy Service
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Undeploy
Figura: Undeploy Service
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Deployment usando WSDD
Ventajas I Construiccion y deploy sigue siendosimple
I Permite la definicion del nombre delservicio
I Permite la definicion de laimplementacion de la clase(Session—Request—Application)
Desventajas I No existe transparencia Remota (Stubsy Skeletons)
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Transparencia Remota WSDL
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Generando WSDL: JAVA2WSDL
I Herramienta proporcionada por Axis
I Crea la descripcion de la interfaz del WS desde .java
I Es decir genera WSDL desde .java
I Ver ejemplo
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Resumen
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Conclusiones WS
Ventajas I Facil, rapido y barato de implementarI Extensible e Independiente del
LenguajeI Transparente para el usuario finalI SeguroI Basado en estandaresI Alto grado de reusabilidadI Puede ser implementado con
herramientas Open SourceI Grandes empresas lo apoyan Microsoft,
Sun, Oracle, IBM, Apache
Desventajas I No es la solucion a todos los problemasI Relativamente nuevo, algunos
estandares no definidosI Dependencia de la disponibilidad de
servidores y comunicaciones
Web Services
Outline
Definicion Web Services
Modelo
Workflow
Servicios y ProtocolosWSDLUDDISOAP
Seguridad
Acercamiento
Construccion Web ServicesJWSTCPmonitorWSDDJAVA2WSDL
Conclusiones
Lo que no se vio
I LAMENTABLEMENTE LA APLICACION :(
I Una portal de webservices
I Servidor UDI de aplicaciones
I Utilizacion de XML Security
I Comparacion entre herramientas Open Source v/sComerciales
I Comparacion entre distintos lenguajes