DocumentLiteral vs. RPCEncoded SOAP - PowerPoint PPT Presentation

Loading...

PPT – DocumentLiteral vs. RPCEncoded SOAP PowerPoint presentation | free to view - id: 145c1c-ZjUzM



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

DocumentLiteral vs. RPCEncoded SOAP

Description:

'A simple messaging framework for transferring information ... Schemas are good for describing the 'shape' of an XML document, but data types may be overkill ... – PowerPoint PPT presentation

Number of Views:130
Avg rating:3.0/5.0
Slides: 15
Provided by: wwwdi
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: DocumentLiteral vs. RPCEncoded SOAP


1
Document/Literal vs. RPC/Encoded SOAP
  • Dan Gunter
  • Lawrence Berkeley National Laboratory

2
Background - What is SOAP?
  • Simple Object Access Protocol, but..
  • Not really Simple
  • Doesnt really Access Objects
  • Not really a Protocol
  • What is it really?
  • A simple messaging framework for transferring
    information specified in the form of an XML
    infoset between an initial SOAP sender and an
    ultimate SOAP receiver (SOAP 1.2 Primer)
  • SOAP 1.2 will not spell out the acronym.
    (ibid.)

3
Very Brief history of SOAP
  • From an article by Don Box 1
  • 1998 XML had no type system (no XML Schema),
    SOAP focused on providing one
  • Dave Winer invents XML-RPC using original SOAP
    type system
  • 1999-2000 SOAP adds support for arrays and
    references XML Schema still in flux
  • 2001-? SOAP also adopts XSD, providing two type
    systems
  • Present SOAP Encoding is going away..

4
What is WSDL?
  • Web Services Description Language
  • Describes the message exchanges supported by Web
    Services in an abstract way
  • May be bound to different underlying
    transports, e.g. SOAP/HTTP, REST/HTTP, SMTP, …
  • Most software I know of supports the SOAP/HTTP
    binding

5
What is RPC/Encoded?
  • Remote Procedure Call style invocation
  • Changes the Fault elements slightly
  • (WSDL 1.2) Each element in the input document
    is a parameter
  • Top-level structure MUST be a sequence (no
    choice)
  • SOAP Encoding
  • Serialization of XML adds ID and HREF to allow a
    directed graph (not just a tree)
  • Resulting XML document may no longer validate
    against the XML Schema

6
RPC/Encoded WSDL (1.1)
  • Input
  • ltwsdlmessage name"DistanceInput"gt
  • ltwsdlpart name"p1" type"tnsPoint" /gt
  • ltwsdlpart name"p2" type"tnsPoint" /gt
  • lt/wsdlmessagegt
  • Output
  • ltwsdlmessage name"DistanceOutput"gt
  • ltwsdlpart name"result type"xsdfloat/gt
  • lt/wsdlmessagegt

Perhaps XSD ltelementsgt in WSDL 2.0
7
RPC/Encoded SOAP
  • Input
  • ltsoapEnvelope ..gt
  • ltsoapBody soapencodingStyle
  • "http//schemas.xmlsoap.org/soap/encoding/
    "gt
  • ltnsDistance ..gt
  • ltp1 HREF"id1"/gt
  • ltp2 HREF"id1"/gt
  • lt/nsDistancegt
  • ltnsPoint id"id1"gt
  • ltxgt10lt/xgt
  • ltygt20lt/ygt
  • lt/nsPointgt
  • lt/soapBodygt
  • lt/soapEnvelopegt

Hmm, doesnt look much like a sequence of integer
elements!
8
What is Document/Literal?
  • Document-style invocation
  • Input is any XML document
  • Output, if present, is another one
  • Both are described with XML Schema (in theory,
    other schema languages are supported)
  • Literal encoding
  • The schema can validate the XML in the SOAP
    request

9
Document/Literal WSDL (1.1)
..in theory, non-XSD schema languages can be used
  • Input
  • ltrncDistancegt
  • distance p1 Point , p2 Point
  • Point x xsdfloat, y xsdfloat
  • lt/rncDistancegt
  • ltwsdlmessage name"DistanceInput"gt
  • ltwsdlpart namebody" typerncDistance" /gt
  • lt/wsdlmessagegt
  • Output
  • ltwsdlmessage name"DistanceOutput"gt
  • ltwsdlpart name"result" type"xsdfloat" /gt
  • lt/wsdlmessagegt

10
Document/Literal SOAP
  • Input
  • ltsoapEnvelopegt
  • ltsoapBodygt
  • ltnsdistancegt
  • ltp1gt
  • ltxgt10lt/xgt ltygt20lt/ygt
  • lt/p1gt
  • ltp2gt
  • ltxgt100lt/xgt ltygt200lt/ygt
  • lt/p2gt
  • lt/nsdistancegt
  • lt/soapBodygt
  • lt/soapEnvelopegt

Contents of soapBody will validate against the
schema
11
Schemas and Interoperability
  • Schema validation provides a starting point
  • Platform-independent, widely-implemented
  • Note Schema validation is imperfect
  • Slow as molasses
  • Schemas can be brittle (especially if the schema
    has a lot of datatype information)
  • Message validity ! Semantic validity
  • Versioning not automatic
  • But Better than eyeballing it!

12
What does this mean for NM-WG?
  • Schemas have 3 uses
  • Contracts Agreeing on structure of data
  • Tooling Generate code stubs
  • Validation Did I get what I wanted?
  • The WG is dealing with 1
  • In its full sense, 3 includes constraints not
    expressible with schemas need informal or formal
    specifications for this
  • E.g., if user is requesting a UDP measurement,
    ignore TCP parameters

13
Additional thoughts..
  • Schemas are good for describing the shape of an
    XML document, but data types may be overkill
  • Especially if youre using a language like Perl
    or Python
  • Many useful constraints are still hard to
    express
  • If packetType is UDP, ignore numStreams
  • Note that data-types may inadvertently make life
    harder
  • Need something like XSLT to evaluate
    co-occurrence constraints?
  • All the tools are, at best, first-generation

14
References
  • http//webservices.xml.com/pub/a/ws/2001/04/04/soa
    p.html
About PowerShow.com