SlideShare a Scribd company logo
1 of 25
Web Services Using SOAP
What are “Web Services”?
• IBM
– “A Web service is an interface that describes a collection
of operations that are network accessible through
standardized XML messaging”
• Microsoft: XML Web Services
– “.. expose useful functionality to Web users through a
standard Web protocol”
– “.. provide a way to describe their interfaces in enough
detail to allow a user to build a client application to talk
to them”
– “.. are registered so that potential users can find them
easily”
Why Web Services?
• From business standpoint
– Integration
• Within an organization
• Between companies
• Allows time/cost efficiencies
– Purchase orders
– Answering inquiries
– Processing shipment requests
• Do this without locking in to a single partner
Web Service Architecture
• Service-Oriented Architecture
Service
Registry
Service
Requestor
Service
Provider
Find Publish
Bind
Architecture II
• All the technologies are XML based …
Registry
(UDDI)
Service
Requestor
Service
Provider
Find
Publish
Bind
(SOAP)
(SOAP)
(WSDL)
XML Leveraging Features
• XML Namespaces
– Collision
• Common XML element names
– Application specific or embedded in message?
– Allows composition of multiple XML documents
• Identifies elements belonging to the same document
type
XML Leveraging Features II
• XML Schemas
– Alternative to DTDs for describing document
structure
– Written in XML
• Simple types
• Complex types
– Reusable
• Intended to be used with namespaces
SOAP
• Simple Object Access Protocol
• Web service messaging and invocation
• 2nd Generation XML Protocol
– Takes advantage of
• XML Namespaces
• XML Schema
First Generation XML Protocol
• Based on XML 1.0
• Example: XML-RPC
– Introduced by Userland in 1998
– Uses HTTP as underlying transport
<methodResponse>
<params>
<param>
<value>
<string>twenty-eight</string>
</value>
</param>
</params>
</methodResponse>
Call Response
<methodCall>
<methodName>NumberToText</methodName>
<params>
<param>
<value><i4>28</i4></value>
</param>
</params>
</methodCall>
First Gen. XML Protocol Issues
• Extensibility
– All protocol architects had to agree for changes
– Avoid with namespaces
• Datatyping
– Single DTDs
• Limited in use of XML elements
• Descriptive nature of XML sacrificed
– XML schema is a better solution
SOAP History
1998 • Term SOAP coined at Microsoft
1999 • Microsoft works with BizTalk to release SOAP 0.9
• Submitted to IETF
• SOAP 1.0 released in December
2000 • SOAP 1.1 submitted to W3C with IBM
• IBM releases a Java SOAP implementation
• Sun starts work on Web services in J2EE
2001
• SOAP 1.2 released by XML Protocol working group at W3C
Currently, about 80+ SOAP implementations available
including Apple…
SOAP Messaging Layers
App API
SOAP, XML Processing
App API
SOAP, XML Processing
SOAP Message SOAP Message
HTTP HTTP
Developer
SOAP Service
Provider
HTTP
Client ProviderView
SOAP Message
<Envelope>
</Envelope>
<Header>
</Header>
<Body>
</Body>
<?xml version="1.0" encoding="UTF-8"?>
SOAP Envelope
• Root element
• Mandatory
• Does not expose any protocol versions
– Protocol version is the URI of SOAP envelope
namespace
– encodingStyle attribute for complex types
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
xmlns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
SOAP Header
• Optional
• Allows packaging of information orthogonal to
message
– Transactions
• Authentication information
• Account information
• SOAP-ENV:mustUnderstand
SOAP-ENV:mustUnderstand
• Attribute for Header element
• Value 0 – skip this element if it doesn’t make
sense
• Value 1 – must fail if it doesn’t make sense
– Ensures recipients be aware of important protocol
extensions
<SOAP-ENV:Header>
<t:client xmlns:t=“Some-URI”
SOAP-ENV:mustUnderstand=“0”>
sacharya@inktomi.com
</t:client>
</SOAP-ENV:Header>
SOAP Body
• Can contain arbitrary XML
• Conventions for
– RPCs
– Faults
• Faultcode – lookup string
• Faultstring – human readable string
• Faultactor – where in the message path
• Detail – optional
– Data encoding
Data encoding in SOAP
• SOAP provides default encoding schema
– Why reinvent the wheel?
• Simple data types
– Use “xsi:type”
– String, floats etc
• Complex data types
– SOAP arrays
– Structs: compound types
• Data referencing
– Href and id attributes
Data encoding in SOAP
• Binary data
– Base64 encoding
• Can roll your own schema
– encodingStyle
– Interoperability issues
SOAP Protocol Binding: HTTP
<Envelope>
<Header>
</Header>
<Body>
<LookupPerson …>
</LookupPerson>
</Body>
<?xml version="1.0" encoding="UTF-8"?>
</Envelope>
POST /ServiceLoc HTTP/1.1
Host: www.foo.com
Content-Type: text/xml; charset=“utf-8”
Content-Length: nnnn
SOAPAction: “Directory/Service”
Out-of-
message
context
In-message
context
Sample RPC Call
Other SOAP Protocol Bindings
• HTTPS
– Similar to HTTP
• Use POST
• Return 200 for success
• 500 for failure + SOAP fault
• SOAPAction HTTP header for hint
• MIME media type: text/html
• SMTP
• SOAP messages with Attachments
SOAP RPC Example: getQuote
import SOAP
server = SOAP.SOAPProxy("http://services.xmethods.com:80/soap",
namespace = 'urn:xmethods-delayed-quotes')
print "IBM>>", server.getQuote(symbol = 'IBM')
RPC Invocation Message
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getQuote
xmlns:ns1="urn:xmethods-delayed-quotes" SOAP-ENC:root="1">
<symbol xsi:type="xsd:string">IBM</symbol>
</ns1:getQuote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
RPC Reply Message
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<soap:Body>
<n:getQuoteResponse xmlns:n='urn:xmethods-delayed-quotes'>
<Result xsi:type='xsd:float'>107.89</Result>
</n:getQuoteResponse>
</soap:Body>
</soap:Envelope>
Roadmap
Registry
(UDDI)
Service
Requestor
Service
Provider
Find
Publish
Bind
(SOAP)
(SOAP)
(WSDL)

