Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 what is soap don box sun/netscape bof january 25, 2000.

Similar presentations


Presentation on theme: "1 what is soap don box sun/netscape bof january 25, 2000."— Presentation transcript:

1 1 what is soap don box sun/netscape bof january 25, 2000

2 2 soap philosophy “First invent no new technology” SOAP simply codifies existing practice of using HTTP+XML as an application protocol SOAP does not mandate an API or runtime SOAP does not mandate the use of an ORB SOAP does not mandate the use of a traditional web server (e.g., Apache, IIS) SOAP does not mandate a programming model –Although several are implied SOAP much closer to IIOP/GIOP than DCOM

3 3 the soap tightrope SOAP tries to sit between a variety of worlds Balance between XML and object worlds –Is arbitrary XML legal SOAP? Balance between loosely coupled and tightly coupled communications models –What assumptions can we make about the other end of the wire? Balance between loosely coupled and tightly coupled type systems –C++ programmer vs. Perl scripter No imposition of runtime (ORB == httpd == ???)

4 4 what is soap? SOAP is (at least) two things –A XML-based serialization format –An application of that format to HTTP Serialization format based on element-normal- form encoding of typed instances When applied to HTTP, request/response pair called a SOAP method –Response payload is optional –Faults communicated via HTTP faults or SOAP:Fault

5 5 three views of a soap call SOAP can be viewed as another ORPC protocol –Request contains in and inout parameters –Response contains inout and out parameters SOAP can be viewed as a “messaging” protocol –Request contains a single serialized request object –Response contains a single serialized response object SOAP ~= “XSLT with a longer wire” –Request contains an XML document –Server returns a transformed version None of these views is mandated by the protocol

6 6 three views of a soap call obj.doit(arg1, arg2, arg3); return addr obj arg2 arg1 arg0 arg1 arg2 return addr this class doit { T arg1; T arg2; T arg3; } <element name=‘arg1’ type=‘T’ /> <element name=‘arg2’ type=‘T’ /> <element name=‘arg3’ type=‘T’ /> val

7 7 soap in a nutshell HTTP payload consists of a soap:Envelope XML element –Well-known SOAP NSURI recommended but optional –Consists of optional Header + mandatory Body elems soap:Body element contains a single serialized instance of a named type –Must be first child element of soap:Body –This is the SOAP payload soap:Header element is a collection of serialized instances of named types –Mandatory/optional extensions

8 8 soap in a nutshell POST /path/foo.pl HTTP/1.1 Content-Type: text/xml MethodName: interfaceURI#Add Content-Length: nnnn 24 53.2 200 OK Content-Type: text/xml Content-Length: nnnn <soap:Envelope xmlns:soap=‘uri for soap’> 77.2

9 9 the soap type system The SOAP type system is compatible with and leverages XML Schema Definition language SOAP types can be described using XSD SOAP uses XSD conventions for associating instance with type <foo xmlns:xsi= ‘http://www.w3.org/1999/XMLSchema/instance’ xsi:type=‘timeInstant’ >1999-11-12T09:43 Arrays and typed references are given special treatment beyond XSD

10 10 embedded vs. independent values SOAP can retain identity across marshals in a schema-invariant manner foo.doit(obj1, obj1); Values that can be referenced from multiple locations are encoded as independent elements –Must appear as child of soap:Header or soap:Body –Must have unique soap:id attribute –(Typically) encoded as element with QName of type Elements that refer to values that can be shared are encoded using multi-ref accessors –Uses fragment identifier in soap:href attribute

11 11 embedded vs. independent values 23 34 23 34

12 12 other soap stuff MIME-type for SOAP is text/xml All SOAP requests must be tagged with well- known HTTP header SOAPMethodName: interfaceURI#methodname HTTP faults simply use HTTP infrastructure SOAP/app faults use distinguished SOAP PDU –Standard content model for all faults –Extensible to support UDTs for exceptions Values in SOAP payloads can be tagged as using an alternative encoding scheme Here is some random XML!!

13 13 soap and giop requests compared POST /objectURI HTTP/1.1 SOAPMethodName Extension Headers Method Identifier Object Endpoint ID Interface Identifier SOAP:Envelope Parameter Data SOAP:Header SOAP:Body CallElement Header1 object_key magic (GIOP) version+flags+msgtype message_size service_contex (protocol extensions)t operation (method name as string) Payload [in] and [in, out] params request_id response_expected Note: CORBA Objects only implement one interface, so Interface ID is implicit in object_key principal

14 14 object_key host soap and iiop object references compared port components (optional) Iiop_version Object Endpoint ID TCP Port No type_id (type of interface) nprofiles tag (0x0) Interface Type IP Host Address http://209.110.197.2:80/endpointURI/MoreInfo Interface URI passed explicitly with every call

15 15 conclusions SOAP is a minimal set of conventions for serialization and method invocation –Leverages HTTP, XML, XSD SOAP defaults to element-normal-form encoding of typed instances –Supports alternative encodings SOAP supports mandatory/optional protocol extensions (a la HTTP-EF) –soap:Envelope ~= void * + annotations SOAP simply codifies existing practice –SOAP-like solutions already fairly common case


Download ppt "1 what is soap don box sun/netscape bof january 25, 2000."

Similar presentations


Ads by Google