SOAP: Simple Object Access Protocol: Mike P. Papazoglou Mikep@uvt - NL
SOAP: Simple Object Access Protocol: Mike P. Papazoglou Mikep@uvt - NL
SOAP: Simple Object Access Protocol: Mike P. Papazoglou Mikep@uvt - NL
Chapter 4
SOAP: Simple Object Access Protocol
Principles & Technology
Web Services:
Mike P. Papazoglou
mikep@uvt.nl
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.2
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.3
Inter-Application Communication
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.5
What is SOAP?
SOAP-based SOAP-based
middleware middleware
SOAP messages
exchanged on top of,
HTTP, SMTP, or other
transport
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.6
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.7
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.8
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.9
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.10
SOAP messages
• SOAP is based on message exchanges.
• Messages are seen as envelopes where
the application encloses the data to be
sent.
• A SOAP message consists of an
<Envelope> element containing an
optional <Header> and a mandatory
<Body> element.
• The contents of these elements are SOAP envelope
application defined and not a part of the
SOAP specification. SOAP header
<env:Envelope
xmlns:env=“http://www.w3.org/2003/05/soap-envelope” >
…
<env:Header>
<tx:transaction-id
xmlns:tx=”http://www.transaction.com/transaction”
env:mustUnderstand=”true”>
512
</tx:transaction-id>
<notary:token xmlns:notary=”http://www.notarization-services.com/token”
env:mustUnderstand=”true”>
GRAAL-5YF3
</notary:token>
</env:Header>
……………
</env:Envelope>
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.12
SOAP Intermediaries
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.13
• The SOAP body is the area of the SOAP message, where the
application specific XML data (payload) being exchanged in the
message is placed.
<env:Header>
<t:transactionID
xmlns:t="http://intermediary.example.com/procurement"
Header
env:role="http://www.w3.org/2002/06/soap-envelope/role/next"
env:mustUnderstand="true" >
57539
</t:transactionID>
</env:Header>
Blocks
<env:Body>
<m:orderGoods
env:encodingStyle="http://www.w3.org/2002/06/soap-encoding"
xmlns:m="http://example.com/procurement">
<m:productItem>
<name>ACME Softener</name>
Body
</m:productItem>
<m:quantity>
35
</m:quantity>
</m:orderGoods>
</env:Body>
</env:Envelope>
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.16
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.17
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.18
Input parameter 2
quantity
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.19
<env:Envelope
xmlns:SOAP=“http://www.w3.org/2003/05/soap-envelope”
xmlns:m="http://www.plastics_supply.com/product-prices">
<env:Header>
<--! – Optional context information -->
</env:Header>
<env:Body>
<m:GetProductPriceResponse>
<product-price> 134.32 </product-price>
</m:GetProductPriceResponse>
</env:Body>
</env:Envelope>
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.20
PurchaseOrder
Acknowledgement
document document
-product item -order id
-quantity
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.21
<env:Header>
<tx:Transaction-id
xmlns:t=”http://www.transaction.com/transactions”
env:mustUnderstand='1'>
512
</env:Header>
<env:Body>
<po:PurchaseOrder oderDate=”2004-12-02”
xmlns:m="http://www.plastics_supply.com/POs">
<po:from>
<po:accountName> RightPlastics </po:accountName>
<po:accountNumber> PSC-0343-02 </po:accountNumber>
</po:from>
<po:to>
<po:supplierName> Plastic Supplies Inc. </po:supplierName>
<po:supplierAddress> Yara Valley Melbourne </po:supplierAddress>
</po:to>
<po:product>
<po:product-name> injection molder </po:product-name>
<po:product-model> G-100T </po:product-model>
<po:quantity> 2 </po:quantity>
</po:product>
</ po:PurchaseOrder >
</env:Body>
</env:Envelope>
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.22
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.23
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.24
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.25
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.26
SOAP envelope
SOAP header
Transactional
context
SOAP body
Name of the
procedure
Service requestor Service provider
Input parameter 1
SOAP header
transactional
Transactional
context
context
SOAP body
return
Return
parameter
parameter
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.27
Topics
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008
Slide 4.28
Michael P. Papazoglou, Web Services, 1st Edition, © Pearson Education Limited 2008