graphic with four colored squares

Introducción a los Servicios Web

Jose Emilio Labra Gayo

Octubre 2006

Contenidos

Introducción a los Servicios WebJose Emilio Labra GayoOctubre 2006

Servicios Web

Servicios Web

Objetivos

Principales acciones

Estándares de servicios Web

Estándares de servicios Web

SOAP

SOAP

SOAP

Estructura vocabulario SOAP

Ejemplo SOAP

<soap:Envelope 
 xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
 xmlns:p ="http://www.mafia.it/pizzas">
<soap:Header>
     <p:priority> urgente </p:priority>
     <p:origin>pepe@oviedo.es</p:origin>
 </soap:Header>
<soap:Body>
    <p:order>
     <p:pizza nombre="Margarita">
      <p:size>familiar</p:size>
      <p:comment>con mucho queso
      </p:comment>
     </p:pizza>
   </p:order>
 </soap:Body>
</soap:Envelope>
 

Formato SOAP

WSDL

WSDL

Estructura de WSDL

Ejemplo WSDL (1/3)


<?xml version="1.0"?>
<definitions name="Pizzas"
   targetNamespace="http://mafia.it/pizzas.wsdl"
   xmlns:tns="http://mafia.it/pizzas.wsdl"
   xmlns:xsd1="http://mafia.it/pizzas.xsd"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns="http://schemas.xmlsoap.org/wsdl/">

  <types>
    <schema targetNamespace="http://mafia.it/pizzas.xsd"
            xmlns="http://www.w3.org/2000/10/XMLSchema">
      <element name="PrecioPizzaRequest">
        <complexType>
          <all>
            <element name="nombrePizza" type="string"/>
          </all>
        </complexType>
      </element>
      <element name="PrecioPizza">
         <complexType>
           <all>
             <element name="price" type="float"/>
           </all>
         </complexType>
      </element>
    </schema>
  </types>

 

Ejemplo WSDL (2/3)


  <message name="precioPizzaInput">
    <part name="body" element="xsd1:PrecioPizzaRequest"/>
  </message>

  <message name="precioPizzaOutput">
    <part name="body" element="xsd1:precioPizza"/>
  </message>

  <portType name="PizzasPortType">
    <operation name="verPrecio">
      <input message="tns:precioPizzaInput"/>
      <output message="tns:precioPizzaOutput"/>
    </operation>
  </portType>

Ejemplo WSDL (3/3)

<binding name="PizzasSoapBinding" 
  type="tns:PizzasPortType">
    <soap:binding style="document" 
         transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="precioPizza">
      <soap:operation soapAction="http://mafia.it/Pizzas"/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>

  <service name="PizzasService">
    <documentation>Ejemplo de servicio</documentation>
    <port name="PizzasPort" 
          binding="tns:PizzasSoapBinding">
      <soap:address location="http://mafia.it/Pizzas"/>
    </port>
  </service>

</definitions>

UDDI

UDDI

Funcionamiento de UDDI

Arquitecturas Orientadas a Servicios

Estilos de arquitecturas

Modelo REST

Principios de diseño REST

Ventajas de REST

Retos para los servicios Web

Contenidos