Академический Документы
Профессиональный Документы
Культура Документы
alfady@scs-net.org alnashed@scs-net.org
***"#$
%& ' (
)" !
........................................................................ INTRODUCTION
2
...................................................................................... WSDL Binding WSDL
3
Introduction
! " #$ % &
, - & . /0 ' ()* + $ +( !
B2C Business to consumer % $12 ) 1 )
31 4 5! 1 6 12 7 % $12 1 $ 5 4 5! 2 1/ #$
$1 9 :/% 3 " : " 1 4 % %$ 3 )/ 8%& $ %/ 7
1 *4 = 5 ; <
3 ) + /* 1 4 >*
4
1& D D D / •
), :/ ' 1& D D Body % $ / •
) & :# # : G 1& % K D D ; / •
Syntax Rules $ / !
XML 4 " % ) SOAP •
Enveloped 1@ % $ % ) SOAP •
Encoded +( % $ % ) SOAP •
XML ) & 1& D '% ) SOAP •
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
...
...
</soap:Header>
<soap:Body>
...
...
<soap:Fault>
5
...
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
6
Actor Element Actor
+& 3 ! < + / >* % soap %*
2 9 J9 2 %8 6
Syntax
soap:actor="URI"
Example
<soap:Header>
<m:Trans
xmlns:m="http://www.w3schools.com/transaction/"
soap:actor="http://www.w3schools.com/appml/">
234
</m:Trans>
</soap:Header>
7
Syntax
soap:mustUnderstand="0|1"
Example
soap:Header>
<m:Trans
xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">
234
</m:Trans>
</soap:Header>
Syntax
soap:encodingStyle="URI"
Example
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
8
...
...
</soap:Envelope>
<soap:Body>
<m:GetPrice xmlns:m="http://www.w3schools.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
9
The HTTP Protocol HTTP $
%G 6 TCP/IP $ < & ' $ % HTTP $ &
& ## 2 TCP/IP $ B & $ 9
4 5 Q TCP $ 4 HTTP $ ISO ? %
$" >1/ 4 > * HTTP 1 % ( 7 B TTP
Host: 189.123.345.239
Content-Type: text/plain
Content-Length: 200
200 OK
Content-Type: text/plain
Content-Length: 200
Content-Length: 0
10
%/ % 9 Soap 1 % 1/
HTTP POST request
HTTP GET request
Content-Length: bytes
Example
Content-Length: 250
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.stock.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
11
A SOAP response
HTTP/1.1 200 OK
Content-Type: application/soap; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.stock.org/stock">
<m:GetStockPriceResponse>
<m:Price>34.5</m:Price>
</m:GetStockPriceResponse>
</soap:Body>
</soap:Envelope>
12
Web Services Description Language WSDL ? @
WSDL (Web Services Description Language ? @ %*
2 ' ? XML ( >1/ @ %/ + /
2& &
$G 4 9U!
@1 J 9 9 %/ 7 WSDL @ 9 •
WSDL @1 $ : ()G %/ 7 WSDL •
WSDL port interface D WSDL @1 2) 7 WSDL •
D WSDL @1 2) %/ 7 WSDL •
WSDL binding interface
< # : ) $ WSDL @1 1 $ / - & WSDL @ / ! •
W3C
13
7 M ) XML ' $ >1/ & ? Microsoft
U 1 5 )1 21&) W3C K 4 $ %/ + / 9 W3C $ %
' W3C $ " & 7 K $ " +/ !% 9 2
K < 2 K !% $ !% $ % + I &
WSDL 1.2 Q Draft & SW > 2/ " $ 2I/
( W3C !%
? Element &
L 4 1& ? & 4 <portType>
9
L messages ? & 4 <message>
!%
data types L & L ? & 4 <types>
!%
L ' ' $ ? & 4 <binding>
!%
14
>1/ WSDL
<definitions>
<types>
definition of types........
</types>
<message>
definition of a message....
</message>
<portType>
definition of a port.......
</portType>
<binding>
definition of a binding....
</binding>
</definitions>
15
) @ % I + ? $ # $ ZportTypeY & & % %$
1
#
WSDL % :() .I # 1
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
16
? & $ 1 4 $ NglossaryTermsN ? & portType & 4 < #
2 NgetTermN 1 & ? & 4 $ B NgetTermN 4 3 I 1/
/ ? & NgetTermResponseN 4 ' T NgetTermRequestN 4 '
) @ 5 2 & $ : () message
3 $ % I 5 NgetTermN $ $ glossaryTerms & 1
NgetTermRequestN 9 T NgetTermRequestN 9
? & H
L 1 &1 %$ J) One-way
) & % %$
1 &1 %$ ) [ 1 Request-response
) & ?
L * L 1 &1 %$ ) \: ) Solicit-response
) ' C ' 4 4# % 1
? L * 1 &1 %$ &"* Notification
) ' C ' 4 %
17
One-Way J) H % 1/
J) 1 / >1/ # 1
<message name="newTermValues">
</message>
<portType name="glossaryTerms">
<operation name="setTerm">
</operation>
</portType >
Request-Response ) ] 1 1/
1& % H 9 %/ # 1
) \ 1 H % 1/ ? & NglossaryTermsN 4 # 9 7 )
1& J9 1 .1 1 ) 8 1& J9 4 B NgetTermN 9
T & ? NtermN 2 NgetTermRequestN >/
NvalueN >/ 5 NgetTermResponseN
18
<message name="getTermRequest">
</message>
<message name="getTermResponse">
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
</message>
<message name="getTermResponse">
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
19
</operation>
</portType>
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation>
<soap:operation
soapAction="http://example.com/getTerm"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
20
SOAP 7 ? & 4 1/ $ ) % 2I & 1/ $ ? & operation
NliteralN T ( $ I % ) <
WSDL WSDL / !
@ ! 3 4 $ WSDL Syntax Q 1$ / 1
W3C %/ + Draft
<wsdl:definitions name="nmtoken"? targetNamespace="uri">
<wsdl:types> ?
</wsdl:types>
<wsdl:message name="ncname"> *
</wsdl:message>
<wsdl:portType name="ncname"> *
<wsdl:operation name="ncname"> *
<wsdl:input message="qname"> ?
21
<wsdl:documentation .... /> ?
</wsdl:input>
<wsdl:output message="qname"> ?
</wsdl:output>
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:serviceType name="ncname"> *
<wsdl:portType name="qname"/> +
</wsdl:serviceType>
<wsdl:operation name="ncname"> *
<wsdl:input> ?
22
<-- binding details -->
</wsdl:input>
<wsdl:output> ?
</wsdl:output>
<wsdl:fault name="ncname"> *
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
23