More Related Content

What's hot

REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
Rule_Financial
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
Bhavendra Chavan
 

What's hot (19)

Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 
On being RESTful
On being RESTfulOn being RESTful
On being RESTful
 
UDDI in Mule Esb
UDDI in Mule EsbUDDI in Mule Esb
UDDI in Mule Esb
 
Web services
Web servicesWeb services
Web services
 
Web Services
Web ServicesWeb Services
Web Services
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
 
OUGF OSGi/Flex
OUGF OSGi/FlexOUGF OSGi/Flex
OUGF OSGi/Flex
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
 
JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...
JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...
JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...
 
Cetpa dotnet taining
Cetpa dotnet tainingCetpa dotnet taining
Cetpa dotnet taining
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
JavaCro'15 - Secure Web Services Development - Askar AkhmerovJavaCro'15 - Secure Web Services Development - Askar Akhmerov
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
 
A CMD Core Model for CLARIN Web Services
A CMD Core Model for CLARIN Web ServicesA CMD Core Model for CLARIN Web Services
A CMD Core Model for CLARIN Web Services
 
Rest assured
Rest assuredRest assured
Rest assured
 

Viewers also liked

13 perpaduan asas kestabilan & cabaran
13 perpaduan asas kestabilan & cabaran13 perpaduan asas kestabilan & cabaran
13 perpaduan asas kestabilan & cabaran
Zahratul Jannah
 
Cadzco La Gloria
Cadzco La GloriaCadzco La Gloria
Cadzco La Gloria
Jeronimo
 

Viewers also liked (17)

linkpresent
linkpresentlinkpresent
linkpresent
 
1
11
1
 
13 perpaduan asas kestabilan & cabaran
13 perpaduan asas kestabilan & cabaran13 perpaduan asas kestabilan & cabaran
13 perpaduan asas kestabilan & cabaran
 
Aide compubase.biz: Ciblez vos partenaires
Aide compubase.biz: Ciblez vos partenairesAide compubase.biz: Ciblez vos partenaires
Aide compubase.biz: Ciblez vos partenaires
 
Digital Analytics Association Symposium- Research, Analytics and Testing for ...
Digital Analytics Association Symposium- Research, Analytics and Testing for ...Digital Analytics Association Symposium- Research, Analytics and Testing for ...
Digital Analytics Association Symposium- Research, Analytics and Testing for ...
 
Cadzco La Gloria
Cadzco La GloriaCadzco La Gloria
Cadzco La Gloria
 
Сторителлинг в интернете как и зачем рассказывать о себе и своих проектах
Сторителлинг в интернете  как и зачем рассказывать о себе и своих проектахСторителлинг в интернете  как и зачем рассказывать о себе и своих проектах
Сторителлинг в интернете как и зачем рассказывать о себе и своих проектах
 
Digital Health & Wellness Summit @ Mobile World Congress 2016
Digital Health & Wellness Summit @ Mobile World Congress 2016Digital Health & Wellness Summit @ Mobile World Congress 2016
Digital Health & Wellness Summit @ Mobile World Congress 2016
 
Роман Квартальнов, CEO Zephyrlab — Как влияет подача проекта на образ компани...
Роман Квартальнов, CEO Zephyrlab — Как влияет подача проекта на образ компани...Роман Квартальнов, CEO Zephyrlab — Как влияет подача проекта на образ компани...
Роман Квартальнов, CEO Zephyrlab — Как влияет подача проекта на образ компани...
 
