SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Prabhat Gangwar, <prabhat.gang@gmail.com>
Introduction to SOAP
A Walkthrough of Core Technical Concepts
2
What is SOAP?
• SOAP is a simple, lightweight XML protocol for
exchanging structured and typed information on the Web
• Overall design goal: KISS
• Can be implemented in a weekend
• Stick to absolutely minimum of functionality
• Make it Modular and Extensible
• No application semantics and no transport semantics
• Think “XML datagram”
3
SOAP Contains Four Parts:
• An extensible envelope expressing (mandatory)
• what features and services are represented in a message;
• who should deal with them,
• whether they are optional or mandatory.
• A set of encoding rules for data (optional)
• Exchange instances of application-defined data types and
directed graphs
• Uniform model for serializing abstract data models that can not
directly be expressed in XML schema
• A Convention for representation RPC (optional)
• How to make calls and responses
• A protocol binding to HTTP and HTTP-EF (optional)
4
SOAP Envelope
SOAP Example in HTTP
HTTP Request
SOAP-HTTP Binding
SOAP Header
SOAP Body
POST /Accounts/Henrik HTTP/1.1
Host: www.webservicebank.com
Content-Length: nnnn
Content-Type: text/xml; charset="utf-8"
SOAPAction: "Some-URI"
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<t:Transaction xmlns:t="some-URI" SOAP:mustUnderstand="1">
5
</t:Transaction>
</SOAP:Header>
<SOAP:Body>
<m:Deposit xmlns:m="Some-URI">
<m:amount>200</m:amount>
</m:Deposit>
</SOAP:Body>
</SOAP:Envelope>
5
SOAP Example in SIP
SOAP Envelope
SIP Request
SOAP-SIP Binding
SOAP Body
SERVICE sip:broker.ubiquity.net SIP/2.0
To: sip:broker.ubiquity.net
From: sip:proxy.ubiquity.net
Call-ID:648324@193.195.52.30
CSeq: 1 SERVICE
Via: SIP/2.0/UDP proxy.ubiquity.net
Content-Type: text/xml
Content-Length: 381
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Body>
<m:SetCreditStatus xmlns:m="http://www.ubiquity.net/sipservices">
<m:user>sip:jo@ubiquity.net</m:user>
<m:status>super</m:status>
</m:SetCreditStatus>
</SOAP:Body>
</SOAP:Envelope>
6
… or SOAP by Itself…
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<m:MessageInfo xmlns:m="http://www.info.org/soap/message">
<m:to href="mailto:you@your.com"/>
<m:from href="mailto:me@my.com"/>
<m:contact href="mailto:someone@my.com">
</m:MessageInfo>
</SOAP:Header>
<SOAP:Body>
<msg:Message xmlns:m="http://www.info.org/soap/message">
<msg:subject>Your house is on fire!</msg:subject>
<msg:feed href="ram://livenews.com/yourhouse"/>
</msg:Message>
</SOAP:Body>
</SOAP:Envelope>
7
SOAP Stack Examples
SOAP
HTTP
TCP
Protocol Binding
SOAP
SIP
TCP
Protocol Binding
SOAP
SIP
UDP
Protocol Binding
SOAP
MIME Multipart
Protocol Binding
…
SOAP
SMTP
TCP
Protocol Binding
SOAP
TCP
Protocol Binding
SOAP
UDP
Protocol Binding
ServicesServices Services Services
Services Services Services
8
Note Again: SOAP is a Protocol!
• What does this mean?
• It is not a distributed object system
• It is not an RPC system
• It is not even a Web application
• Your application decides what your application is!
• You can build a tightly coupled system
…or…
• You can build a loosely coupled system
• Tunneling is a property of the application, not the protocol
9
SOAP is Designed for Evolvability
• How are features and services deployed in the Web?
• Often by extending existing applications
• Spreading from in the small to the large over time
• This means that:
• Applications have different capabilities at all times
• We have to support this
• This requires that:
• Applications supporting a particular feature or service
should be able to employ this with no prior agreement;
• Applications can require that the other party either
understand and abide by the new feature or service or
abort the operation
10
Why Not Roll My Own XML
Protocol?
• SOAP allows you to define your particular feature or
service in such a way that it can co-exist with other
features and services within a SOAP message
• What is a feature or a service?
• Authentication service
• Payment service
• Security service
• Transaction management service
• Privacy service
• Not owning the message means easier deployment and
better interoperability
11
What is Interoperability?
• Interoperability is the intersection of features and service
supported by two or more communicating peers:
Peer BPeer A
Interoperability
12
Extensibility vs. Evolvability
• Extensibility: Cost pr new feature/service increases
over time
• Evolvability: Cost pr new feature/service is flat
Time
Time
Feature set 3
Feature set 3
Feature set 2
Feature set 2
Feature set 1
Feature set 1
13
Interoperability vs. Evolvability
• As evolvability goes up, interoperability goes down
Interoperability
Evolvability
SOAP
14
SOAP and Composability
• We are looking at two types of composability of features
and services within a message:
• Vertical: multiple features and services can exist
simultaneously within the same message
• Horizontal: features and services within a message can
be intended for different recipients.
• This is not boxcarring but rather the HTTP proxy
model and as we shall see, the SOAP messaging
model as well
15
Vertical Composability
• Allows for independent features to co-exist
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<a:authentication …>…</a:authentication>
<s:security …> … </s:security>
<t:transactions …> … </t:transactions>
<p:payment …> … </p:payment>
</SOAP:Header>
<SOAP:Body>
<m:mybody> … </m:mybody>
</SOAP:Body>
</SOAP:Envelope>
<a:authentication …>…</a:authentication>
<s:security …> … </s:security>
<t:transactions …> … </t:transactions>
<p:payment …> … </p:payment>
<m:mybody> … </m:mybody>
16
Horizontal Composability
• Allows for intermediaries
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<a:authentication actor="intermediary a"…>…</a:authentication>
<s:security actor="intermediary b"…> … </s:security>
<t:transactions actor="intermediary c"…> … </t:transactions>
<p:payment actor="destination"…> … </p:payment>
</SOAP:Header>
<SOAP:Body>
<m:mybody> … </m:mybody>
</SOAP:Body>
</SOAP:Envelope>
<a:authentication actor="intermediary a"…>…</a:authentication>
<s:security actor="intermediary b"…> … </s:security>
<t:transactions actor="intermediary c"…> … </t:transactions>
<p:payment actor="destination"…> … </p:payment>
<m:mybody> … </m:mybody>
17
Modularity through XML
Namespaces
• The SOAP envelope namespace
• http://schemas.xmlsoap.org/soap/envelope/
• Resolves to the SOAP Envelope Schema
• The SOAP encoding namespace
• http://schemas.xmlsoap.org/soap/encoding/
• Resolves to the SOAP Encoding Schema
• Separate namespaces help enforce modularity
• SOAP Envelope Schema provides formal definition of
Envelope
18
The SOAP Envelope
• A SOAP envelope defines a SOAP message
• Basic unit of exchange between SOAP processors
• SOAP messages are one-way transmissions
• From sender through intermediaries to receiver
• Often combined to implement patterns such as request/response
• Messages are routed along a "message path"
• Allows for processing at one or more intermediate nodes in
addition to the ultimate destination node.
• A node is a SOAP processor and is identified by a URI
• Envelopes can be nested
• Only outer envelope is "active" to the receiving SOAP processor
19
SOAP Headers
• Allows for modular addition of features and services
• Open-ended set of headers
• Authentication, privacy, security etc. etc.
• Can address any SOAP processor using the "actor"
attribute
• Can be optional/mandatory using the
"mustUnderstand" attribute
Start web://bar web://toto web://foo
20
Semantics of SOAP Headers
• Contract between sender and recipient
• Recipient is described by "actor" attribute
• Allows for different types of negotiation:
• Take it or leave it directly supported
• Let's talk about it can be built on top
• And for different settings:
• Server dictated
• Peer-to-peer
• Dictated by third party
21
The SOAP actor Attribute
• The "Actor" attribute is a generalization of the HTTP
Connection header field
• Instead of hop-by-hop vs. end-to-end, the actor
attribute can address any SOAP processor because it
is a URI
• Special cases:
• "next hop" has a special URI assigned to it
• "end" is the default destination for a header
• "end" is the destination for the body
22
The SOAP mustUnderstand
Attribute
• The "mustUnderstand" is the same as "mandatory" in the
HTTP Extension Framework
• Requires that the receiving SOAP processor must
accept, understand and obey semantics of header or
fail
• It is up to the application to define what
"understand" means
• This allows old applications to gracefully fail on
services that they do not understand
23
SOAP Body
• Special case of header
• Default contract between sender and ultimate recipient
• Different from HTTP's header/body separation
• Defined as a header with attributes set to:
• Implicit mustUnderstand attribute is always "yes"
• Implicit actor attribute is always "the end"
Start web://bar web://toto web://foo
24
SOAP Fault
• The SOAP Fault mechanism is designed to support the
composability model
• Is not a scarce resource as in HTTP where there can be only one
(the Highlander principle)
• A SOAP message can carry one SOAP Fault element
• Must be placed in the Body of the message
• The Fault Detail element carries information for faults resulting from
the body
• Detail information for faults resulting from headers are carried in the
header
• The SOAP fault code extension mechanism is for SOAP only
• Application faults should use existing SOAP fault codes
• Client code is for request faults
• Server code is for processing faults
25
SOAP Fault Example
• A SOAP message containing an authentication service:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<m:Authentication xmlns:m="http://www.auth.org/simple">
<m:credentials>Henrik</m:credentials>
</m:Authentication>
</SOAP:Header>
<SOAP:Body>
… body goes here …
</SOAP:Body>
</SOAP:Envelope>
26
SOAP Fault Example… 2
• …results in a fault because the credentials were bad:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<m:Authentication xmlns:m="http://www.auth.org/simple">
<m:realm>Magic Kindom</m:realm>
</m:Authentication>
</SOAP:Header>
<SOAP:Body>
<SOAP:Fault>
<SOAP:faultcode>SOAP:Client</faultcode>
<SOAP:faultstring>Client Error</faultstring>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
27
SOAP Versioning Model
• Bad experiences with version numbers in decentralized
environments
• Extremely confusing in HTTP – whole RFC on the topic
• Typical uses of number based "versioning"
• Backwards compatible (minor version number)
• Backwards incompatible (major version number)
• SOAP supports "minor" versioning within the envelope using header
and body elements
• The SOAP composability model ("WYSIWYG on the wire")
• The SOAP Envelope Namespace URI defines the "major" of the
SOAP envelope
• Changing Namespace URI is equivalent to change major version
number
• Possible to negotiate major versioning change using SOAP
header
• Equivalent to the HTTP Upgrade header field
28
SOAP and "Binary" Data
• "Binary" can in fact mean any data that is to be tunneled
through SOAP
• Encrypted data, images, XML documents, SOAP
envelopes as data
• Can be carried in two ways
• Within the envelope as binary blob
• Referenced from within the SOAP envelope
• References can point to anything including
• MIME multipart, HTTP accessible resources etc.
• Integrity can be obtained through manifest
29
Binding to HTTP
• The purpose of the HTTP protocol binding is two-fold
• To ensure that SOAP is carried in a way that is
consistent with HTTP’s message model
• Intent is not to break HTTP
• To indicate to HTTP servers that this is a SOAP
message
• Allows HTTP servers to act on a SOAP message
without knowing SOAP
• Binding only works for HTTP POST requests
• SOAP intermediary is not the same as HTTP intermediary
• Only HTTP origin server can be SOAP intermediary
30
HTTP Request
POST /Accounts/Henrik HTTP/1.1
Content-Type: text/xml; charset="utf-8“
Content-Length: nnnn
SOAPAction: "http://electrocommerce.org/MyMessage"
<SOAP:Envelope...
• Use HTTP POST request method name
• Use the SOAPAction HTTP header field
• It cannot be computed – the sender must know
• It should indicate the intent – not the destination
• SOAP request doesn't require SOAP response
SOAPAction: "http://electrocommerce.org/MyMessage"
31
HTTP Response
• Successful responses can 2xx status codes
• All 3xx, 4xx, and 5xx status codes work as normal
• SOAP faults must use 500 status code
• SOAP response doesn't require SOAP request
• Response can in fact be empty
HTTP/1.1 200 Ok
Content-Type: text/xml; charset="utf-8“
Content-Length: nnnn
<SOAP:Envelope...
32
Purpose of SOAP Encoding
• Given a schema in any notation consistent with the data
model defined by SOAP, a schema for an XML grammar
may be constructed
Type
Modeling
Language
XML
Schema
33
Purpose of SOAP Encoding… 2
• Given a type-system schema and a particular graph of
values conforming to that schema, an XML instance may
be constructed.
XML
Schema
XML
Instance
Value
Graph
34
Purpose of SOAP Encoding… 3
• Given an XML instance produced in accordance with
these rules, and given also the original schema, a copy of
the original value graph may be constructed.
XML
Instance
Value
Graph
XML
Schema
35
Simple Example
<Address id="Address-3">
<street>28 Sea Dr #103</street>
<city>Unicity</city>
<state>CA</state>
</Address>
<Student id="Student-2567">
<name>Michael</name>
<dormaddr href="#Address-3"/>
<attends href="#Course-19"/>
<attends href="#Course-253"/>
</Student>
36
Basic Rules (in part)
• All values are represented as element content
• An element may be "independent" (top level of
serialization) or "embedded" (everything else)
• Values can be single-reference or multi-reference
• A multi-reference value is represented as the content of
an independent element. It has an unqualified attribute
named "id" and of type "ID".
• An accessor can point to a multi-reference value with a
local, unqualified attribute named "href" and of type "uri-
reference“
• The root attribute can be used to indicate roots that are
not true roots in a graph
37
Indicating the Type
• For each element containing a value, the type of the
value is represented by at least one of the following
conditions:
• The containing element instance contains an xsi:type
attribute,
• The containing element instance is itself contained
within an element containing a (possibly defaulted)
SOAP-ENC:arrayType attribute or
• The name of the element bears a definite relation to
the type, that type then determinable from a schema.
38
Simple Types
• A "simple type" is a class of simple values
• SOAP uses all the types found in the section "Built-in
data types" of "XML Schema Part 2: Datatypes"
• A simple value is represented as character data, that is,
without any sub-elements
39
Simple Type Examples
<element name="age" type="int"/>
<element name="height" type="float"/>
<element name="displacement"
type="negativeInteger"/>
<element name="color">
<simpleType base="xsd:string">
<enumeration value="Green"/>
<enumeration value="Blue"/>
</simpleType>
</element>
<age>45</age>
<height>5.9</height>
<displacement>-450</displacement>
<color>Blue</color>
40
Compound Types
• A “compound” type is a class of compound values
• Each related value is potentially distinguished by a role
name, ordinal or both (accessor)
• Supports traditional types like structs and arrays
• Supports nodes with with many distinct accessors, some
of which occur more than once
• Preserves order but doesn't require ordering distinction in
the underlying data model
41
Struct Compound Type
• A compound value in which accessor name is the only
distinction among member values, and no accessor has
the same name as any other
<e:Book>
<author>Henry Ford</author>
<preface>When I…</preface>
<intro>This is a book.</intro>
</e:Book>
42
Array Compound Type
• A compound value in which ordinal position serves as the
only distinction among member values
<SOAP-ENC:Array
SOAP-ENC:arrayType="xyz:Order[2]">
<Order>
<Product>Apple</Product>
<Price>1.56</Price>
</Order>
<Order>
<Product>Peach</Product>
<Price>1.48</Price>
</Order>
</SOAP-ENC:Array>
43
General Compound Type
• A compound value with a mixture of accessors
distinguished by name and accessors distinguished by
both name and ordinal position
<PurchaseLineItems>
<Order>
<Product>Apple</Product>
<Price>1.56</Price>
</Order>
<Order>
<Product>Peach</Product>
<Price>1.48</Price>
</Order>
</PurchaseLineItems>
44
Serializing Relationships
• The root element of the serialization serves only as lexical
container.
• Elements can reflect arcs or nodes
• Independent elements always reflect nodes
• Embedded elements always reflect arcs
• Element names correspond to node or arc labels
• Arcs are always encoded as embedded elements
45
1:1 Relationships
• A 1:1 relationship is expressed by simple containment.
For example, if a student attends a course, the canonical
XML looks like
<Student>
<name>Alice</name>
<attends>
<name>Greek</name>
</attends>
</Student>
46
1:n and n:1 Relationships
• A 1:many relationship is expressed by multiple elements
for the 1:many direction or single element for the many:1
direction.
<Teacher id="Teacher-1">
<name>Alice</name>
<teaches>
<name>Greek</name>
</teaches>
<teaches >
<name>English History</name>
</teaches>
</Teacher>
47
m:n Relationships
• A many:many relationship is expressed by using
references in both directions.
<Student id="Student-1">
<name>Alice<name>
<attends href="#Course-1"/>
<attends href="#Course-2"/>
</Student>
<Course id="Course-1">
<name>Greek</name>
<attendee href="Student-1"/>
</Course>
48
SOAP and RPC
• A method invocation is modeled as a struct
• A method response is modeled as a struct
• Struct contains an accessor for each [in] or [in/out] or
[out] parameter.
• The request struct is both named and typed identically to
the method name.
• The response struct name is not important
• The first accessor is the return value followed by the
parameters in the same order as in the method signature
49
Summary
• SOAP envelope provides
• Composability in the vertical (Shopping basket)
• Composability in the horizontal (Amtrak)
• SOAP can be used with many protocols
• Easy to deploy with existing infrastructure
• SOAP is fundamentally a one-way message
• Supports request/response, RPC etc.
• Your application decides what it is!

