Академический Документы
Профессиональный Документы
Культура Документы
SOAP v1.1
v1.1
Protocolo
Protocolo Simple
Simple de
de Acceso
Acceso aa Objetos
Objetos
Prof.
Prof. Cosimo
Cosimo Stufano
Stufano
INTRODUCCIÓN
1
BREVE RESEÑA
A principios de 1999:
Un grupo de investigadores e ingenieros de Microsoft Corporation,
DevelopMentor y UserLand Software comenzaron el desarrollo del
Protocolo Simple de Acceso a Objetos (SOAP, Simple Object
Access Protocol)
A finales de 1999:
Fue sometido a consideración un borrador de la especificación de
SOAP version 1.0 ante la Internet Engineering Task Force (IETF)
Se incorporan al grupo de desarrollo representantes de las
empresas IBM y Lotus Development Corporation
¿QUÉ
¿QUÉ ES
ES SOAP?
SOAP?
2
¿QUÉ
¿QUÉ ES
ES SOAP?
SOAP?
SOAP XML
HTTP/SMTP
TCP/IP
¿QUÉ
¿QUÉ ES
ES SOAP?
SOAP?
3
CONSIDERACIONES DE DISEÑO
4
MODELO DE INTERCAMBIO DE MENSAJES
5
COMPONENTES DE UN MENSAJE SOAP
<SOAP-ENV:Envelope
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<SOAP-ENV:Header>
<SOAP-ENV:Header>
<t:Transaction
Envoltorio
Envoltorio SOAP
<t:Transaction
xmlns:t="some-URI"
xmlns:t="some-URI" SOAP-ENV:mustUnderstand="1">
SOAP-ENV:mustUnderstand="1">
55 Encabezado SOAP
</t:Transaction>
</t:Transaction>
</SOAP-ENV:Header>
</SOAP-ENV:Header>
SOAP
<SOAP-ENV:Body>
<SOAP-ENV:Body>
<m:GetLastTradePrice
<m:GetLastTradePrice xmlns:m="Some-URI">
xmlns:m="Some-URI">
<symbol>DEF</symbol>
<symbol>DEF</symbol> Cuerpo del Mensaje SOAP
</m:GetLastTradePrice>
</m:GetLastTradePrice>
</SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</SOAP-ENV:Envelope>
6
COMPONENTES DE UN MENSAJE SOAP
RESPUESTA EXITOSA
HTTP/1.1
HTTP/1.1 200
200 OK
OK
Content-Type:
Content-Type: text/xml;
text/xml; charset="utf-8"
charset="utf-8" Encabezado
Encabezado HTTP
HTTP
Content-Length:
Content-Length: nnnn
nnnn
<SOAP-ENV:Envelope
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
Envoltorio
Envoltorio SOAP
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<SOAP-ENV:Body>
<SOAP-ENV:Body>
<m:GetLastTradePriceResponse
<m:GetLastTradePriceResponse xmlns:m="Some-URI">
<Price>43.6</Price>
xmlns:m="Some-URI"> Cuerpo del Mensaje
<Price>43.6</Price>
</m:GetLastTradePrice>
</m:GetLastTradePrice>
SOAP
SOAP
</SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</SOAP-ENV:Envelope>
HTTP/1.1
HTTP/1.1 200
200 OK
OK
Content-Type:
Content-Type: text/xml;
text/xml; charset="utf-8"
charset="utf-8" Encabezado
Encabezado HTTP
HTTP
Content-Length:
Content-Length: nnnn
nnnn
<SOAP-ENV:Envelope
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<SOAP-ENV:Body>
Envoltorio
<SOAP-ENV:Body>
Envoltorio SOAP
<SOAP-ENV:Fault>
<SOAP-ENV:Fault>
<faultcode>
<faultcode>
Client.Authentication
Client.Authentication
</faultcode>
</faultcode>
<faultstring>
<faultstring>
Cuerpo del Mensaje
SOAP
Authentication
Authentication Error.
Error. SOAP
</faultstring>
</faultstring>
<faultactor>”Some-URI”</faultactor>
<faultactor>”Some-URI”</faultactor>
<detail>Some
<detail>Some details</detail>
details</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</SOAP-ENV:Envelope>
7
ESTILO DE CODIFICACIÓN
8
EJEMPLOS DE TIPOS DE DATOS SIMPLES
Esquema:
<element
<element name="age"
name="age" type="int"/>
type="int"/>
<element
<element name="height"
name="height" type="float"/>
type="float"/>
<element
<element name="displacement"
name="displacement" type="negativeInteger"/>
type="negativeInteger"/>
<element
<element name="color">
name="color">
<simpleType
<simpleType base="xsd:string">
base="xsd:string">
<enumeration
<enumeration value="Green"/>
value="Green"/>
<enumeration
<enumeration value="Blue"/>
value="Blue"/>
</simpleType>
</simpleType>
</element>
</element>
Data:
<age>45</age>
<age>45</age>
<height>5.9</height>
<height>5.9</height>
<displacement>-450</displacement>
<displacement>-450</displacement>
<color>Blue</color>
<color>Blue</color>
9
EJEMPLOS DE TIPOS DE DATOS COMPUESTOS
Estructura (Struct)
Una
Una estructura
estructura es
es un tipo de datos compuesto en la cual los
nombres
nombres de de acceso
acceso de sus valores miembros es la única
distinción
distinción entre
entre ellos
ellos
Esquema:
Esquema:
<element
<element name="Book">
name="Book">
<complexType>
<complexType>
<element
<element name="title"
name="title" type="xsd:string"/>
type="xsd:string"/>
<element
<element name="author"
name="author" type="xsd:string"/>
type="xsd:string"/>
<element
<element name="preface"
name="preface" type="xsd:string"/>
type="xsd:string"/>
<element
<element name="intro"
name="intro" type="xsd:string"/>
type="xsd:string"/>
</complexType>
</complexType>
</e:Book>
</e:Book>
Una
Una estructura
estructura de
de tipo
tipo “Book”:
“Book”:
<e:Book>
<e:Book>
<title>XML
<title>XML by
by Example</title>
Example</title>
<author>Benoît
<author>Benoît Marchal</author>
Marchal</author>
<preface>Prefatory
<preface>Prefatory text</preface>
text</preface>
<intro>This
<intro>This is
is aa book</intro>
book</intro>
</e:Book>
</e:Book>
Arreglo (Array)
Un
Un arreglo
arreglo es
es un
un tipo
tipo de
de dato
dato compuesto
compuesto donde
donde la
la posición
posición de
de
sus miembros sirve
sus miembros sirve como única distinción entre ellos. Los
arreglos
arreglos SOAP
SOAP están definidos como "SOAP-ENC:Array".
Esquema:
Esquema:
<element
<element name="myFavoriteNumbers"
name="myFavoriteNumbers" type="SOAP-ENC:Array"/>
type="SOAP-ENC:Array"/>
Un
Un arreglo
arreglo de
de dos
dos enteros:
enteros:
<myFavoriteNumbers
<myFavoriteNumbers SOAP-ENC:arrayType="xsd:int[2]">
SOAP-ENC:arrayType="xsd:int[2]">
<number>3</number>
<number>3</number>
<number>4</number>
<number>4</number>
</myFavoriteNumbers>
</myFavoriteNumbers>
10
EJEMPLOS DE TIPOS DE DATOS COMPUESTOS
Arreglo (Array)
Los
Los miembros
miembros dede un
un arreglo
arreglo pueden
pueden ser
ser de
de cualquier
cualquier tipo
tipo que
que sea
sea sustituto
sustituto del
del
tipo
tipo de
de dato
dato especificado
especificado en
en el
el atributo
atributo arrayType
arrayType
Puesto
Puesto que
que el
el tipo
tipo SOAP-ENC:Array
SOAP-ENC:Array admite
admite miembros
miembros dede cualquier
cualquier tipo,
tipo, mezclas
mezclas
de
de tipos
tipos arbitrarias
arbitrarias de
de tipos
tipos pueden
pueden estar
estar contenidas
contenidas en
en arreglos
arreglos
Por
Por ejemplo:
ejemplo:
<SOAP-ENC:Array
<SOAP-ENC:Array SOAP-ENC:arrayType="xsd:ur-type[4]">
SOAP-ENC:arrayType="xsd:ur-type[4]">
<SOAP-ENC:int>12345</SOAP-ENC:int>
<SOAP-ENC:int>12345</SOAP-ENC:int>
<SOAP-ENC:decimal>6.789</SOAP-ENC:decimal>
<SOAP-ENC:decimal>6.789</SOAP-ENC:decimal>
<xsd:string>
<xsd:string>
Of
Of Mans
Mans First
First Disobedience,
Disobedience, and
and the
the Fruit
Fruit
Of
Of that
that Forbidden
Forbidden Tree,
Tree, whose
whose mortal
mortal tast
tast
Brought
Brought Death
Death into
into the
the World,
World, and
and all
all our
our woe,
woe,
</xsd:string>
</xsd:string>
<SOAP-ENC:uriReference>
<SOAP-ENC:uriReference>
http://www.dartmouth.edu/~milton/reading_room/
http://www.dartmouth.edu/~milton/reading_room/
</SOAP-ENC:uriReference
</SOAP-ENC:uriReference >>
</SOAP-ENC:Array>
</SOAP-ENC:Array>
Arreglos Esparcidos
Cada elemento especifica
especifica su
su posición
posición mediante
mediante el
el atributo
atributo SOAP-
SOAP-
ENC:position
<SOAP-ENC:Array
<SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[5]"
SOAP-ENC:arrayType="xsd:string[5]" >>
<item
<item SOAP-ENC:position="[1]">The
SOAP-ENC:position="[1]">The first
first element</item>
element</item>
<item
<item SOAP-ENC:position="[3]">The
SOAP-ENC:position="[3]">The third
third element</item>
element</item>
</SOAP-ENC:Array>
</SOAP-ENC:Array>
11
SOAP SOBRE HTTP
12
LLAMADAS A PROCEDIMIENTOS REMOTOS
USANDO SOAP
13
RPC Y EL ELEMENTO HEADER
CONSIDERACIONES DE SEGURIDAD
14
INTERFACES DE PROGRAMACIÓN
DE APLICACIONES
Developmentor (http://www.develop.com/soap/)
• Disponibles: APIs para Java y Perl
• En desarrollo: API para C/C++ y COM
IBM (http://www.alphaworks.ibm.com)
• Disponible: API para Java
DETALLES OPERACIONALES
DE IBM-SOAP V.1.2
SOAP
Services
ServiceManager
JSPs
15
DESARROLLO DE APLICACIONES
USANDO IBM-SOAP V.1.2
DESARROLLO DE APLICACIONES
USANDO IBM-SOAP V.1.2
16
DESARROLLO DE APLICACIONES
USANDO IBM-SOAP V.1.2
Algunos campos:
• ID del servicio
• Tiempo de vida del
objeto
• Métodos
• Tipo de proveedor (Java
o scripts)
• Tipo de codificación
17
CONCLUSIONES
CONCLUSIONES
18