Simple Object Access Protocol (SOAP) - PowerPoint PPT Presentation

About This Presentation
Title:

Simple Object Access Protocol (SOAP)

Description:

... framework, which provides a message construct that can be exchanged over a ... The SOAP Envelope construct defines an overall framework for expressing what is ... – PowerPoint PPT presentation

Number of Views:202
Avg rating:3.0/5.0
Slides: 30
Provided by: kazih
Category:

less

Transcript and Presenter's Notes

Title: Simple Object Access Protocol (SOAP)


1
Simple Object Access Protocol (SOAP)
  • by Kazi Huque

2
Presentation Outline
  • Definition
  • Motivation
  • Characteristics
  • SOAP message format
  • SOAP in code
  • SOAP Security
  • SOAP in action

3
What is SOAP?
  • SOAP is a lightweight protocol intended for
    exchanging structured information in a
    decentralized, distributed environment. SOAP uses
    XML technologies to define an extensible
    messaging framework, which provides a message
    construct that can be exchanged over a variety of
    underlying protocols. The framework has been
    designed to be independent of any particular
    programming model and other implementation-specifi
    c semantics.

4
SOAP is the Foundation
5
Simply Put...
  • SOAP is a way for a program running in one
    operating system to communicate with a program
    running in either the same or a different
    operating system, using HTTP (or any other
    transport protocol) and XML.

6
SOAP Messaging Framework
  • XML-based messaging framework that is
  • 1) extensible
  • 2) interoperable
  • 3) independent
  • Next we discuss these three characteristics in
    more detail

7
Extensible
  • Simplicity remains one of SOAP's primary design
    goals
  • SOAP defines a communication framework that
    allows for features such as security, routing,
    and reliability to be added later as layered
    extensions

8
Interoperable
  • SOAP can be used over any transport protocol such
    as TCP, HTTP, SMTP
  • SOAP provides an explicit binding today for HTTP

9
Interoperable Cont
10
Independent
  • SOAP allows for any programming model and is not
    tied to RPC
  • SOAP defines a model for processing individual,
    one-way messages
  • SOAP also allows for any number of message
    exchange patterns (MEPs)

11
One-Way Message
12
Request/Response
13
SOAP Message Format
  • SOAP message consists of three parts
  • SOAP Envelope
  • SOAP Header (optional)
  • SOAP Body
  • From the http//schemas.xmlsoap.org/soap/envelope/
    namespace

14
SOAP Envelope
  • The SOAP Envelope construct defines an overall
    framework for expressing what is in a message and
    who should deal with it.

15
SOAP Envelope Cont
  • The Envelope is the top element of the XML
    document representing the message.
  • The Envelope element is always the root element
    of a SOAP message.
  • The Envelope element contains an optional Header
    element followed by a mandatory Body element.

16
SOAP Envelope Code
  • ltsoapEnvelope xmlnssoap"http//schemas.xmlsoap.
    org/soap/envelope/"gt ltsoapHeadergt lt!-- optional
    --gt
  • lt!-- header blocks go here... --gt
  • lt/soapHeadergt
  • ltsoapBodygt
  • lt!-- payload or Fault element goes here... --gt
    lt/soapBodygt
  • lt/soapEnvelopegt

17
SOAP Header
  • The Header element is a generic container for
    control information
  • It may contain any number of elements from any
    namespace
  • Header blocks should contain information that
    influences payload processing
  • Header is optional

18
SOAP Header Code
  • ltsoapHeadergt
  • lt!-- security credentials --gt
  • ltscredentials xmlnss"urnexamples-orgsecurity
    "gt ltusernamegtdavelt/usernamegt ltpasswordgtevadlt/pas
    swordgt
  • lt/scredentialsgt
  • lt/soapHeadergt

19
SOAP Body
  • The Body element represents the message payload

20
SOAP Body Code
  • ltsoapBodygt
  • ltxTransferFunds xmlnsx"urnexamples-orgbankin
    g"gt ltfromgt22-342439lt/fromgt
  • lttogt98-283843lt/togt
  • ltamountgt100.00lt/amountgt
  • lt/xTransferFundsgt
  • lt/soapBodygt

21
SOAP in Code
  • SOAP Message Embedded in HTTP Request
  • ltSOAP-ENVEnvelope xmlnsSOAP-ENV"http//schema
    s.xmlsoap.org/soap/envelope/"  SOAPENVencodingSt
    yle"http//schemas.xmlsoap.org/soap/encoding/"gt
    ltSOAP-ENVBodygt       ltmGetLastTradePrice
    xmlnsm"Some-URI"gt           ltsymbolgtDISlt/symbol
    gt       lt/mGetLastTradePricegt   lt/SOAP-ENVBody
    gt
  • lt/SOAP-ENVEnvelopegt

22
SOAP in Code Cont
  • SOAP Message Embedded in HTTP Response
  • ltSOAP-ENVEnvelope  xmlnsSOAP-ENV"http//schema
    s.xmlsoap.org/soap/envelope/"  SOAP-ENVencodingS
    tyle"http//schemas.xmlsoap.org/soap/encoding/"/gt
       ltSOAP-ENVBodygt       ltmGetLastTradePriceRes
    ponse xmlnsm"Some-URI"gt           ltPricegt34.5lt/
    Pricegt       lt/mGetLastTradePriceResponsegt   lt/
    SOAP-ENVBodygt
  • lt/SOAP-ENVEnvelopegt

23
SOAP Security
  • The SOAP specification does not define encryption
    for XML Web Services.
  • This is left up to the implementer of the SOAP
    protocol.

24
Issues About Security
  • Encryption places a dependency on the transport
    protocol
  • Does the transport protocol support secure
    communication?
  • What is the cost of encrypting all the data
    versus part of the data?

25
SOAP Code with Encryption
  • lt_at_ WebService Language"C" Class"CreditCardServ
    ice" gt
  • using System.Web.Services
  • public class CreditCardService
  • WebMethod
  • EncryptionExtension(EncryptEncryptMode.Respons
    e)
  • public string GetCreditCardNumber()
  • return "MC 4111-1111-1111-1111"

26
Request Encrypted
  • lt?xml version"1.0" encoding"utf-8"?gt
  • ltsoapEnvelope xmlnssoap"http//schemas.xmlsoap.
    org/soap/envelope/"
    xmlnsxsi"http//www.w3.org/2001/XMLSchema-instan
    ce" xmlnsxsd"http//www.w3.org/200
    1/XMLSchema"gt
  • ltsoapBodygt
  • ltGetCreditCardNumber xmlns"http//tempuri.org/"
    /gt
  • lt/soapBodygt
  • lt/soapEnvelopegt

27
Response Encrypted
  • ltsoapBodygt
  • ltGetCreditCardNumber xmlns"http//tempuri.org/"gt
  • ltGetCreditCardNumberResultgt83 151 243 32 53 95
    86 13 190 134 188 241 198 209 72 114 122 38 180
    34 194 138 16 97 221 195 239 86 26 152 94 27
  • lt/GetCreditCardNumberResultgt
  • lt/GetCreditCardNumbergt
  • lt/soapBodygt

28
SOAP in Action
  • Demo

29
References
  • Understanding SOAP
  • Overall explanation of what SOAP is, and what it
    can do.
  • http//msdn.microsoft.com/webservices/understand
    ing/webservicebasics/default.aspx?pull/library/en
    -us//dnsoap/html/understandsoap.asp
  • W3C Note
  • Explains how SOAP exchanges messages. Code level
    details.
  • http//www.w3.org/TR/2000/NOTE-SOAP-20000508/
Write a Comment
User Comments (0)
About PowerShow.com