SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Introduction to Web Services
Protocols
Talk title date 2
Communication and standards
Efficient (or indeed any)
communication is dependent on a
shared vocabulary and grammar.
Because web services deals with
inter-organisation communication
these must be universal standards.
Talk title date 3
Underlying standards
The basic standards for web services are:
XML (Extensible Markup Language)
SOAP (simple object access protocol)
WSDL (web services description language)
UDDI (universal description, discovery and
integration)
Talk title date 4
The state of standards
XML 1.0 fairly stable, although Schema are in the process
of replacing DTDs (currently Schema 1.1 being worked on).
SOAP 1.2
WSDL 2.0 (coming out, 1.2 current)
UDDI version 3 (Aug 2003)
BPEL 1.1 (Business Process Execution Language)
choreography description language (web services work
flows)
started January 2003.
Standards are still volatile and in the process of development.
Talk title date 5
Web Services Architecture
Web Services involve three major
roles
Service Provider
Service Registry
Service Consumer
Three major operations surround web
services
Publishing – making a service available
Finding – locating web services
Binding – using web services
Talk title date 6
Making a service available (1)
In order for someone to use your service
they have to know about it.
To allow users to discover a service it is
published to a registry (UDDI).
To allow users to interact with a service you
must publish a description of it’s interface
(methods & arguments).
This is done using WSDL.
Talk title date 7
Making a service available (2)
Once you have published a description of your
service you must have a host set up to serve it.
A web server is often used to deliver services
(although custom application – application
communication is also possible).
This is functionality which has to be added to the
web server. In the case of the apache web server a
‘container’ application (Tomcat) can be used to make
the application (servlet) available to apache
(deploying).
Talk title date 8
The old transfer protocols are
still there.
Like the grid architecture web
services is layered on top of existing,
mature transfer protocols.
HTTP, SMTP are still used over TCP/IP
to pass the messages.
Web services, like grids, can be seen
as a functionality enhancement to the
existing technologies.
Talk title date 9
XML
All Web Services documents are
written in XML
XML Schema are used to define the
elements used in Web Services
communication
Talk title date 10
SOAP
Actually used to communicate with the Web
Service
Both the request and the response are SOAP
messages
The body of the message (whose grammar
is defined by the WSDL) is contained within
a SOAP “envelope”
“Binds” the client to the web service
Talk title date 11
WSDL
Describes the Web Service and
defines the functions that are
exposed in the Web Service
Defines the XML grammar to be used
in the messages
Uses the W3C Schema language
Talk title date 12
UDDI
UDDI is used to register and look up
services with a central registry
Service Providers can publish information
about their business and the services that
they offer
Service consumers can look up services that
are available by
 Business
 Service category
 Specific service
