0% found this document useful (0 votes)
14 views39 pages

Chapter 3 Part I SOAP

Chapter 3 discusses SOAP Web Services, which are network-accessible interfaces built using standard Internet technologies, allowing clients to interact without needing implementation details. It covers key components such as SOAP, WSDL, and UDDI, as well as the structure and purpose of SOAP messages, including the envelope, header, and body. The chapter highlights the advantages of SOAP, including simplicity, portability, and interoperability, while also outlining the steps to create and invoke web services.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views39 pages

Chapter 3 Part I SOAP

Chapter 3 discusses SOAP Web Services, which are network-accessible interfaces built using standard Internet technologies, allowing clients to interact without needing implementation details. It covers key components such as SOAP, WSDL, and UDDI, as well as the structure and purpose of SOAP messages, including the envelope, header, and body. The chapter highlights the advantages of SOAP, including simplicity, portability, and interoperability, while also outlining the steps to create and invoke web services.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Chapter 3: SOAP Web Services

Content
▪ Introduction
▪ SOAP
▪ WSDL
▪ UDDI
What is a Web Service
• A web service is a network accessible interface to application
functionality, built using standard Internet technologies.
• Clients of web services do NOT need to know how it is
implemented.

Application Web Application


Network
Service code
client
Web Services…
• Network services provided over HTTP – “wired services”
• It is promoted as a new way to build network applications from
distributed components that are language- and platform-independent
• A web service is a message-based network service.
• A server which provides a web service must be capable of “sending
and receiving messages using some combination of standard Internet
protocols”
• Components: application
logic
service
proxy
service
listener
service
request

3/6/2024 HiLCoE School of Computer Science & Technology 3


Web Services…

web service

The web
client
(HTTP-based
web service
network)

web service

3/6/2024 HiLCoE School of Computer Science & Technology 4


Just-in-time integration
• Network services can be integrated dynamically, on an as-needed
basis.
• Network services are registered with a service registry; a service
consumer/client looks up the registry to fulfill its needs.
• The binding of a client to the service can occur at runtime.

3/6/2024 HiLCoE School of Computer Science & Technology 5


Web service protocol stack
application application

service discovery service discovery

service description service description

messaging messaging

transport transport

network network

3/6/2024 HiLCoE School of Computer Science & Technology 6


Web service protocols
application

service discovery UDDI (Universal Description, Discovery,


and Integration)

WSDL (Web Service Description Language)


service description

messaging XML, SOAP (Simple Object Access Protocol)

TCP, HTTP, SMTP, Jabber


transport

IP
network

3/6/2024 HiLCoE School of Computer Science & Technology 7


Web Service Technology Stack
shopping web service?

Discovery Web Service


WSDL URIs
UDDI
Client

Description Web Service


WSDL
WSDL
SOAP pkg request
Packaging Proxy
SOAP pkg response

Transport

Network
Step1. Write Web Service Method
shopping web service?

Discovery Web Service


WSDL URIs
UDDI
Client

Description Web Service


WSDL
WSDL
SOAP pkg request
Packaging Proxy
SOAP pkg response

Transport

Network
Step2. Describe Web Service using WSDL
shopping web service?

Discovery Web Service


WSDL URIs
UDDI
Client

Description Web Service


WSDL
WSDL
SOAP pkg request
Packaging Proxy
SOAP pkg response

Transport

Network
Step3. Write Proxy to Access Web Service
shopping web service?

Discovery Web Service


WSDL URIs
UDDI
Client

Description Web Service


WSDL
WSDL
SOAP pkg request
Packaging Proxy
SOAP pkg response

Transport

Network
Step4. Write Client to Invoke Proxy

shopping web service?

Discovery Web Service


WSDL URIs
UDDI
Client

Description Web Service


WSDL
WSDL
SOAP pkg request
Packaging Proxy
SOAP pkg response

Transport

Network
SOAP: Simple Object Access Protocol
Objectives :
◆ The use of SOAP as a messaging protocol.
◆ How SOAP promotes interoperability.
◆ The structure of SOAP messages.
◆ RPC and document style messages.
◆ The use of HTTP as transport protocol with SOAP.
◆ Advantages and limitations of SOAP.

3/6/2024 HiLCoE School of Computer Science & Technology 13


