SOAP - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

SOAP

Description:

POST /calendar-request HTTP/1.1. Host: uche.ogbuji.net ... for a Calendar application. module Calendar { struct Date { unsigned short day; unsigned short month; ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 9
Provided by: roberta138
Learn more at: https://www.cs.umb.edu
Category:
Tags: soap

less

Transcript and Presenter's Notes

Title: SOAP


1
SOAP
  • Same basic functionality as XMLRPC but extensible
  • complex data structures
  • intermediate processing possible
  • more support for classic RPC constructs
  • http (not necessarily) provides connection
    management, framing, session

2
SOAP REQUEST
  • (Examples from IBM Developerworks SOAP tutorial.
    See course resources page)
  • http request must be POST
  • http headers contain most of the control
  • POST /calendar-request HTTP/1.1 Host
    uche.ogbuji.net Content-Type text/xml
    charset"utf-8" Content-Length 507
  • SOAPAction "http//uche.ogbuji.net/soap-example"
  • SOAPAction is a URN advising server, especially
    for routing, SOAP-aware firewalls, and other
    facilities. In Wrox example it is ""

3
HTTP Request Body
  • SOAP Envelope containing SOAP body
  • ltSOAP-ENVEnvelope xmlnsSOAP-ENV "http//schema
    s.xmlsoap.org/soap/envelope/" SOAP-ENVencodingSt
    yle http//schemas.xmlsoap.org/soap/encoding/"
    gt
  • lt!-- SOAP body goes here --gt
  • lt/SOAP-ENVEnvelopegt
  • encodingStyle is the serialization schema it
    describes data types and other things telling how
    to interpret the body.

4
SOAP serialization
  • encodingStyle often defaults as above but
    sometimes is rdf, XMLRPC, custom XML, or other
    things that validating parsers can deal with.
  • "SOAP is like a set of Russian dolls in its
    layers of encapsulation. There are the HTTP
    headers, then the SOAP envelope, and then the
    SOAP body. Each layer provides metadata for the
    immediately enclosed layer.
  • Metadata is information that helps an
    application make sense of the important data
    being transported. For instance, the HTTP header
    specifies the character encoding as metadata for
    the HTTP body. This makes sure that the
    application properly translates the stream of
    bits into a series of characters.
  • The outermost portion of the HTTP body is the
    SOAP envelope. This contains the
    SOAP-ENVencodingStyle attribute which specifies
    the structure of the actual request. This
    metadata tells the application how to make sense
    of the XML elements and attributes within the
    body, which make up the actual request."
  • IBM Developerworks SOAP Tutorial

5
SOAP Body
  • IDL for a Calendar application
  • module Calendar struct Date unsigned short
    day unsigned short month unsigned short
    year
  • exception InvalidDate string field
  • interface CalendarWidget void addListing(in
    Date when, in string what) raises
    (InvalidDate)
  • string getListings(in Date monthOf) raises
    (InvalidDate)

6
SOAP Body
  • Call the addListing service
  • ltcAddListing xmlnsc"http//uche.ogbuji.net/so
    ap-example/calendar"gt
  • lt!-- Request arguments go here -gt
  • lt/cAddListinggt

7
SOAP request
  • POST /calendar-request HTTP/1.1
  • Host uche.ogbuji.net
  • Content-Type text/plain charset"utf-8"
  • Content-Length 507
  • ltSOAP-ENVEnvelope xmlnsSOAP-NV"http//schemas.
    xmlsoap.org/soap/envelope/" SOAP-ENVencodingStyl
    e"http//schemas.xmlsoap.org/soap/encoding/" gt
  • ltSOAP-ENVBodygt
  • ltcAddListing xmlnsc"http//uche.ogbuji.net/so
    ap-example/calendar"gt
  • ltcwhengt
  • ltcDategt ltdaygt21lt/daygt
    ltmonthgt6lt/monthgt ltyeargt2001lt/yeargt
    lt/cDategt lt/cwhengt ltcwhatgtA total eclipse
    visible across Central Africa.lt/cwhatgtlt/cAddLis
    tinggt
  • lt/SOAP-ENVBodygt lt/SOAP-ENVEnvelopegt

8
SOAP Response
  • HTTP/1.1 200 OK Server PythonSimpleHTTP/2.0
    Date Tue, 28 Nov 2000 042303 GMT
    Content-type text/xml charset"utf-8"
    Content-length 296 ltSOAP-ENVEnvelope
    xmlnsSOAP-ENV"http//schemas.xmlsoap.org/soap/en
    velope/" SOAP-ENVencodingStyle
    "http//schemas.xmlsoap.org/soap/encoding/" gt
    ltSOAP-ENVBodygt ltcAddListingResponse
    xmlnsc"http//uche.ogbuji.net/soap-example/calen
    dar"/gt lt/SOAP-ENVBodygt lt/SOAP-ENVEnvelopegt
Write a Comment
User Comments (0)
About PowerShow.com