SlideShare une entreprise Scribd logo
1  sur  28
WEB SERVICES
SOAP, UDDI, WSDL
2022, Varna
WHAT IS A WEB SERVICE?
• A web service is a service that is available on the web.
• It enables communication between applications over the
web.
• It provides a standard protocol/format for
communication.
• Web services are used because they allow platform
independent communication.
• Using web services two different applications can talk to
each other and exchange data/information.
HOW DO WEB SERVICES WORK?
• Web services are developed and implemented by an entity called a “service
provider”.
• A client or a “service consumer” sends a request to the service provider. The service
provider then processes the request and returns the response.
• To achieve this communication two things are needed: the medium (HTTP
protocol/Internet) and a common format that both of the applications can
understand (XML/JSON).
• There are two major implementations of web services – SOAP (Simple Object
Access Protocol) and REST (Representational State Transfer)
• The medium that SOAP web services use is HTTP (POST) and the format is XML.
• The medium that REST web services use is HTTP (GET, POST, PUT, DELETE…) and
the formats are XML/JSON/TEXT…
• REST is more flexible and less rigid than SOAP.
SOAP (SIMPLE OBJECT ACCESS PROTOCOL)
• A web service that complies to the
SOAP Web Services Specifications is a
SOAP Web Service.
• The international body that develops
these standards is the W3C (World
Wide Web Consortium).
• The SOAP Web Services Specifications
that is laid down by the W3C has two
categories of specifications – basic
and extended.
SOAP Web Services Specifications
Basic Extended
o SOAP
o WSDL
o UDDI
o WS-Security
o WS-Policy
o WS-I
o …
• The first specification that SOAP Web Services should comply to is the
Simple Object Access Protocol.
• It includes the protocol/rules/definitions about how two applications will
talk to each other over the web.
• According to SOAP, all exchange of data, messages or information
between two applications should be in a common XML format.
• The XML messages should have a defined structure; they should be SOAP
MESSAGES.
• A SOAP MESSAGE consists of:
• Envelope
• Header
• Body
SOAP (SIMPLE OBJECT ACCESS PROTOCOL)
SOAP (SIMPLE OBJECT ACCESS PROTOCOL)
• SOAP is an XML-based protocol that allows transfer of information between applications
running on different operating systems, technologies and languages through HTTP
What is SOAP?
• SOAP – an abbreviation for Simple Object Access Protocol
• SOAP is an application communication protocol
• SOAP is a format for sending messages
• SOAP is created for communication over the Internet
• SOAP is platform independent
• SOAP is language independent
• SOAP is XML based
• SOAP is simple and it has the option to be expanded
• SOAP is developed as a W3C standard
THE SOAP MESSAGE ELEMENTS
• Envelope – the root
element
• Header – an optional
element that can contain
information about the
content types and
authentication parameters
• Body – contains the actual
data of the request meant
to be sent to the server.
An example of a SOAP Message
THE SOAP MESSAGE ELEMENTS
Elements of the SOAP message (XML Document)
• The Envelope element – defines the document as a SOAP message
• The optional Header element – contains header information
• The mandatory Body element – contains information about the call and the
response
• All the elements above are declared in the default namespace for the SOAP
envelope:
• http://www.w3.org/2003/05/soap-envelope/
• and the default namespace for SOAP encoding and data types is:
• http://www.w3.org/2003/05/soap-encoding
SYNTAX RULES
Some important syntax rules:
• A SOAP message MUST be encoded using XML
• A SOAP message MUST use the SOAP Envelope namespace
• A SOAP message must NOT contain a DTD reference
• A SOAP message must NOT contain XML Processing Instructions
THE SOAP MESSAGE SKELETON
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-
envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
THE SOAP ENVELOPE ELEMENT
• The required SOAP Envelope element is the root element of a SOAP
message. This element defines the XML document as a SOAP message.
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-
envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
...
Message information goes here
...
</soap:Envelope>
• The encodingStyle attribute is used to define the data types used
in the document. This attribute may appear on any SOAP
element, and applies to the element's contents and all child
elements.
• A SOAP message has no default encoding.
THE SOAP HEADER ELEMENT
• The optional SOAP Header element contains application-specific information (like
authentication, payment, etc.) about the SOAP message.
• If the Header element is present, it must be the first child element of the Envelope element.
• All immediate child elements of the Header element must be namespace-qualified.
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Header>
<m:Trans xmlns:m="https://www.w3schools.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>
THE SOAP BODY ELEMENT
• The required SOAP Body element contains the actual SOAP message intended for the ultimate
endpoint of the message.
• Immediate child elements of the SOAP Body element may be namespace-qualified.
• The example below requests the price of apples. Note that the m:GetPrice and the Item elements
above are application-specific elements. They are not a part of the SOAP namespace.
…
<soap:Body>
<m:GetPrice xmlns:m="https://www.w3schools.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
…
THE SOAP RESPONSE
A SOAP response could look something like this:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="https://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
WSDL (WEB SERVICES DESCRIPTION LANGUAGE)
• If a client wants to use a web service, it would need to know
all the details about the particular web service – what the
web service is, what are the various components and
functionalities, the parameters, the return types and how
exactly to consume the web service.
• To enable this, every service provider publishes a description
about their web service which acts as an interface where all
the attributes and functionalities of the web service are
described.
• This is an XML-based interface and it’s called WSDL or Web
Services Description Language.
WSDL
• An WSDL document describes a web service. It specifies the location of the service, and
the methods of the service, using these major elements:
Element Description
<types> Defines the (XML Schema) data types
used by the web service.
<message> Defines the data elements for each
operation.
<portType> Describes the operations that can be
performed and the messages
involved.
<binding> Defines the protocol and data format
for each port type.
WSDL
• The main structure of a WSDL document looks like this:
<definitions>
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
</definitions>
WSDL
• WSDL Port – The <portType> element describes the web service, the
operations that can be performed and the included messages. The
<portType> element can be compared to a library function (or a
or a class) from traditional programming.
• WSDL Message – The <message> element defines the data elements
of the operation. Every message can consist of one or more
The components can be compared to parameters of a function.
• WSDL Type – The <types> element defines the data types used by the
web service. To allow platform independence WSDL uses the XML
Schema syntax for defining the data types.
• WSDL Binding – The <binding> element defines the message format
and the protocol and data format for each port type.
WSDL
• WSDL Example:
<message name="getTermRequest">
<part name="term" type="xs:string"/>
</message>
<message name="getTermResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
WSDL EXAMPLE EXPLAINED
• In the example the <portType> element defines
"glossaryTerms" as the name of a port, and "getTerm" as the
name of an operation.
• The "getTerm" operation has an input message called
"getTermRequest" and an output message called
"getTermResponse".
• The <message> elements define the parts of each message
and the associated data types.
• Compared to traditional programming, glossaryTerms is a
library and getTerm is a function with getTermRequest as
an input parameter and getTermResponse as a result
parameter.
WSDL
• WSDL Ports – they define the interfaces (the legal operations)
offered by the web service.
• The request-response type is the most common operation type,
but WSDL defines four types:
Type Description
One-way The operation can receive a message
but will not return a response.
Request-response The operation can receive a request
and will return a response.
Solicit-response The operation can send a request and
will wait for a response.
Notification The operation can send a message
but will not wait for a response.
WSDL
• A one-way operation example:
<message name="newTermValues">
<part name="term" type="xs:string"/>
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="setTerm">
<input name="newTerm" message="newTermValues"/>
</operation>
</portType>
• In the example above, the portType "glossaryTerms" defines a one-way
operation called "setTerm".
• The "setTerm" operation allows input of new glossary terms messages using a
"newTermValues" message with the input parameters "term" and "value".
However, no output is defined for the operation.
• A request-response operation example:
<message name="getTermRequest">
<part name="term" type="xs:string"/>
</message>
<message name="getTermResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
• In the example above, the portType "glossaryTerms" defines a request-response
operation called "getTerm".
• The "getTerm" operation requires an input message called "getTermRequest" with a
parameter called "term", and will return an output message called
"getTermResponse" with a parameter called "value".
WSDL
WSDL Binding to SOAP
• WSDL bindings defines the message format and protocol details for a
web service.
• A request-response operation example:
<binding type="glossaryTerms" name="b1">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation>
<soap:operation soapAction="http://example.com/getTerm"/>
<input><soap:body use="literal"/></input>
<output><soap:body use="literal"/></output>
</operation>
</binding>
WSDL
• The binding element has two attributes - name and type.
• The name attribute (you can use any name you want) defines the name of the
binding, and the type attribute points to the port for the binding, in this case the
"glossaryTerms" port.
• The soap:binding element has two attributes - style and transport.
• The style attribute can be "rpc" or "document". In this case we use document. The
transport attribute defines the SOAP protocol to use. In this case we use HTTP.
• The operation element defines each operation that the portType exposes.
• For each operation the corresponding SOAP action has to be defined. It must also
be specified how the input and output are encoded. In this case "literal“ is used.
WSDL (WEB SERVICES DESCRIPTION LANGUAGE)
• The reason why the interface is in XML format
is so it is machine readable.
• Various tools and programming languages
can be used to parse this document and
generate the request and response structure.
UDDI
• There are two ways a service consumer can get ahold of the WSDL
document.
• In case that the service provider and the service consumer already know
each other, the service provider can directly hand over the WSDL
document or the WSDL URL and the client can then use the web service.
• In the other case where the service provider and service consumer do
not know each other, the web service provider publishes their WSDL to
an online directory or registry which can be searched by any consumer
and they can get ahold of the WSDL.
• This online registry or directory is called UDDI (Universal Description,
Discovery and Integration) and it is and XML-based standard for
publishing and finding web services.
AWS FULL COURSE 2022
• https://www.youtube.com/watch?v=ZB5ONbD_SMY&ab_channel=Simplilearn