What is SOAP?
• An acronym for Simple Object Access Protocol (now it is just a name).
• is the de facto standard messaging protocol used by Web services.
• Primary application is inter-application communication.
• SOAP codifies the use of XML as an encoding scheme for request and
response parameters using HTTP as a means for transport.
• A SOAP method is simply an HTTP request and response that
complies with the SOAP encoding rules.
• A SOAP endpoint is simply an HTTP-based URL that identifies a target
for method invocation.

3/6/2024 HiLCoE School of Computer Science & Technology 14


What is SOAP..
➢Is a lightweight wire protocol for exchanging structured and
typed information back and forth between disparate systems
in a distributed environment, such as the Internet or even a
LAN (Local Area Network), enabling remote method
invocation.
➢The term lightweight wire protocol means that SOAP
possesses only two fundamental properties.
➢ It can send and receive HTTP (or other) transport protocol
packets, and process XML messages.

3/6/2024 HiLCoE School of Computer Science & Technology 15


SOAP as a wire representation

• SOAP commonly uses:


• HTTP to transport XML-encoded serialized method
argument data from system to system.
• Design principle for Wire protocols: Compactness,
Protocol efficiency , Coupling, Scalability, Interoperability.
• Question: Evaluate xml and soap in terms of the above
properties .

3/6/2024 HiLCoE School of Computer Science & Technology 16


SOAP as a messaging protocol
A SOAP XML document instance is
called a SOAP message (or SOAP
envelope) and is usually carried as the
payload of some other network
protocol

Fig: The Web services communication and messaging network

HiLCoE School of Computer Science & Technology 17


Purpose of SOAP
❑Exchanging data over networks.
▪ Encapsulating And Encoding Xml Data And Defining The Rules For Transmitting And
Receiving That Data
▪ To Transfer Messages Between Service Instances Described By WSDL Interfaces.
▪ Soap Messages Use Different Protocols Such As Http
▪ Describes How A Message Is Formatted But It Does Not Specify How It Is Delivered.
▪ Because SOAP Can Reside On Http, Its Request/Response Method Operates In A Very
Similar way to HTTP.
▪ SOAP plays the role of a binding mechanism between two conversing endpoints
3/6/2024 HiLCoE School of Computer Science & Technology 18
Distributed application processing with SOAP

3/6/2024 HiLCoE School of Computer Science & Technology 19


Structure of a SOAP message

Figure The SOAP message containment Listing: Structure of SOAP message


structure in UML

3/6/2024 HiLCoE School of Computer Science & Technology 20


SOAP envelope

• Purpose : to provide a uniform way to transport messages between


two endpoints.
• The SOAP envelope is the single root of every SOAP message and
must be present for the message to be SOAP compliant.
• The element defines a framework for describing what is in a message
and how to process it.
3/6/2024 HiLCoE School of Computer Science & Technology 21
SOAP envelope ..
• All elements are defined using w3c xml schema.
• Use of namespaces is recommended .
• Are declared as usual with the xmlns keyword.
• It must contain the reference to the soap envelope namespace uri
• Env is used as the namespace qualifier referring to uri.
• This rule ensures that all conforming messages are using exactly the same
namespace and xml schema, and therefore the same processing rules.
• Can specify a set of encoding rules serializing the application
defined xml data over the network.
• Both the provider and requestor must agree on the encoding
• Can use the global encoding style attribute

3/6/2024 HiLCoE School of Computer Science & Technology 22


SOAP header
• The <Header> may contain information about where the document shall be sent,
where it originated, and may even carry digital signatures.
• Purpose :
• To encapsulate extensions to the message format without having to couple
them to the payload or to modify the fundamental structure of soap.
• Provides for extensibility.
• Security, transactions, object references, billing, QOS attributes, and many
others
• For example, the header information can be used to supply authentication
credentials to a Web service. Rather than requiring every single method call
on the Web service to ask for user name and password, this information can
be included in the SOAP .

3/6/2024 HiLCoE School of Computer Science & Technology 23


SOAP header example:

3/6/2024 HiLCoE School of Computer Science & Technology 24


SOAP header - SOAP intermediaries

3/6/2024 HiLCoE School of Computer Science & Technology 25


Example: SOAP message path for validating a
purchase order

3/6/2024 HiLCoE School of Computer Science & Technology 26


Example : A header block with message routing

3/6/2024 HiLCoE School of Computer Science & Technology 27