Weitere ähnliche Inhalte

Was ist angesagt?

Flex Messeging Services
Flex Messeging ServicesFlex Messeging Services
Flex Messeging Servicesravinxg
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in muleAnilKumar Etagowni
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?Vijay Prasad Gupta
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Servicesecosio GmbH
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIRajkattamuri
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-oldF K
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolMasud Rahman
 
Mule webservices in detail
Mule webservices in detailMule webservices in detail
Mule webservices in detailShahid Shaik
 
Service-Oriented Architecture
Service-Oriented ArchitectureService-Oriented Architecture
Service-Oriented ArchitectureSamantha Geitz
 

Was ist angesagt? (20)

Flex Messeging Services
Flex Messeging ServicesFlex Messeging Services
Flex Messeging Services
 
Simple object access protocol(soap )
Simple object access protocol(soap )Simple object access protocol(soap )
Simple object access protocol(soap )
 
Enterprise service bus part 1
Enterprise service bus part 1Enterprise service bus part 1
Enterprise service bus part 1
 
Web service
Web serviceWeb service
Web service
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in mule
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?
 
Enterprise Service Bus Part 2
Enterprise Service Bus Part 2Enterprise Service Bus Part 2
Enterprise Service Bus Part 2
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
Mule execution
Mule executionMule execution
Mule execution
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
Mule execution
Mule executionMule execution
Mule execution
 
Java web services
Java web servicesJava web services
Java web services
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
 
web programming
web programmingweb programming
web programming
 
Mule webservices in detail
Mule webservices in detailMule webservices in detail
Mule webservices in detail
 
WCF Introduction
WCF IntroductionWCF Introduction
WCF Introduction
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Service-Oriented Architecture
Service-Oriented ArchitectureService-Oriented Architecture
Service-Oriented Architecture
 

Andere mochten auch (20)

Seo
SeoSeo
Seo
 
Oracle real application_cluster
Oracle real application_clusterOracle real application_cluster
Oracle real application_cluster
 
Jsp
JspJsp
Jsp
 
Mule anypoint platform
Mule anypoint platformMule anypoint platform
Mule anypoint platform
 
Bpm
BpmBpm
Bpm
 
Soap
SoapSoap
Soap
 
Presentation of Tax
Presentation of Tax Presentation of Tax
Presentation of Tax
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Mule esb
Mule esbMule esb
Mule esb
 
Rest
RestRest
Rest
 
Restful api modeling language
Restful api modeling languageRestful api modeling language
Restful api modeling language
 
Mule esb
Mule esbMule esb
Mule esb
 
EXtensible Markup Language
EXtensible Markup LanguageEXtensible Markup Language
EXtensible Markup Language
 
Multiplatform
MultiplatformMultiplatform
Multiplatform
 
Buissness model analysis
Buissness model analysisBuissness model analysis
Buissness model analysis
 
Api desgin
Api desginApi desgin
Api desgin
 
Health triangle
Health triangleHealth triangle
Health triangle
 
Leadership today
Leadership todayLeadership today
Leadership today
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
 
Oracle Enterprise Repository
Oracle Enterprise RepositoryOracle Enterprise Repository
Oracle Enterprise Repository
 

Ähnlich wie Soap service

Web-Services!.pptx
Web-Services!.pptxWeb-Services!.pptx
Web-Services!.pptxssuserae0316
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPIMC Institute
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxsanaiftikhar23
 
Soap Standard
Soap StandardSoap Standard
Soap StandardKumar
 
Soa business centric and soap basic
Soa business centric and soap basicSoa business centric and soap basic
Soa business centric and soap basicJothi Lakshmi
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overviewRaveendra Bhat
 
SOAP - Simple Object Access Protocol
SOAP - Simple Object Access ProtocolSOAP - Simple Object Access Protocol
SOAP - Simple Object Access ProtocolAnushka Patil
 
Web services provide an organization without human supervision
Web services provide an organization without human  supervisionWeb services provide an organization without human  supervision
Web services provide an organization without human supervisionnandepovanhu
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.pptDr.Saranya K.G
 
unit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Archunit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Archsudharani127782
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Vibhawa Nirmal
 
Web service Introduction
Web service IntroductionWeb service Introduction
Web service IntroductionMadhukar Kumar
 

Ähnlich wie Soap service (20)

Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAP
 
Web-Services!.pptx
Web-Services!.pptxWeb-Services!.pptx
Web-Services!.pptx
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
 
Soap xp-wg
Soap xp-wgSoap xp-wg
Soap xp-wg
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Soap Standard
Soap StandardSoap Standard
Soap Standard
 
Soa business centric and soap basic
Soa business centric and soap basicSoa business centric and soap basic
Soa business centric and soap basic
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
SOAP - Simple Object Access Protocol
SOAP - Simple Object Access ProtocolSOAP - Simple Object Access Protocol
SOAP - Simple Object Access Protocol
 
Web services provide an organization without human supervision
Web services provide an organization without human  supervisionWeb services provide an organization without human  supervision
Web services provide an organization without human supervision
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
 
CS-802 Act-1.ppt
CS-802 Act-1.pptCS-802 Act-1.ppt
CS-802 Act-1.ppt
 
unit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Archunit -4 spring web services like SOA Arch
unit -4 spring web services like SOA Arch
 
Consuming SOAP
Consuming SOAPConsuming SOAP
Consuming SOAP
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface)
 
Web service Introduction
Web service IntroductionWeb service Introduction
Web service Introduction
 
Web services
Web servicesWeb services
Web services
 

Mehr von Prabhat gangwar

Mehr von Prabhat gangwar (20)

Middleware
MiddlewareMiddleware
Middleware
 
Pseudolocalization
PseudolocalizationPseudolocalization
Pseudolocalization
 
Mule anypoint studio
Mule anypoint studioMule anypoint studio
Mule anypoint studio
 
What is cluster analysis
What is cluster analysisWhat is cluster analysis
What is cluster analysis
 
clustering and load balancing
clustering and load balancingclustering and load balancing
clustering and load balancing
 
Middleware systems overview and introduction
Middleware systems overview and introductionMiddleware systems overview and introduction
Middleware systems overview and introduction
 
Gsm architecture
Gsm architectureGsm architecture
Gsm architecture
 
Oracle vs-mulesoft-api-manager-features
Oracle vs-mulesoft-api-manager-featuresOracle vs-mulesoft-api-manager-features
Oracle vs-mulesoft-api-manager-features
 
Introducing adf business components
Introducing adf business componentsIntroducing adf business components
Introducing adf business components
 
File transfer methods
File transfer methodsFile transfer methods
File transfer methods
 
Ftp tftp
Ftp tftpFtp tftp
Ftp tftp
 
Global warming
Global warmingGlobal warming
Global warming
 
Vedic mathmetics
Vedic mathmeticsVedic mathmetics
Vedic mathmetics
 
Trends
TrendsTrends
Trends
 
E commerce buissness-model
E commerce buissness-modelE commerce buissness-model
E commerce buissness-model
 
Effective communication skills
Effective communication skillsEffective communication skills
Effective communication skills
 
Office politics
Office politicsOffice politics
Office politics
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Add to the path on mac os x
Add to the path on mac os xAdd to the path on mac os x
Add to the path on mac os x
 
Cross platform mobile application devlopment
Cross platform mobile application devlopmentCross platform mobile application devlopment
Cross platform mobile application devlopment
 

Kürzlich hochgeladen

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Kürzlich hochgeladen (20)

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 

Soap service

  • 1. Prabhat Gangwar, <prabhat.gang@gmail.com> Introduction to SOAP A Walkthrough of Core Technical Concepts
  • 2. 2 What is SOAP? • SOAP is a simple, lightweight XML protocol for exchanging structured and typed information on the Web • Overall design goal: KISS • Can be implemented in a weekend • Stick to absolutely minimum of functionality • Make it Modular and Extensible • No application semantics and no transport semantics • Think “XML datagram”
  • 3. 3 SOAP Contains Four Parts: • An extensible envelope expressing (mandatory) • what features and services are represented in a message; • who should deal with them, • whether they are optional or mandatory. • A set of encoding rules for data (optional) • Exchange instances of application-defined data types and directed graphs • Uniform model for serializing abstract data models that can not directly be expressed in XML schema • A Convention for representation RPC (optional) • How to make calls and responses • A protocol binding to HTTP and HTTP-EF (optional)
  • 4. 4 SOAP Envelope SOAP Example in HTTP HTTP Request SOAP-HTTP Binding SOAP Header SOAP Body POST /Accounts/Henrik HTTP/1.1 Host: www.webservicebank.com Content-Length: nnnn Content-Type: text/xml; charset="utf-8" SOAPAction: "Some-URI" <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Header> <t:Transaction xmlns:t="some-URI" SOAP:mustUnderstand="1"> 5 </t:Transaction> </SOAP:Header> <SOAP:Body> <m:Deposit xmlns:m="Some-URI"> <m:amount>200</m:amount> </m:Deposit> </SOAP:Body> </SOAP:Envelope>
  • 5. 5 SOAP Example in SIP SOAP Envelope SIP Request SOAP-SIP Binding SOAP Body SERVICE sip:broker.ubiquity.net SIP/2.0 To: sip:broker.ubiquity.net From: sip:proxy.ubiquity.net Call-ID:648324@193.195.52.30 CSeq: 1 SERVICE Via: SIP/2.0/UDP proxy.ubiquity.net Content-Type: text/xml Content-Length: 381 <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope” SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Body> <m:SetCreditStatus xmlns:m="http://www.ubiquity.net/sipservices"> <m:user>sip:jo@ubiquity.net</m:user> <m:status>super</m:status> </m:SetCreditStatus> </SOAP:Body> </SOAP:Envelope>
  • 6. 6 … or SOAP by Itself… <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope” SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Header> <m:MessageInfo xmlns:m="http://www.info.org/soap/message"> <m:to href="mailto:you@your.com"/> <m:from href="mailto:me@my.com"/> <m:contact href="mailto:someone@my.com"> </m:MessageInfo> </SOAP:Header> <SOAP:Body> <msg:Message xmlns:m="http://www.info.org/soap/message"> <msg:subject>Your house is on fire!</msg:subject> <msg:feed href="ram://livenews.com/yourhouse"/> </msg:Message> </SOAP:Body> </SOAP:Envelope>
  • 7. 7 SOAP Stack Examples SOAP HTTP TCP Protocol Binding SOAP SIP TCP Protocol Binding SOAP SIP UDP Protocol Binding SOAP MIME Multipart Protocol Binding … SOAP SMTP TCP Protocol Binding SOAP TCP Protocol Binding SOAP UDP Protocol Binding ServicesServices Services Services Services Services Services
  • 8. 8 Note Again: SOAP is a Protocol! • What does this mean? • It is not a distributed object system • It is not an RPC system • It is not even a Web application • Your application decides what your application is! • You can build a tightly coupled system …or… • You can build a loosely coupled system • Tunneling is a property of the application, not the protocol
  • 9. 9 SOAP is Designed for Evolvability • How are features and services deployed in the Web? • Often by extending existing applications • Spreading from in the small to the large over time • This means that: • Applications have different capabilities at all times • We have to support this • This requires that: • Applications supporting a particular feature or service should be able to employ this with no prior agreement; • Applications can require that the other party either understand and abide by the new feature or service or abort the operation
  • 10. 10 Why Not Roll My Own XML Protocol? • SOAP allows you to define your particular feature or service in such a way that it can co-exist with other features and services within a SOAP message • What is a feature or a service? • Authentication service • Payment service • Security service • Transaction management service • Privacy service • Not owning the message means easier deployment and better interoperability
  • 11. 11 What is Interoperability? • Interoperability is the intersection of features and service supported by two or more communicating peers: Peer BPeer A Interoperability
  • 12. 12 Extensibility vs. Evolvability • Extensibility: Cost pr new feature/service increases over time • Evolvability: Cost pr new feature/service is flat Time Time Feature set 3 Feature set 3 Feature set 2 Feature set 2 Feature set 1 Feature set 1
  • 13. 13 Interoperability vs. Evolvability • As evolvability goes up, interoperability goes down Interoperability Evolvability SOAP
  • 14. 14 SOAP and Composability • We are looking at two types of composability of features and services within a message: • Vertical: multiple features and services can exist simultaneously within the same message • Horizontal: features and services within a message can be intended for different recipients. • This is not boxcarring but rather the HTTP proxy model and as we shall see, the SOAP messaging model as well
  • 15. 15 Vertical Composability • Allows for independent features to co-exist <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope” SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Header> <a:authentication …>…</a:authentication> <s:security …> … </s:security> <t:transactions …> … </t:transactions> <p:payment …> … </p:payment> </SOAP:Header> <SOAP:Body> <m:mybody> … </m:mybody> </SOAP:Body> </SOAP:Envelope> <a:authentication …>…</a:authentication> <s:security …> … </s:security> <t:transactions …> … </t:transactions> <p:payment …> … </p:payment> <m:mybody> … </m:mybody>
  • 16. 16 Horizontal Composability • Allows for intermediaries <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope” SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Header> <a:authentication actor="intermediary a"…>…</a:authentication> <s:security actor="intermediary b"…> … </s:security> <t:transactions actor="intermediary c"…> … </t:transactions> <p:payment actor="destination"…> … </p:payment> </SOAP:Header> <SOAP:Body> <m:mybody> … </m:mybody> </SOAP:Body> </SOAP:Envelope> <a:authentication actor="intermediary a"…>…</a:authentication> <s:security actor="intermediary b"…> … </s:security> <t:transactions actor="intermediary c"…> … </t:transactions> <p:payment actor="destination"…> … </p:payment> <m:mybody> … </m:mybody>
  • 17. 17 Modularity through XML Namespaces • The SOAP envelope namespace • http://schemas.xmlsoap.org/soap/envelope/ • Resolves to the SOAP Envelope Schema • The SOAP encoding namespace • http://schemas.xmlsoap.org/soap/encoding/ • Resolves to the SOAP Encoding Schema • Separate namespaces help enforce modularity • SOAP Envelope Schema provides formal definition of Envelope
  • 18. 18 The SOAP Envelope • A SOAP envelope defines a SOAP message • Basic unit of exchange between SOAP processors • SOAP messages are one-way transmissions • From sender through intermediaries to receiver • Often combined to implement patterns such as request/response • Messages are routed along a "message path" • Allows for processing at one or more intermediate nodes in addition to the ultimate destination node. • A node is a SOAP processor and is identified by a URI • Envelopes can be nested • Only outer envelope is "active" to the receiving SOAP processor
  • 19. 19 SOAP Headers • Allows for modular addition of features and services • Open-ended set of headers • Authentication, privacy, security etc. etc. • Can address any SOAP processor using the "actor" attribute • Can be optional/mandatory using the "mustUnderstand" attribute Start web://bar web://toto web://foo
  • 20. 20 Semantics of SOAP Headers • Contract between sender and recipient • Recipient is described by "actor" attribute • Allows for different types of negotiation: • Take it or leave it directly supported • Let's talk about it can be built on top • And for different settings: • Server dictated • Peer-to-peer • Dictated by third party
  • 21. 21 The SOAP actor Attribute • The "Actor" attribute is a generalization of the HTTP Connection header field • Instead of hop-by-hop vs. end-to-end, the actor attribute can address any SOAP processor because it is a URI • Special cases: • "next hop" has a special URI assigned to it • "end" is the default destination for a header • "end" is the destination for the body
  • 22. 22 The SOAP mustUnderstand Attribute • The "mustUnderstand" is the same as "mandatory" in the HTTP Extension Framework • Requires that the receiving SOAP processor must accept, understand and obey semantics of header or fail • It is up to the application to define what "understand" means • This allows old applications to gracefully fail on services that they do not understand
  • 23. 23 SOAP Body • Special case of header • Default contract between sender and ultimate recipient • Different from HTTP's header/body separation • Defined as a header with attributes set to: • Implicit mustUnderstand attribute is always "yes" • Implicit actor attribute is always "the end" Start web://bar web://toto web://foo
  • 24. 24 SOAP Fault • The SOAP Fault mechanism is designed to support the composability model • Is not a scarce resource as in HTTP where there can be only one (the Highlander principle) • A SOAP message can carry one SOAP Fault element • Must be placed in the Body of the message • The Fault Detail element carries information for faults resulting from the body • Detail information for faults resulting from headers are carried in the header • The SOAP fault code extension mechanism is for SOAP only • Application faults should use existing SOAP fault codes • Client code is for request faults • Server code is for processing faults
  • 25. 25 SOAP Fault Example • A SOAP message containing an authentication service: <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope” SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Header> <m:Authentication xmlns:m="http://www.auth.org/simple"> <m:credentials>Henrik</m:credentials> </m:Authentication> </SOAP:Header> <SOAP:Body> … body goes here … </SOAP:Body> </SOAP:Envelope>
  • 26. 26 SOAP Fault Example… 2 • …results in a fault because the credentials were bad: <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope” SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP:Header> <m:Authentication xmlns:m="http://www.auth.org/simple"> <m:realm>Magic Kindom</m:realm> </m:Authentication> </SOAP:Header> <SOAP:Body> <SOAP:Fault> <SOAP:faultcode>SOAP:Client</faultcode> <SOAP:faultstring>Client Error</faultstring> </SOAP:Fault> </SOAP:Body> </SOAP:Envelope>
  • 27. 27 SOAP Versioning Model • Bad experiences with version numbers in decentralized environments • Extremely confusing in HTTP – whole RFC on the topic • Typical uses of number based "versioning" • Backwards compatible (minor version number) • Backwards incompatible (major version number) • SOAP supports "minor" versioning within the envelope using header and body elements • The SOAP composability model ("WYSIWYG on the wire") • The SOAP Envelope Namespace URI defines the "major" of the SOAP envelope • Changing Namespace URI is equivalent to change major version number • Possible to negotiate major versioning change using SOAP header • Equivalent to the HTTP Upgrade header field
  • 28. 28 SOAP and "Binary" Data • "Binary" can in fact mean any data that is to be tunneled through SOAP • Encrypted data, images, XML documents, SOAP envelopes as data • Can be carried in two ways • Within the envelope as binary blob • Referenced from within the SOAP envelope • References can point to anything including • MIME multipart, HTTP accessible resources etc. • Integrity can be obtained through manifest
  • 29. 29 Binding to HTTP • The purpose of the HTTP protocol binding is two-fold • To ensure that SOAP is carried in a way that is consistent with HTTP’s message model • Intent is not to break HTTP • To indicate to HTTP servers that this is a SOAP message • Allows HTTP servers to act on a SOAP message without knowing SOAP • Binding only works for HTTP POST requests • SOAP intermediary is not the same as HTTP intermediary • Only HTTP origin server can be SOAP intermediary
  • 30. 30 HTTP Request POST /Accounts/Henrik HTTP/1.1 Content-Type: text/xml; charset="utf-8“ Content-Length: nnnn SOAPAction: "http://electrocommerce.org/MyMessage" <SOAP:Envelope... • Use HTTP POST request method name • Use the SOAPAction HTTP header field • It cannot be computed – the sender must know • It should indicate the intent – not the destination • SOAP request doesn't require SOAP response SOAPAction: "http://electrocommerce.org/MyMessage"
  • 31. 31 HTTP Response • Successful responses can 2xx status codes • All 3xx, 4xx, and 5xx status codes work as normal • SOAP faults must use 500 status code • SOAP response doesn't require SOAP request • Response can in fact be empty HTTP/1.1 200 Ok Content-Type: text/xml; charset="utf-8“ Content-Length: nnnn <SOAP:Envelope...
  • 32. 32 Purpose of SOAP Encoding • Given a schema in any notation consistent with the data model defined by SOAP, a schema for an XML grammar may be constructed Type Modeling Language XML Schema
  • 33. 33 Purpose of SOAP Encoding… 2 • Given a type-system schema and a particular graph of values conforming to that schema, an XML instance may be constructed. XML Schema XML Instance Value Graph
  • 34. 34 Purpose of SOAP Encoding… 3 • Given an XML instance produced in accordance with these rules, and given also the original schema, a copy of the original value graph may be constructed. XML Instance Value Graph XML Schema
  • 35. 35 Simple Example <Address id="Address-3"> <street>28 Sea Dr #103</street> <city>Unicity</city> <state>CA</state> </Address> <Student id="Student-2567"> <name>Michael</name> <dormaddr href="#Address-3"/> <attends href="#Course-19"/> <attends href="#Course-253"/> </Student>
  • 36. 36 Basic Rules (in part) • All values are represented as element content • An element may be "independent" (top level of serialization) or "embedded" (everything else) • Values can be single-reference or multi-reference • A multi-reference value is represented as the content of an independent element. It has an unqualified attribute named "id" and of type "ID". • An accessor can point to a multi-reference value with a local, unqualified attribute named "href" and of type "uri- reference“ • The root attribute can be used to indicate roots that are not true roots in a graph
  • 37. 37 Indicating the Type • For each element containing a value, the type of the value is represented by at least one of the following conditions: • The containing element instance contains an xsi:type attribute, • The containing element instance is itself contained within an element containing a (possibly defaulted) SOAP-ENC:arrayType attribute or • The name of the element bears a definite relation to the type, that type then determinable from a schema.
  • 38. 38 Simple Types • A "simple type" is a class of simple values • SOAP uses all the types found in the section "Built-in data types" of "XML Schema Part 2: Datatypes" • A simple value is represented as character data, that is, without any sub-elements
  • 39. 39 Simple Type Examples <element name="age" type="int"/> <element name="height" type="float"/> <element name="displacement" type="negativeInteger"/> <element name="color"> <simpleType base="xsd:string"> <enumeration value="Green"/> <enumeration value="Blue"/> </simpleType> </element> <age>45</age> <height>5.9</height> <displacement>-450</displacement> <color>Blue</color>
  • 40. 40 Compound Types • A “compound” type is a class of compound values • Each related value is potentially distinguished by a role name, ordinal or both (accessor) • Supports traditional types like structs and arrays • Supports nodes with with many distinct accessors, some of which occur more than once • Preserves order but doesn't require ordering distinction in the underlying data model
  • 41. 41 Struct Compound Type • A compound value in which accessor name is the only distinction among member values, and no accessor has the same name as any other <e:Book> <author>Henry Ford</author> <preface>When I…</preface> <intro>This is a book.</intro> </e:Book>
  • 42. 42 Array Compound Type • A compound value in which ordinal position serves as the only distinction among member values <SOAP-ENC:Array SOAP-ENC:arrayType="xyz:Order[2]"> <Order> <Product>Apple</Product> <Price>1.56</Price> </Order> <Order> <Product>Peach</Product> <Price>1.48</Price> </Order> </SOAP-ENC:Array>
  • 43. 43 General Compound Type • A compound value with a mixture of accessors distinguished by name and accessors distinguished by both name and ordinal position <PurchaseLineItems> <Order> <Product>Apple</Product> <Price>1.56</Price> </Order> <Order> <Product>Peach</Product> <Price>1.48</Price> </Order> </PurchaseLineItems>
  • 44. 44 Serializing Relationships • The root element of the serialization serves only as lexical container. • Elements can reflect arcs or nodes • Independent elements always reflect nodes • Embedded elements always reflect arcs • Element names correspond to node or arc labels • Arcs are always encoded as embedded elements
  • 45. 45 1:1 Relationships • A 1:1 relationship is expressed by simple containment. For example, if a student attends a course, the canonical XML looks like <Student> <name>Alice</name> <attends> <name>Greek</name> </attends> </Student>
  • 46. 46 1:n and n:1 Relationships • A 1:many relationship is expressed by multiple elements for the 1:many direction or single element for the many:1 direction. <Teacher id="Teacher-1"> <name>Alice</name> <teaches> <name>Greek</name> </teaches> <teaches > <name>English History</name> </teaches> </Teacher>
  • 47. 47 m:n Relationships • A many:many relationship is expressed by using references in both directions. <Student id="Student-1"> <name>Alice<name> <attends href="#Course-1"/> <attends href="#Course-2"/> </Student> <Course id="Course-1"> <name>Greek</name> <attendee href="Student-1"/> </Course>
  • 48. 48 SOAP and RPC • A method invocation is modeled as a struct • A method response is modeled as a struct • Struct contains an accessor for each [in] or [in/out] or [out] parameter. • The request struct is both named and typed identically to the method name. • The response struct name is not important • The first accessor is the return value followed by the parameters in the same order as in the method signature
  • 49. 49 Summary • SOAP envelope provides • Composability in the vertical (Shopping basket) • Composability in the horizontal (Amtrak) • SOAP can be used with many protocols • Easy to deploy with existing infrastructure • SOAP is fundamentally a one-way message • Supports request/response, RPC etc. • Your application decides what it is!