Contenu connexe

Similaire à Web-Services!.pptx

Similaire à Web-Services!.pptx (20)

WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Introduction to WebServices
Introduction to WebServicesIntroduction to WebServices
Introduction to WebServices
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
Jee course web services
Jee course web servicesJee course web services
Jee course web services
 
SOAP Overview
SOAP OverviewSOAP Overview
SOAP Overview
 
Web Service Interaction Models | Torry Harris Whitepaper
Web Service Interaction Models | Torry Harris WhitepaperWeb Service Interaction Models | Torry Harris Whitepaper
Web Service Interaction Models | Torry Harris Whitepaper
 
Introduction to WebServices
Introduction to WebServicesIntroduction to WebServices
Introduction to WebServices
 
Soap xp-wg
Soap xp-wgSoap xp-wg
Soap xp-wg
 
Developmeant and deployment of webservice
Developmeant and deployment of webserviceDevelopmeant and deployment of webservice
Developmeant and deployment of webservice
 
Mule webservices in detail
Mule webservices in detailMule webservices in detail
Mule webservices in detail
 
ITI004En-Introduction to XML (III)
ITI004En-Introduction to XML (III)ITI004En-Introduction to XML (III)
ITI004En-Introduction to XML (III)
 
Web services
Web servicesWeb services
Web services
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 
Lecture 16 - Web Services
Lecture 16 - Web ServicesLecture 16 - Web Services
Lecture 16 - Web Services
 