SOAP body
✓Is the area of the SOAP message where the application-specific XML
data (payload) being exchanged in the message is placed.
✓Must be present and must be an immediate child of the envelope.
✓Contains either the application-specific data or a fault message.
✓Application-specific data is the information that is exchanged with a web
service.
✓It can be arbitrary xml data or parameters to a method call.

3/6/2024 HiLCoE School of Computer Science & Technology 28


The SOAP communication model
• SOAP supports two possible communication styles: RPC and document (or
message).
• SOAP defines encoding rules (commonly known as encoding styles) for
serialization of a graph of typed objects
• The encoding rules help in two areas:
1. Given a schema in any notation consistent with the type system described, a
schema for an xml grammar may be constructed.
2. Given a type-system schema and a particular graph of values conforming to that
schema, an XML instance may be constructed, using this schema and elements in
the SOAP .
• The SOAP communication styles come in four flavors: RPC/Literal,
Document/Literal, RPC/Encoded, and Document/Encoded.
URI = "http://www.w3.org/ 2003/05/soap-encoding".
3/6/2024 HiLCoE School of Computer Science & Technology 29
RPC-style Web services
o An RPC-style Web service appears as a remote object to a client application.
o Clients express their request as a method call with a set of arguments, which returns a response
containing a return value.

Example :Figure RPC-style Web service for


calculating the price of a given product

3/6/2024 HiLCoE School of Computer Science & Technology 30


Rules for packaging an rpc/literal request in a
soap envelope
◆ A URI identifying the transport address for the call is required.
◆ An RPC request message contains the method name and the input
parameters of the call.
◆ The names and the physical order of the parameters must
correspond to the names and physical order of the parameters in the
method being invoked.
◆ An RPC response message contains the return value and any output
parameters (or a fault).

3/6/2024 HiLCoE School of Computer Science & Technology 31


Example :
price quote
request-response
message
Listing: Example of an RPC-style SOAP body

Request

Listing :Example of a SOAP RPC response message

3/6/2024 HiLCoE School of Computer Science & Technology 32


Document (message)-style Web services
❑Are message driven.
❑When a client invokes a
messagestyle Web service,
the client typically sends it
an entire document, such
as a purchase order, rather
than a discrete set of
parameters.

3/6/2024 HiLCoE School of Computer Science & Technology 33


HTTP binding with the SOAP
• SOAP requests are transported in the body of an HTTP POST method,
which transmits the request content in the body of the HTTP request
message.
• With POST, the SOAP envelope becomes the data part of an HTTP
request message.
• The SOAP response is returned in the HTTP response (see Figure)

3/6/2024 HiLCoE School of Computer Science & Technology 34


Fig: Usage of the SOAP HTTP POST method
3/6/2024 HiLCoE School of Computer Science & Technology 35
Listing : Sample HTTP/SOAP enveloped request
3/6/2024 HiLCoE School of Computer Science & Technology 36
Response

Request

Listing RPC return sent by the purchase order


service application

3/6/2024 HiLCoE School of Computer Science & Technology 37


Advantages of SOAP
◆ Simplicity: SOAP is simple as it based on XML, which is highly structured and easy to parse.
◆ Portability: SOAP is portable without any dependencies on the underlying platform like byte-ordering
issues or machine-word widths.
◆ Firewall-friendly: Posting data over HTTP means not only that the delivery mechanism is widely
available but also that SOAP is able to get past firewalls that pose problems for other methods.
◆ Use of open standards: SOAP uses the open standard of XML to format the data, which makes it easily
extendable and well supported.
◆ Interoperability: SOAP is built on open, rather than vendor-specific, technologies and facilitates true
distributed interoperability and loosely coupled applications.
◆ Universal acceptance: SOAP is the most widely accepted standard in the message
communication domain.
◆ Resilience to changes: Changes to the SOAP infrastructure will likely not affect applications using the
protocol, unless significant serialization changes are made to
the SOAP specification

3/6/2024 HiLCoE School of Computer Science & Technology 38


Lab:
• Define a schema for a flight availability request application that
requests flight availability for a city pair on a specific date for a
specific number and type of passengers. Optional request information
can include: time or time window, connecting cities, client
preferences, e.g., airlines, flight types, etc. The request can be
narrowed to request availability for a specific airline, specific flight, or
specific booking class on a specific flight
• Write a simple SOAP program that returns information about
commercial flights from the XML Schema

3/6/2024 HiLCoE School of Computer Science & Technology 39

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy