1. NAME OF STAFF :S.SAYI PRIYA
NAME OF STUDENT :K.TAMILMOZHIYAL
REGISTER NUMBER :CB17S 250446
CLASS :III-BCA-B
BATCH :2017-2020
YEAR :2020
SUBJECT CODE :MCA511
3. WHAT IS SOAP
SOAP is a lightweight protocol intended for
exchanging structured information in a decentralized,
distributed environment.
SOAP uses XML technologies to define an extensible
messaging framework, which provides a message construct
that can be exchanged over a variety of underlying protocols.
The framework has been designed to be independent of
any particular programming model and other implementation-
specific semantics.
4. 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 User land in 1998
– Uses HTTP as underlying
Gen. XML Protocol Issues:
Extensibility
– All protocol architects had to agree for changes
– Avoid with namespaces
Data typing
– Single DTDs
Limited in use of XML elements
• Descriptive nature of XML sacrificed
– XML schema is a better solution
6. SOAP Envelope
The SOAP Envelope construct defines an overall framework
for expressing what is in a message and who should deal with it.
SOAP envelope conditions:
The Envelope is the top element of the XML document
representing the message.
1. The Envelope element is always the root element of a SOAP
message.
2. The Envelope element contains an optional Header
element followed by a mandatory Body element.
8. SOAP HEADER
The Header element is a generic container for control
information
It may contain any number of elements from any namespace
Header blocks should contain information that influences
payload processing
Header is optional
10. SOAP BODY
The Body element represents the message payload
SOAP BODY CODE
<soap : Body>
<x:TransferFunds xmlns : x="urn : examples-org :
banking"> <from>22-342439</from>
<to>98-283843</to>
<amount>100.00</amount>
</x:TransferFunds>
</soap : Body>
11. SOAP SECURITY
The SOAP specification does not define encryption for XML Web
Services.
This is left up to the implementer of the SOAP protocol.
ISSUESE ABOUT SECURITY:
•Encryption places a dependency on the transport protocol .
•Does the transport protocol support secure communication?
•What is the cost of encrypting all the data versus part of the data?
12. DATA ENCODING IN SOAP
• Binary data
– Base64 encoding
• Can roll your own schema
– encoding Style
– Interoperability issues
13. Contents of the SOAP Fault Element:
The SOAP <fault> element is used to transmit error and status
information within a SOAP message. The <Fault> element is a
child of the body element. There can be only
one <Fault> element in the body of a SOAP message.
The SOAP <Fault> element contents for SOAP 1.2 and
1.1 are defined in the following sections:
•SOAP 1.2 <Fault> Element Contents
•SOAP 1.1 <Fault> Element Contents
14. XML RPC
• Protocol which uses XML to encode its calls and HTTP POST
as a transport mechanism.
• XML RPC standards :
• Standards specify –
– Data types : arrays, boolean , string etc
– Structure of request and response
– Transport specs.
15. XML RPC:CRITIQUES
XML RPC : Critiques
• Simple to use, develop and consume
• Uses legacy XML
• Light weight than SOAP
• Doesn’t requires/support WSDL
• No support for i18n
• allows only one mode of method serialization.
16. Using altermative SOAP encoding
SOAP encoding styles
• SOAP uses XML to marshal data
• SOAP defines more than one encoding method to
convert data from a software object into XML format and
back again.
• The SOAP-encoded data is packaged into the body of a
message and sent to a host.
• The host then decodes the XML-formatted data back into
a software object.
17. SOAP ENCODING STYLE
SOAP Remote Procedure Call (RPC) encoding:
– also known as Section 5 encoding, which is defined by the
SOAP 1.1 specification
SOAP Remote Procedure Call Literal encoding (SOAP RPC-literal):
– which uses RPC methods to make calls but uses an XML do-it-
yourself method for marshalling the data
SOAP document-style encoding:
– which is also known as message-style or document-literal
encoding.
18. SOAP RPC ENCODING STYLE
• SOAP RPC encoding style: the simplicity.
You make a call to a remote object, passing along any
necessary parameters.
– The SOAP stack serializes the parameters into XML,
moves the data to the destination using transports such as HTTP
and SMTP,
– receives the response,
– deserializes the response back into objects, and,
– returns the results to the calling method.
It handles all the encoding and decoding, even for very
complex data types, and binds to the remote object automatically.
19. SOAP RPC literal encoding
SOAP RPC literal encoding:
Assume that you have some data already in XML format.
SOAP RPC also allows literal encoding of the XML data as a
single field that is serialized and sent to the Web service host. This is
what's referred to as RPC-literal encoding.
Since there is only one parameter -- the XML tree -- the SOAP
stack only needs to serialize one value.
The SOAP stack still deals with the transport issues to get the
request to the remote object. • The stack binds the request to the
remote object and handles the response.
20. SOAP DOCUMENT-STYLE CALL
SOAP stack sends an entire XML document to a server
without even requiring a return value.
The message can contain any sort of XML data that is
appropriate to the remote service.
The developer handles everything, including
– determining the transport (e.g., HTTP, MQ, SMTP),
– marshaling and un marshaling the body of the SOAP
envelope, and
– parsing the XML in the request and response to find the
needed data.
22. Web service Architecture
Web service Architecture
Every framework needs some sort of architecture to make sure the
entire framework works as desired. Similarly, in web services, there is
an architecture which consists of three distinct roles as given below
1.Provider - The provider creates the web service and makes it
available to client application who want to use it.
2.Requestor - A requestor is nothing but the client application that
needs to contact a web service. The client application can be a . Net,
Java, or any other language based application which looks for some
sort of functionality via a web service.
3.Broker - The broker is nothing but the application which provides
access to the UDDI. The UDDI, as discussed in the earlier topic
enables the client application to locate the web service.
23. What is WSDL
Web Services Description Language
WSDL is written in XML
WSDL is an XML document
WSDL is used to describe Web services
-What operations does the service expose?
WSDL is also used to locate Web services
-Where is the web service located?
24. WSDL major element
Element Defines
<portType> The operations performed by the
web service
<message> The messages used by the web
service
<types> The data types used by the web
service
<binding> The communication protocols
used by the web service
25. SOAP1.2 and SOAP 1.1
From SOAP/1.1 to SOAP Version 1.2 in 9 points:
You are probably familiar with SOAP/1.1. You have
heard of SOAP Version 1.2 but don't know exactly what's the
relationship between the two. This document outlines the
changes and benefits brought by SOAP Version 1.2.
1) SOAP Version 1.2: cleaner, better Web integration, more
versatile, faster.
2) Cleaner: clear processing and extensibility models,
increased interoperability.
3) Better Web integration: better integration with XML
standards and the architecture of the Web.
4) More versatile: binding framework providing protocol
independence.
5) Faster: based on XML Info set allowing performance
optimization
26. SOAP-RPC-SOAP ENCODING
RA WSDL document (WSDL = Web Service Description
Language) describes a web service. A WSDL binding describes how
the service is bound to a messaging protocol, particularly the SOAP
messaging protocol. A WSDL SOAP binding can be either a Remote
Procedure Call (RPC) style binding or a document style binding. A
SOAP binding can also have an encoded use or a literal use. This
gives four style/use models:
PC/encoded.
RPC/literal.
Document/encoded (not used in practice).
Document/literal.
Document style: The SOAP Body contains one or more child
elements called parts. There are no SOAP formatting rules for what
the body contains; it contains whatever the sender and the receiver
agrees upon.
27. RPC style: RPC implies that SOAP body contains an element with
the name of the method or operation being invoked. This element in
turn contains an element for each parameter of that
method/operation.
For applications that use serialization/ deserialization to abstract
away the data wire format, there is one more choice to be made: the
formats:
SOAP serialization format. There are two popular serialization
Encoding: SOAP encoding is a set of serialization. The rules specify
how objects, structures, arrays, and object graphs should be
serialized. Generally speaking, an application using SOAP encoding
is focused on remote procedure calls and will likely use RPC message
style. When SOAP encoding is used, the SOAP message contains
data type information within the SOAP message.
Literal: Data is serialized according to a schema. In practice, this
schema is usually expressed using W3C XML Schema. The SOAP
message does not directly contain any data type information, just a
reference (namespace) to the schema that is used.
28. WSDL STRUCTURE
<definitions>
<types> definition of
types...
</types>
<message> definition of
a message.
</message>
<portType> definition
of a port...
</portType>
<binding> definition of
a binding
</binding>
</definitions>
29. WSDL TYPE
The <types> element defines the data type that are used by the
web service.
For maximum platform neutrality, WSDL uses XML Schema
syntax to define data types.
WSDL bindings:
The <binding> element defines the message format
and protocol details for each port.
30. WSDL Usage:
WSDL Usage WSDL is often used in combination with SOAP and XML
Schema to provide web services over the Internet.
1. A client program connecting to a web service can read the WSDL
to determine what functions are available on the server.
2. The client can then use SOAP to actually call one of the functions
listed in the WSDL. WSDL Elements overview
Definition: Element must be the root element of all WSDL
documents. It defines the name of the web service, declares multiple
namespaces used throughout the remainder of the document and contains
all the service elements described here.
Data types: the data types - in the form of XML schemas or possibly
some other mechanism - to be used in the messages.
WSDL elements overview
31. Message: An abstract definition of the data in the form of a message
presented either as an arguments to be mapped to a method invocation.
Operation: An abstract definition of the operation for a message such
as naming a method, message queue or business process that will accept
and process the message.
Port type : An abstract set of operations mapped to one or more end
points, defining the collection of operations for a binding.
WSDL element condition
WSDL Elements overview (cont..)
Binding: the concrete protocol and data formats for the operations and
messages defined for a particular port type.
Port: a combination of a binding and a network address, providing the
target address of the service communication.
Service: a collection of related end points encompassing the service .
32. Structure of a WSDL Document
A WSDL document is used to describe a web service. This description
is required, so that client applications are able to understand what the
web service actually does.
The WSDL file contains the location of the web service and
The methods which are exposed by the web service.
The WSDL file itself can look very complex to any user, but it
contains all the necessary information that any client application
would require to use the relevant web service.
Below is the general structure of a WSDL file
Definition
Target Namespace
Data Types
Messages
Port type
Bindings
service
33. WSDL Elements
The WSDL file contains the following main parts
The <types> tag is used to define all the complex data types, which will
be used in the message exchanged between the client application and
the web service. This is an important aspect of the client application,
because if the web service works with a complex data type, then the
client application should know how to process the complex data type.
Data types such as float, numbers, and strings are all simple data
types, but there could be structured data types which may be provided
by the web service.
2. The <messages> tag is used to define the message which is
exchanged between the client application and the web server. These
messages will explain the input and output operations which can be
performed by the web service. An example of a message can be a
message which accepts the Employee ID of an employee, and the
output message can be the name of the employee based on the
empoyee ID provided.
34. 3.The <binding> tag is used to bind the operation to the particular port
type. This is so that when the client application calls the relevant port
type, it will then be able to access the operations which are bound to
this port type. Port types are just like interfaces. So if a client
application needs to use a web service they need to use the binding
information to ensure that they can connect to the interface provided
by that web service.
4.The <service> tag is a name given to the web service itself. Initially,
when a client application makes a call to the web service, it will
do by calling the name of the web service. For example, a web service
can be located at an address such
as http://localhost/Guru99/Tutorial.asmx . The service tag will actually
have the URL defined as http://localhost/Guru99/Tutorial.asmx, which
will actually tell the client application that there is a web service
available at this location
35. Port Type Binding
Ports are used in WSDL to define one complete operation which is offered by the web service.
In the previous topic, we saw that our web service provided 2 messages, one for the input called
"Tutorial Name Request" and the other for the output called "Tutorial Name Response."
Together the input and output message form is known as one complete operation.
WSDL provides an element called <port Type> which is used to define the operations provided
by the Web service.
So in our above example we can note the following:
1.The name of the port Type which encapsulates the operation is given as "Tutorial Port Type."
2.The operation itself is given a name of "Tutorial". So our operation basically provides a
Tutorial Name if the Tutorial ID is given as an input parameter.
3.Next is our 2 messages, one for the input and the other for the output which forms our
operation
In addition to the <port Type> element, there is also the <binding> element which is used to
define how the messages will be transferred.
36. WSDL USING SOAP
In the previous slide, we specify several things:
We will use SOAP/HTTP
We will use RPC encoding style
Other choice is literal “document” style.
We specify the namespace associated with the Echo service input
and output messages.
All of this corresponds to SOAP message parts.
We will expand this in the next lecture.
37. Differences between 1.1 and 2.0
WSDL1.1 WSDL 2.0 description
Service Services
Port endpoint
Binding Bindings
Service Contains a set of system functions
that have been exposed to the Web-based
protocols.
Defines the address or connection point to a
Web service. It is typically represented by a
simple HTTP URL string.
Specifies the interface and defines the SOAP
binding style ( RPC/Document) and transport
(SOAP Protocol). The binding section also
defines the operations