Web services
Web servicesWeb services
Web services
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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?
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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...
 

Web-Services!.pptx

  • 1. WEB SERVICES SOAP, UDDI, WSDL 2022, Varna
  • 2. WHAT IS A WEB SERVICE? • A web service is a service that is available on the web. • It enables communication between applications over the web. • It provides a standard protocol/format for communication. • Web services are used because they allow platform independent communication. • Using web services two different applications can talk to each other and exchange data/information.
  • 3. HOW DO WEB SERVICES WORK? • Web services are developed and implemented by an entity called a “service provider”. • A client or a “service consumer” sends a request to the service provider. The service provider then processes the request and returns the response. • To achieve this communication two things are needed: the medium (HTTP protocol/Internet) and a common format that both of the applications can understand (XML/JSON). • There are two major implementations of web services – SOAP (Simple Object Access Protocol) and REST (Representational State Transfer) • The medium that SOAP web services use is HTTP (POST) and the format is XML. • The medium that REST web services use is HTTP (GET, POST, PUT, DELETE…) and the formats are XML/JSON/TEXT… • REST is more flexible and less rigid than SOAP.
  • 4. SOAP (SIMPLE OBJECT ACCESS PROTOCOL) • A web service that complies to the SOAP Web Services Specifications is a SOAP Web Service. • The international body that develops these standards is the W3C (World Wide Web Consortium). • The SOAP Web Services Specifications that is laid down by the W3C has two categories of specifications – basic and extended. SOAP Web Services Specifications Basic Extended o SOAP o WSDL o UDDI o WS-Security o WS-Policy o WS-I o …
  • 5. • The first specification that SOAP Web Services should comply to is the Simple Object Access Protocol. • It includes the protocol/rules/definitions about how two applications will talk to each other over the web. • According to SOAP, all exchange of data, messages or information between two applications should be in a common XML format. • The XML messages should have a defined structure; they should be SOAP MESSAGES. • A SOAP MESSAGE consists of: • Envelope • Header • Body SOAP (SIMPLE OBJECT ACCESS PROTOCOL)
  • 6. SOAP (SIMPLE OBJECT ACCESS PROTOCOL) • SOAP is an XML-based protocol that allows transfer of information between applications running on different operating systems, technologies and languages through HTTP What is SOAP? • SOAP – an abbreviation for Simple Object Access Protocol • SOAP is an application communication protocol • SOAP is a format for sending messages • SOAP is created for communication over the Internet • SOAP is platform independent • SOAP is language independent • SOAP is XML based • SOAP is simple and it has the option to be expanded • SOAP is developed as a W3C standard
  • 7. THE SOAP MESSAGE ELEMENTS • Envelope – the root element • Header – an optional element that can contain information about the content types and authentication parameters • Body – contains the actual data of the request meant to be sent to the server. An example of a SOAP Message
  • 8. THE SOAP MESSAGE ELEMENTS Elements of the SOAP message (XML Document) • The Envelope element – defines the document as a SOAP message • The optional Header element – contains header information • The mandatory Body element – contains information about the call and the response • All the elements above are declared in the default namespace for the SOAP envelope: • http://www.w3.org/2003/05/soap-envelope/ • and the default namespace for SOAP encoding and data types is: • http://www.w3.org/2003/05/soap-encoding
  • 9. SYNTAX RULES Some important syntax rules: • A SOAP message MUST be encoded using XML • A SOAP message MUST use the SOAP Envelope namespace • A SOAP message must NOT contain a DTD reference • A SOAP message must NOT contain XML Processing Instructions
  • 10. THE SOAP MESSAGE SKELETON <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap- envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Header> ... </soap:Header> <soap:Body> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope>
  • 11. THE SOAP ENVELOPE ELEMENT • The required SOAP Envelope element is the root element of a SOAP message. This element defines the XML document as a SOAP message. <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap- envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> ... Message information goes here ... </soap:Envelope> • The encodingStyle attribute is used to define the data types used in the document. This attribute may appear on any SOAP element, and applies to the element's contents and all child elements. • A SOAP message has no default encoding.
  • 12. THE SOAP HEADER ELEMENT • The optional SOAP Header element contains application-specific information (like authentication, payment, etc.) about the SOAP message. • If the Header element is present, it must be the first child element of the Envelope element. • All immediate child elements of the Header element must be namespace-qualified. <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Header> <m:Trans xmlns:m="https://www.w3schools.com/transaction/" soap:mustUnderstand="1">234 </m:Trans> </soap:Header> ... ... </soap:Envelope>
  • 13. THE SOAP BODY ELEMENT • The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message. • Immediate child elements of the SOAP Body element may be namespace-qualified. • The example below requests the price of apples. Note that the m:GetPrice and the Item elements above are application-specific elements. They are not a part of the SOAP namespace. … <soap:Body> <m:GetPrice xmlns:m="https://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> …
  • 14. THE SOAP RESPONSE A SOAP response could look something like this: <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Body> <m:GetPriceResponse xmlns:m="https://www.w3schools.com/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse> </soap:Body> </soap:Envelope>
  • 15. WSDL (WEB SERVICES DESCRIPTION LANGUAGE) • If a client wants to use a web service, it would need to know all the details about the particular web service – what the web service is, what are the various components and functionalities, the parameters, the return types and how exactly to consume the web service. • To enable this, every service provider publishes a description about their web service which acts as an interface where all the attributes and functionalities of the web service are described. • This is an XML-based interface and it’s called WSDL or Web Services Description Language.
  • 16. WSDL • An WSDL document describes a web service. It specifies the location of the service, and the methods of the service, using these major elements: Element Description <types> Defines the (XML Schema) data types used by the web service. <message> Defines the data elements for each operation. <portType> Describes the operations that can be performed and the messages involved. <binding> Defines the protocol and data format for each port type.
  • 17. WSDL • The main structure of a WSDL document looks like this: <definitions> <types> data type definitions........ </types> <message> definition of the data being communicated.... </message> <portType> set of operations...... </portType> <binding> protocol and data format specification.... </binding> </definitions>
  • 18. WSDL • WSDL Port – The <portType> element describes the web service, the operations that can be performed and the included messages. The <portType> element can be compared to a library function (or a or a class) from traditional programming. • WSDL Message – The <message> element defines the data elements of the operation. Every message can consist of one or more The components can be compared to parameters of a function. • WSDL Type – The <types> element defines the data types used by the web service. To allow platform independence WSDL uses the XML Schema syntax for defining the data types. • WSDL Binding – The <binding> element defines the message format and the protocol and data format for each port type.
  • 19. WSDL • WSDL Example: <message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType>
  • 20. WSDL EXAMPLE EXPLAINED • In the example the <portType> element defines "glossaryTerms" as the name of a port, and "getTerm" as the name of an operation. • The "getTerm" operation has an input message called "getTermRequest" and an output message called "getTermResponse". • The <message> elements define the parts of each message and the associated data types. • Compared to traditional programming, glossaryTerms is a library and getTerm is a function with getTermRequest as an input parameter and getTermResponse as a result parameter.
  • 21. WSDL • WSDL Ports – they define the interfaces (the legal operations) offered by the web service. • The request-response type is the most common operation type, but WSDL defines four types: Type Description One-way The operation can receive a message but will not return a response. Request-response The operation can receive a request and will return a response. Solicit-response The operation can send a request and will wait for a response. Notification The operation can send a message but will not wait for a response.
  • 22. WSDL • A one-way operation example: <message name="newTermValues"> <part name="term" type="xs:string"/> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="setTerm"> <input name="newTerm" message="newTermValues"/> </operation> </portType> • In the example above, the portType "glossaryTerms" defines a one-way operation called "setTerm". • The "setTerm" operation allows input of new glossary terms messages using a "newTermValues" message with the input parameters "term" and "value". However, no output is defined for the operation.
  • 23. • A request-response operation example: <message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType> • In the example above, the portType "glossaryTerms" defines a request-response operation called "getTerm". • The "getTerm" operation requires an input message called "getTermRequest" with a parameter called "term", and will return an output message called "getTermResponse" with a parameter called "value".
  • 24. WSDL WSDL Binding to SOAP • WSDL bindings defines the message format and protocol details for a web service. • A request-response operation example: <binding type="glossaryTerms" name="b1"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation> <soap:operation soapAction="http://example.com/getTerm"/> <input><soap:body use="literal"/></input> <output><soap:body use="literal"/></output> </operation> </binding>
  • 25. WSDL • The binding element has two attributes - name and type. • The name attribute (you can use any name you want) defines the name of the binding, and the type attribute points to the port for the binding, in this case the "glossaryTerms" port. • The soap:binding element has two attributes - style and transport. • The style attribute can be "rpc" or "document". In this case we use document. The transport attribute defines the SOAP protocol to use. In this case we use HTTP. • The operation element defines each operation that the portType exposes. • For each operation the corresponding SOAP action has to be defined. It must also be specified how the input and output are encoded. In this case "literal“ is used.
  • 26. WSDL (WEB SERVICES DESCRIPTION LANGUAGE) • The reason why the interface is in XML format is so it is machine readable. • Various tools and programming languages can be used to parse this document and generate the request and response structure.
  • 27. UDDI • There are two ways a service consumer can get ahold of the WSDL document. • In case that the service provider and the service consumer already know each other, the service provider can directly hand over the WSDL document or the WSDL URL and the client can then use the web service. • In the other case where the service provider and service consumer do not know each other, the web service provider publishes their WSDL to an online directory or registry which can be searched by any consumer and they can get ahold of the WSDL. • This online registry or directory is called UDDI (Universal Description, Discovery and Integration) and it is and XML-based standard for publishing and finding web services.
  • 28. AWS FULL COURSE 2022 • https://www.youtube.com/watch?v=ZB5ONbD_SMY&ab_channel=Simplilearn