La belgique
La belgiqueLa belgique
La belgique
 
Digital Health & Wellness Summit @ Mobile World Congress 2016
Digital Health & Wellness Summit @ Mobile World Congress 2016Digital Health & Wellness Summit @ Mobile World Congress 2016
Digital Health & Wellness Summit @ Mobile World Congress 2016
 
ISDEF — Роман Квартальнов
ISDEF — Роман Квартальнов ISDEF — Роман Квартальнов
ISDEF — Роман Квартальнов
 
La campaña de Obama
La campaña de ObamaLa campaña de Obama
La campaña de Obama
 
Saliva and its role in orthodontics
Saliva and its role in orthodonticsSaliva and its role in orthodontics
Saliva and its role in orthodontics
 
Productivity in the Container Port Business - Focus on the Mediterranean Range
Productivity in the Container Port Business - Focus on the Mediterranean RangeProductivity in the Container Port Business - Focus on the Mediterranean Range
Productivity in the Container Port Business - Focus on the Mediterranean Range
 
morden self healing polymer technology
morden self healing polymer technologymorden self healing polymer technology
morden self healing polymer technology
 
Informationssicherheit - Checkliste für einen schnellen Überblick über die Sc...
Informationssicherheit - Checkliste für einen schnellen Überblick über die Sc...Informationssicherheit - Checkliste für einen schnellen Überblick über die Sc...
Informationssicherheit - Checkliste für einen schnellen Überblick über die Sc...
 

Similar to Web services soap

Web services protocols
Web services protocolsWeb services protocols
Web services protocols
Jin Castor
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
Dr.Saranya K.G
 
SOA and WCF (Windows Communication Foundation) basics
SOA and WCF (Windows Communication Foundation) basicsSOA and WCF (Windows Communication Foundation) basics
SOA and WCF (Windows Communication Foundation) basics
Yaniv Pessach
 

Similar to Web services soap (20)

Web services protocols
Web services protocolsWeb services protocols
Web services protocols
 
SOAP Service in Mule Esb
SOAP Service in Mule EsbSOAP Service in Mule Esb
SOAP Service in Mule Esb
 
WebServices introduction in Mule
WebServices introduction in MuleWebServices introduction in Mule
WebServices introduction in Mule
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
 
WebServices
WebServicesWebServices
WebServices
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
 
Web service architecture
Web service architectureWeb service architecture
Web service architecture
 
oracle service bus
oracle service busoracle service bus
oracle service bus
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and development
 
Web services
Web servicesWeb services
Web services
 
SOA standards
SOA standardsSOA standards
SOA standards
 
Ntg web services
Ntg   web servicesNtg   web services
Ntg web services
 
Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedara
 
Web services for banks
Web services for banksWeb services for banks
Web services for banks
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
SOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIESSOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIES
 
Web services
Web servicesWeb services
Web services
 
SOA and WCF (Windows Communication Foundation) basics
SOA and WCF (Windows Communication Foundation) basicsSOA and WCF (Windows Communication Foundation) basics
SOA and WCF (Windows Communication Foundation) basics
 
Windows 8 Metro apps and the outside world
Windows 8 Metro apps and the outside worldWindows 8 Metro apps and the outside world
Windows 8 Metro apps and the outside world
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 

More from Khan625

More from Khan625 (20)

Mapping and listing in mule
Mapping and listing in muleMapping and listing in mule
Mapping and listing in mule
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Jenkins Build System
Jenkins Build SystemJenkins Build System
Jenkins Build System
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with Maven
 
Web services uddi
Web services uddiWeb services uddi
Web services uddi
 
Maven
Maven Maven
Maven
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groups
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Data weave
Data weave Data weave
Data weave
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Mule esb
Mule esbMule esb
Mule esb
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
 
Mule with quartz
Mule with quartzMule with quartz
Mule with quartz
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Web services soap

  • 2. What are “Web Services”? • IBM – “A Web service is an interface that describes a collection of operations that are network accessible through standardized XML messaging” • Microsoft: XML Web Services – “.. expose useful functionality to Web users through a standard Web protocol” – “.. provide a way to describe their interfaces in enough detail to allow a user to build a client application to talk to them” – “.. are registered so that potential users can find them easily”
  • 3. Why Web Services? • From business standpoint – Integration • Within an organization • Between companies • Allows time/cost efficiencies – Purchase orders – Answering inquiries – Processing shipment requests • Do this without locking in to a single partner
  • 4. Web Service Architecture • Service-Oriented Architecture Service Registry Service Requestor Service Provider Find Publish Bind
  • 5. Architecture II • All the technologies are XML based … Registry (UDDI) Service Requestor Service Provider Find Publish Bind (SOAP) (SOAP) (WSDL)
  • 6. XML Leveraging Features • XML Namespaces – Collision • Common XML element names – Application specific or embedded in message? – Allows composition of multiple XML documents • Identifies elements belonging to the same document type
  • 7. XML Leveraging Features II • XML Schemas – Alternative to DTDs for describing document structure – Written in XML • Simple types • Complex types – Reusable • Intended to be used with namespaces
  • 8. SOAP • Simple Object Access Protocol • Web service messaging and invocation • 2nd Generation XML Protocol – Takes advantage of • XML Namespaces • XML Schema
  • 9. First Generation XML Protocol • Based on XML 1.0 • Example: XML-RPC – Introduced by Userland in 1998 – Uses HTTP as underlying transport <methodResponse> <params> <param> <value> <string>twenty-eight</string> </value> </param> </params> </methodResponse> Call Response <methodCall> <methodName>NumberToText</methodName> <params> <param> <value><i4>28</i4></value> </param> </params> </methodCall>
  • 10. First Gen. XML Protocol Issues • Extensibility – All protocol architects had to agree for changes – Avoid with namespaces • Datatyping – Single DTDs • Limited in use of XML elements • Descriptive nature of XML sacrificed – XML schema is a better solution
  • 11. SOAP History 1998 • Term SOAP coined at Microsoft 1999 • Microsoft works with BizTalk to release SOAP 0.9 • Submitted to IETF • SOAP 1.0 released in December 2000 • SOAP 1.1 submitted to W3C with IBM • IBM releases a Java SOAP implementation • Sun starts work on Web services in J2EE 2001 • SOAP 1.2 released by XML Protocol working group at W3C Currently, about 80+ SOAP implementations available including Apple…
  • 12. SOAP Messaging Layers App API SOAP, XML Processing App API SOAP, XML Processing SOAP Message SOAP Message HTTP HTTP Developer SOAP Service Provider HTTP Client ProviderView
  • 14. SOAP Envelope • Root element • Mandatory • Does not expose any protocol versions – Protocol version is the URI of SOAP envelope namespace – encodingStyle attribute for complex types <SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  • 15. SOAP Header • Optional • Allows packaging of information orthogonal to message – Transactions • Authentication information • Account information • SOAP-ENV:mustUnderstand
  • 16. SOAP-ENV:mustUnderstand • Attribute for Header element • Value 0 – skip this element if it doesn’t make sense • Value 1 – must fail if it doesn’t make sense – Ensures recipients be aware of important protocol extensions <SOAP-ENV:Header> <t:client xmlns:t=“Some-URI” SOAP-ENV:mustUnderstand=“0”> sacharya@inktomi.com </t:client> </SOAP-ENV:Header>
  • 17. SOAP Body • Can contain arbitrary XML • Conventions for – RPCs – Faults • Faultcode – lookup string • Faultstring – human readable string • Faultactor – where in the message path • Detail – optional – Data encoding
  • 18. Data encoding in SOAP • SOAP provides default encoding schema – Why reinvent the wheel? • Simple data types – Use “xsi:type” – String, floats etc • Complex data types – SOAP arrays – Structs: compound types • Data referencing – Href and id attributes
  • 19. Data encoding in SOAP • Binary data – Base64 encoding • Can roll your own schema – encodingStyle – Interoperability issues
  • 20. SOAP Protocol Binding: HTTP <Envelope> <Header> </Header> <Body> <LookupPerson …> </LookupPerson> </Body> <?xml version="1.0" encoding="UTF-8"?> </Envelope> POST /ServiceLoc HTTP/1.1 Host: www.foo.com Content-Type: text/xml; charset=“utf-8” Content-Length: nnnn SOAPAction: “Directory/Service” Out-of- message context In-message context Sample RPC Call
  • 21. Other SOAP Protocol Bindings • HTTPS – Similar to HTTP • Use POST • Return 200 for success • 500 for failure + SOAP fault • SOAPAction HTTP header for hint • MIME media type: text/html • SMTP • SOAP messages with Attachments
  • 22. SOAP RPC Example: getQuote import SOAP server = SOAP.SOAPProxy("http://services.xmethods.com:80/soap", namespace = 'urn:xmethods-delayed-quotes') print "IBM>>", server.getQuote(symbol = 'IBM')
  • 23. RPC Invocation Message <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes" SOAP-ENC:root="1"> <symbol xsi:type="xsd:string">IBM</symbol> </ns1:getQuote> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
  • 24. RPC Reply Message <?xml version='1.0' encoding='UTF-8'?> <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' xmlns:xsd='http://www.w3.org/1999/XMLSchema' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <soap:Body> <n:getQuoteResponse xmlns:n='urn:xmethods-delayed-quotes'> <Result xsi:type='xsd:float'>107.89</Result> </n:getQuoteResponse> </soap:Body> </soap:Envelope>