Talk title date 13
Section
XML
Talk title date 14
What is XML
XML stands for extensible markup language
It is a hierarchical data description language
It is a sub set of SGML a general document
markup language designed for the American
millitary.
It is defined by w3c.
Talk title date 15
How does XML differ from
HTML?
HTML is a presentation markup language –
provides no information about content.
There is only one standard definition of all of the
tags used in HTML.
XML can define both presentation style and give
information about content.
XML relies on custom documents defining the
meaning of tags.
Talk title date 16
What is a Schema?
A schema is the definition of the meaning of
each of the tags within a XML document.
Analogy: A HTML style sheet can be seen as
a limited schema which only specifies the
presentational style of HTML which refers to
it.
Example: in HTML the tag <strong> pre-
defined. In XML you would need to define
this in the context of your document.
Talk title date 17
A minimal XML document
<?xml version=“1.0” ?>
<document name=“first”>Jim</document>
A tag
An attribute
value
Closing tag
Talk title date 18
Valid and well formed
A correct XML document must be both valid
and well formed.
Well formed means that the syntax must be
correct and all tags must close correctly (eg
<…> </…>).
Valid means that the document must
conform to some XML definition ( a DTD or
Schema).
(Otherwise there can be no definition of what
the tags mean)
Talk title date 19
Using namespaces in XML
To fully qualify a namespace in XML write the
namespace:tag name. eg.
<my_namespace:tag> </my_namespace:tag>
In a globally declared single namespace the qualifier
may be omitted.
More than one namespace:
<my_namespace:tag> </my_namespace:tag>
<your_namespace:tag>
</your_namespace:tag>
can co-exist if correctly qualified.
Talk title date 20
Namespaces in programming
languages
In C/C++ defined by #includes and classes
(eg. myclass::variable).
In PERL defined by package namespace,
$local and $my (eg. myPackage::variable).
In JAVA defined by includes and package
namespace (eg. java.lang.Object)
Defines the scope of variables
Talk title date 21
Schema
<?xml version="1.0"?>
<xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema
xmlns=“document" >
<xs:element name = “DOCUMENT”>
<xs:element name=“CUSTOMER"> </xs:element>
</xs:element>
</xs:schema>
<?xml version=“1.0”?>
<DOCUMENT xmlns=“document”
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemaLocation=“order.xsd”>
<DOCUMENT>
<CUSTOMER>sam smith</CUSTOMER>
<CUSTOMER>sam smith</CUSTOMER>
</DOCUMENT>
Simple schema
saved as order.xsd
XML document
derived from
schema.
Talk title date 22
Section
SOAP
Talk title date 23
Request Response Web
Services
Currently the most common implementation
of Web Services
Work in a very simple ‘request – response’
paradigm
For Example:
 A Weather Service– simple request for weather in an area, simple
response with the weather report
 An Airline special offers service – travel agents would simply make
requests for latest offers and would receive the offers as a
response
Talk title date 24
SOAP messages
SOAP provides a standard ‘envelope’ within
which a message can be delivered.
SOAP is mechanism (protocol) for
transferring information (messages)
between applications which may be widely
distributed.
SOAP says nothing about the content of the
message – the sender and the receiver must
understand the message for themselves.
SOAP is part of a communication stack.
Talk title date 25
SOAP Structure(1)
Each SOAP message
will have:
An Envelope
A Header (optional)
A Body
The Body may contain
a Fault element
SOAP BODY
SOAP ENVELOPE
FAULT
SOAP HEADER
Transport protocol
MIME header
Talk title date 26
SOAP Structure(2)
The envelope wraps the entire soap document
The header contains allows additional information to
be passed as well as the body of the document – e.g.
authentication
The body element contains the core of the SOAP
document – this will contain either the RPC call or
the XML message itself
The fault information will contain any exception
information
Talk title date 27
Anatomy of a SOAP message
<?xml version=‘1.0’
encoding=‘UTF-8’?>
<SOAP-ENV:Envelope xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance”
xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”>
</SOAP-ENV:Envelope>
<SOAP-ENV:Header>
</SOAP-ENV:Header
<SOAP_ENV:Body>
</SOAP-ENV:Body>
Talk title date 28
SOAP protocol binding
SOAPAction = “urn:soaphttpclient-action-uri”
Host = localhost
Content-Type = text/xml; charset=utf-8
Content-Length = 701
<SOAP-ENV:Envelope xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance”
xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”>
</SOAP-ENV:Envelope>
Talk title date 29
SOAP RPC
SOAP RPC messages contain XML that
represents a method call or method
response
The SOAP XML will be converted into
a method call on the server and the
response will be encoded into SOAP
XML to be returned to the client
Talk title date 30
SOAP Faults
SOAP errors are handled using a
specialised envelope known as a Fault
Envelope
A SOAP Fault is a special element
which must appear as an immediate
child of the body element
<faultcode> and <faultstring> are
required.
Talk title date 31
A SOAP fault
<?xml version=‘1.0’ encoding=‘UTF-8’?>
<SOAP-ENV:Envelope
xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance”
xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”>
<SOAP_ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Test fault</faultstring>
<faultactor>/soap/servlet/rpcrouter</faultactor>
<detail>
..
</detail>
</SOAP-ENV:Fault>
Talk title date 32
SOAP Attachment
Large quantities or
binary data may not fit
well into a XML SOAP
message.
In which case it can be
sent ‘out of band’ by
attaching it to a SOAP
message
Analogy : email
attachments.
SOAP BODY
SOAP ENVELOPE
FAULT
SOAP HEADER
Transport protocol
MIME header
Attachment
Talk title date 33
Attaching a file to a SOAP
message
To add a file to a SOAP message a tag
is added within the body of the
message.
<?xml version=‘1.0’ encoding=‘UTF-8’?>
<SOAP-ENV:Envelope
xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance”
xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”>
<SOAP_ENV:Body>
<attachment href=“{URL}”/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Weitere ähnliche Inhalte

Ähnlich wie Introduction to Web Services Protocols.ppt

Ähnlich wie Introduction to Web Services Protocols.ppt (20)

Web Services
Web ServicesWeb Services
Web Services
 
Web Services
Web ServicesWeb Services
Web Services
 
Wsdl1
Wsdl1Wsdl1
Wsdl1
 
IT6801-Service Oriented Architecture
IT6801-Service Oriented ArchitectureIT6801-Service Oriented Architecture
IT6801-Service Oriented Architecture
 
jkljklj
jkljkljjkljklj
jkljklj
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
E05412327
E05412327E05412327
E05412327
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Mit302 web technologies
Mit302 web technologiesMit302 web technologies
Mit302 web technologies
 
SOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIESSOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIES
 
5010
50105010
5010
 
UNIT-1 Web services
UNIT-1 Web servicesUNIT-1 Web services
UNIT-1 Web services
 
SOAP Services
SOAP ServicesSOAP Services
SOAP Services
 
light_xml
light_xmllight_xml
light_xml
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications development
 
Xml
XmlXml
Xml
 

Mehr von Dr.Saranya K.G (12)

complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
 
1.Usability Engineering.pptx
1.Usability Engineering.pptx1.Usability Engineering.pptx
1.Usability Engineering.pptx
 
CSSE375-03-framework.ppt
CSSE375-03-framework.pptCSSE375-03-framework.ppt
CSSE375-03-framework.ppt
 
SQA.ppt
SQA.pptSQA.ppt
SQA.ppt
 
Neo4 j
Neo4 jNeo4 j
Neo4 j
 
Xquery1
Xquery1Xquery1
Xquery1
 
Xsl xslt
Xsl  xsltXsl  xslt
Xsl xslt
 
Xpath1
Xpath1Xpath1
Xpath1
 
Converting dt ds to xml schemas
Converting dt ds to xml schemasConverting dt ds to xml schemas
Converting dt ds to xml schemas
 
Dtd
DtdDtd
Dtd
 
Xml schema
Xml schemaXml schema
Xml schema
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 

Kürzlich hochgeladen

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Kürzlich hochgeladen (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

Introduction to Web Services Protocols.ppt

  • 1. Introduction to Web Services Protocols
  • 2. Talk title date 2 Communication and standards Efficient (or indeed any) communication is dependent on a shared vocabulary and grammar. Because web services deals with inter-organisation communication these must be universal standards.
  • 3. Talk title date 3 Underlying standards The basic standards for web services are: XML (Extensible Markup Language) SOAP (simple object access protocol) WSDL (web services description language) UDDI (universal description, discovery and integration)
  • 4. Talk title date 4 The state of standards XML 1.0 fairly stable, although Schema are in the process of replacing DTDs (currently Schema 1.1 being worked on). SOAP 1.2 WSDL 2.0 (coming out, 1.2 current) UDDI version 3 (Aug 2003) BPEL 1.1 (Business Process Execution Language) choreography description language (web services work flows) started January 2003. Standards are still volatile and in the process of development.
  • 5. Talk title date 5 Web Services Architecture Web Services involve three major roles Service Provider Service Registry Service Consumer Three major operations surround web services Publishing – making a service available Finding – locating web services Binding – using web services
  • 6. Talk title date 6 Making a service available (1) In order for someone to use your service they have to know about it. To allow users to discover a service it is published to a registry (UDDI). To allow users to interact with a service you must publish a description of it’s interface (methods & arguments). This is done using WSDL.
  • 7. Talk title date 7 Making a service available (2) Once you have published a description of your service you must have a host set up to serve it. A web server is often used to deliver services (although custom application – application communication is also possible). This is functionality which has to be added to the web server. In the case of the apache web server a ‘container’ application (Tomcat) can be used to make the application (servlet) available to apache (deploying).
  • 8. Talk title date 8 The old transfer protocols are still there. Like the grid architecture web services is layered on top of existing, mature transfer protocols. HTTP, SMTP are still used over TCP/IP to pass the messages. Web services, like grids, can be seen as a functionality enhancement to the existing technologies.
  • 9. Talk title date 9 XML All Web Services documents are written in XML XML Schema are used to define the elements used in Web Services communication
  • 10. Talk title date 10 SOAP Actually used to communicate with the Web Service Both the request and the response are SOAP messages The body of the message (whose grammar is defined by the WSDL) is contained within a SOAP “envelope” “Binds” the client to the web service
  • 11. Talk title date 11 WSDL Describes the Web Service and defines the functions that are exposed in the Web Service Defines the XML grammar to be used in the messages Uses the W3C Schema language
  • 12. Talk title date 12 UDDI UDDI is used to register and look up services with a central registry Service Providers can publish information about their business and the services that they offer Service consumers can look up services that are available by  Business  Service category  Specific service
  • 13. Talk title date 13 Section XML
  • 14. Talk title date 14 What is XML XML stands for extensible markup language It is a hierarchical data description language It is a sub set of SGML a general document markup language designed for the American millitary. It is defined by w3c.
  • 15. Talk title date 15 How does XML differ from HTML? HTML is a presentation markup language – provides no information about content. There is only one standard definition of all of the tags used in HTML. XML can define both presentation style and give information about content. XML relies on custom documents defining the meaning of tags.
  • 16. Talk title date 16 What is a Schema? A schema is the definition of the meaning of each of the tags within a XML document. Analogy: A HTML style sheet can be seen as a limited schema which only specifies the presentational style of HTML which refers to it. Example: in HTML the tag <strong> pre- defined. In XML you would need to define this in the context of your document.
  • 17. Talk title date 17 A minimal XML document <?xml version=“1.0” ?> <document name=“first”>Jim</document> A tag An attribute value Closing tag
  • 18. Talk title date 18 Valid and well formed A correct XML document must be both valid and well formed. Well formed means that the syntax must be correct and all tags must close correctly (eg <…> </…>). Valid means that the document must conform to some XML definition ( a DTD or Schema). (Otherwise there can be no definition of what the tags mean)
  • 19. Talk title date 19 Using namespaces in XML To fully qualify a namespace in XML write the namespace:tag name. eg. <my_namespace:tag> </my_namespace:tag> In a globally declared single namespace the qualifier may be omitted. More than one namespace: <my_namespace:tag> </my_namespace:tag> <your_namespace:tag> </your_namespace:tag> can co-exist if correctly qualified.
  • 20. Talk title date 20 Namespaces in programming languages In C/C++ defined by #includes and classes (eg. myclass::variable). In PERL defined by package namespace, $local and $my (eg. myPackage::variable). In JAVA defined by includes and package namespace (eg. java.lang.Object) Defines the scope of variables
  • 21. Talk title date 21 Schema <?xml version="1.0"?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns=“document" > <xs:element name = “DOCUMENT”> <xs:element name=“CUSTOMER"> </xs:element> </xs:element> </xs:schema> <?xml version=“1.0”?> <DOCUMENT xmlns=“document” xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Xsi:schemaLocation=“order.xsd”> <DOCUMENT> <CUSTOMER>sam smith</CUSTOMER> <CUSTOMER>sam smith</CUSTOMER> </DOCUMENT> Simple schema saved as order.xsd XML document derived from schema.
  • 22. Talk title date 22 Section SOAP
  • 23. Talk title date 23 Request Response Web Services Currently the most common implementation of Web Services Work in a very simple ‘request – response’ paradigm For Example:  A Weather Service– simple request for weather in an area, simple response with the weather report  An Airline special offers service – travel agents would simply make requests for latest offers and would receive the offers as a response
  • 24. Talk title date 24 SOAP messages SOAP provides a standard ‘envelope’ within which a message can be delivered. SOAP is mechanism (protocol) for transferring information (messages) between applications which may be widely distributed. SOAP says nothing about the content of the message – the sender and the receiver must understand the message for themselves. SOAP is part of a communication stack.
  • 25. Talk title date 25 SOAP Structure(1) Each SOAP message will have: An Envelope A Header (optional) A Body The Body may contain a Fault element SOAP BODY SOAP ENVELOPE FAULT SOAP HEADER Transport protocol MIME header
  • 26. Talk title date 26 SOAP Structure(2) The envelope wraps the entire soap document The header contains allows additional information to be passed as well as the body of the document – e.g. authentication The body element contains the core of the SOAP document – this will contain either the RPC call or the XML message itself The fault information will contain any exception information
  • 27. Talk title date 27 Anatomy of a SOAP message <?xml version=‘1.0’ encoding=‘UTF-8’?> <SOAP-ENV:Envelope xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance” xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”> </SOAP-ENV:Envelope> <SOAP-ENV:Header> </SOAP-ENV:Header <SOAP_ENV:Body> </SOAP-ENV:Body>
  • 28. Talk title date 28 SOAP protocol binding SOAPAction = “urn:soaphttpclient-action-uri” Host = localhost Content-Type = text/xml; charset=utf-8 Content-Length = 701 <SOAP-ENV:Envelope xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance” xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”> </SOAP-ENV:Envelope>
  • 29. Talk title date 29 SOAP RPC SOAP RPC messages contain XML that represents a method call or method response The SOAP XML will be converted into a method call on the server and the response will be encoded into SOAP XML to be returned to the client
  • 30. Talk title date 30 SOAP Faults SOAP errors are handled using a specialised envelope known as a Fault Envelope A SOAP Fault is a special element which must appear as an immediate child of the body element <faultcode> and <faultstring> are required.
  • 31. Talk title date 31 A SOAP fault <?xml version=‘1.0’ encoding=‘UTF-8’?> <SOAP-ENV:Envelope xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance” xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”> <SOAP_ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>Test fault</faultstring> <faultactor>/soap/servlet/rpcrouter</faultactor> <detail> .. </detail> </SOAP-ENV:Fault>
  • 32. Talk title date 32 SOAP Attachment Large quantities or binary data may not fit well into a XML SOAP message. In which case it can be sent ‘out of band’ by attaching it to a SOAP message Analogy : email attachments. SOAP BODY SOAP ENVELOPE FAULT SOAP HEADER Transport protocol MIME header Attachment
  • 33. Talk title date 33 Attaching a file to a SOAP message To add a file to a SOAP message a tag is added within the body of the message. <?xml version=‘1.0’ encoding=‘UTF-8’?> <SOAP-ENV:Envelope xmlns:SOAP_ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3c.org/1999/XMLSchema-instance” xmlns:xsd=“http://www.w3c.org/1999/XMLSchema”> <SOAP_ENV:Body> <attachment href=“{URL}”/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>