Presented By,
S.ANITHA
AP/MCA
VIIMS
Contents
1 Introduction
2 SOAP
3 WSDL
4 UDDI
Web Services?
Any piece of s/w that makes itself
available over the internet and uses
XML messaging system.
Due to XML communication, WS is
OS or pgming language independent.
Eg:- Java can talk with Perl; Windows
app can talk with Unix app.
Web Services
Services available on web
Examples:
1. Social media web service:
communicate with your friends
2. E-commerce webservice :
online purchasing
Web Site vs Web Services
Web site  human consumption
WS  application consumption
Why Web Services?
App Server1 App Server2
m/c1 m/c2
X
(jar)
getProducts()
MVC
Client calls getProducts()
getProducts()
Why Web Services?
getProducts() in Appserver2 can’t
call getProducts() in AppServer1.
Solution:
Make the getProducts() as jar file
& put it in AppServer2.
Why Web Services?
Problems:
Db difference in AppServer2
Modifications in getProducts()
in AppServer1 can’t reflect in
AppServer2. (so repack another
jar for modified getProductsI())
Why Web Services?
App Server1 App Server2
m/c1 m/c2
direct call using
WS
getProducts()
MVC
Client calls getProducts()
getProducts()
Why Web Services?
+ve: interoperable
 Language independent
java ws can invoke .Net WS
H/W independent
Ws running in Windows can call
Unix WS
Why Web Services?
+ve: interoperable
Eg:-
Google Maps In Chrome under
windows
Google Maps in IE under
Redhat Linux
Building Blocks
Web services Building Blocks
SOAP (Simple Object Access Protocol)
XML based transport protocol
WSDL (Web Services Description Language)
XML based
To describe WS
UDDI(Universal Description, Discovery,
and Integration)
.NET based
To discover WS
SOAP (Simple Object Access Protocol)
SOAP = XML + HTTP
XML  to encode & decode data
HTTP  to transport data
Def:-
XML based communication protocol which is
language & platform independent.
Why SOAP?
DCOM & CORBA objects communicate
using RPC.
-ve of RPC:
Blocked by firewalls & proxy servers.
+ve of SOAP:-
No such blocking, moreover by using SOAP,
applications running on different OS, different
technologies, different PL can communicate
with each other.
SOAP Elements
1. Envelope Element (required)
2. Header Element (opt)
3.Body Element (required)
4.Fault Element (opt)
SOAP Elements
1. Envelope element identities the XML
as a SOAP message.
2. Header element contains WS std
info like authentication, pay load.
3. Body element contains the actual
information, call & response
information.
4. Fault element provides error
information occurred while
processing the msg.
SOAP Message Skeleton
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-
encoding">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
SOAP HTTP Binding
Request
Response
An HTTP client connects to an
HTTP server using TCP.
HTTP
Client
HTTP
Server
SOAP HTTP Binding
After establishing a connection, the client
can send an HTTP request message to
the server:
POST /item HTTP/1.1
Host: 189.123.255.239
Content-Type: text/plain
Content-Length: 200
SOAP HTTP Binding
The server then processes the request
and sends an HTTP response back to the
client.
The response contains a status code that
indicates the status of the request:
200 OK  status code
Content-Type: text/plain
Content-Length: 200
Why HTTP for SOAP?
HTTP is already a widely implemented, and well
understood, protocol.
SOAP messages are one-way, instead of two-way.
one from the "client" to the "server“ and one from the
"server" back to the "client”. But SOAP specification
also says that when a request/response protocol, such
as HTTP, is used, these two messages can be
combined in the request/response of the protocol.
Most firewalls are already configured to work with
HTTP.
HTTP makes it easy to build in security, with Secure
Sockets Layer (SSL)
WSDL
WSDL (Web Services Description Language)
• WSDL is an XML document to describe
web services and how to access web
services
A client program connecting to a web
service can read the WSDL to determine
what functions are available on the
server.
The client can then use SOAP to actually
call one of the functions listed in the
WSDL.
WSDL Document Structure
Abstract
part What?
Ie tell
about WS
How?
Ways to
access WS
Location
of WS
Definition Element
 root element of all WSDL documents
 Associates WS with its namespaces.
 Defines one or more WS.
contains all the service elements described
here.
• Types to define datatypes used by
WS using XSD.
• Message  piece of information
exchanged between C/S.
WSDL (Web Services Description Language)
• Operation  actions which are
supported by WS.
• PortType  collection of operations
• Binding  links abstract section with
actual section or concrete section.
• Port endpoint defined in terms of URL
• Service  how to consume WS?
Collection of related end pts.
Definition Element
<definitions name=“MyService“
targetNamespace="http://www.mysite.com/myservice.wsdl"
xmlns=http://schemas.xmlsoap.org/wsdl/
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/
xmlns:tns="http://www.mysite.com/myservice.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 name: optional attribute describes overall
service.
Definition Element
targetNamespace  unique logical namespace
for WS.
xmlns  default WSDL namespace which
contains <definition>, <message> …
xmlns:tns  optional attribute contains same
value as targetNamespace.
Xmlns:soap & xmlns:xsd  std namespace for
SOAP information and data types.
Types Element
To define datatypes used by WS using XSD.
<types>
<schema targetNamespace
="http://www.mysite.com/myservice.wsdl"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name=“MyRequest">
</element>
</schema>
</types>
User defined schema
Std schema
Message Element
Definition element contains one or more message
elements.
<message name="getMyInput">
<part name="term" type="xs:string"/>
</message>
<message name="getMyOutput">
<part name="value" type="xs:string"/>
</message>
 Each msg element can contain any no of part
child elements.
2 message elements (1- request, 2-
response)
PortType Element
PortType element contains one or more operation
elements.
portType  class or I/f
Operation  method
<portType name=“MyServicePortType">
<operation name=“MyMethod">
<input message=“tns:getMyInput"/>
<output message=" tns:getMyOutput"/>
</operation>
</portType>
Binding Element
Communication protocol used by WS (SOAP)
Service Element
• Web service clients can learn the following from
the service element:
– where to access the service,
– through which port to access the web service, and
– how the communication messages are defined.
• documentation element  to provide human-
readable documentation.
Service Element
<service name=“MyService">
<documentation>WSDL File for MyService</documentation>
<port name=“MyServicePort” binding="tns:MyServiceBinding“>
<soap:address
location="http://www.mysite.com/MyService/">
</port>
</service>
Example pgm: combine all elements code
UDDI
UDDI (Universal Description, Discovery, and Integration)
• UDDI is platform independent registry in
which business can publish their services &
also it provides mechanism to locate web
services
By OASIS (Advancing Open Standard for
Information Society)
UDDI provides publication & discovery of WS
which are key components of SOA.
UDDI Basics
Public UDDI registries are hosted by
companies such as IBM, Microsoft.
DNS Vs UDDI
DNS (nameIP address) is a static DB.
Where as UDDI provides information on how
to find & invoke WS.
GUID (Globally Unique Identifiers)
to uniquely identify the resources in each
registry.
3 Levels of Information in UDDI
White Pages  Companies general information
such as Name, Address, Contact Number.
Yellow Pages Looking up companies by their
kind of services.
Green Pages Provides information about how
to interact with companies web services.
UDDI Structure
UDDI provides 4 types of information.
1. Business Information
2. Service Information
3. Binding Information
4. Service Specification
UDDI Structure
Business Entity
Business Service
Business Service
Binding Template
Binding Template
Binding Template
Binding Template
tModel
tModel
tModel
tModel
UDDI Structure
1.Business Information (abt org,
Group of ppl who register their
services in registry)
Provided by BusinessEntity
Element.
Supports white pages & yellow
pages.
This element is top level
information manager.
UDDI Structure
2. Service Information (Resources
provided by business)
Provided by BusinessService
Element.
Supports green pages.
This element is top level
information manager.
UDDI Structure
3. Binding Information (info abt how to
bind & invoke WS)
Provided by BindingTemplate
Element.
BindingTemplate element is within
BindingService element.
UDDI Structure
4. Service Specification
Enclosed within each
BIndingTemplate Element.
tModel elements (Technical
Models)
tModel  pointer to WDSL file.

Web services overview

  • 1.
  • 2.
  • 3.
    Web Services? Any pieceof s/w that makes itself available over the internet and uses XML messaging system. Due to XML communication, WS is OS or pgming language independent. Eg:- Java can talk with Perl; Windows app can talk with Unix app.
  • 4.
    Web Services Services availableon web Examples: 1. Social media web service: communicate with your friends 2. E-commerce webservice : online purchasing
  • 5.
    Web Site vsWeb Services Web site  human consumption WS  application consumption
  • 6.
    Why Web Services? AppServer1 App Server2 m/c1 m/c2 X (jar) getProducts() MVC Client calls getProducts() getProducts()
  • 7.
    Why Web Services? getProducts()in Appserver2 can’t call getProducts() in AppServer1. Solution: Make the getProducts() as jar file & put it in AppServer2.
  • 8.
    Why Web Services? Problems: Dbdifference in AppServer2 Modifications in getProducts() in AppServer1 can’t reflect in AppServer2. (so repack another jar for modified getProductsI())
  • 9.
    Why Web Services? AppServer1 App Server2 m/c1 m/c2 direct call using WS getProducts() MVC Client calls getProducts() getProducts()
  • 10.
    Why Web Services? +ve:interoperable  Language independent java ws can invoke .Net WS H/W independent Ws running in Windows can call Unix WS
  • 11.
    Why Web Services? +ve:interoperable Eg:- Google Maps In Chrome under windows Google Maps in IE under Redhat Linux
  • 12.
  • 13.
    Web services BuildingBlocks SOAP (Simple Object Access Protocol) XML based transport protocol WSDL (Web Services Description Language) XML based To describe WS UDDI(Universal Description, Discovery, and Integration) .NET based To discover WS
  • 14.
    SOAP (Simple ObjectAccess Protocol) SOAP = XML + HTTP XML  to encode & decode data HTTP  to transport data Def:- XML based communication protocol which is language & platform independent.
  • 15.
    Why SOAP? DCOM &CORBA objects communicate using RPC. -ve of RPC: Blocked by firewalls & proxy servers. +ve of SOAP:- No such blocking, moreover by using SOAP, applications running on different OS, different technologies, different PL can communicate with each other.
  • 16.
    SOAP Elements 1. EnvelopeElement (required) 2. Header Element (opt) 3.Body Element (required) 4.Fault Element (opt)
  • 17.
    SOAP Elements 1. Envelopeelement identities the XML as a SOAP message. 2. Header element contains WS std info like authentication, pay load. 3. Body element contains the actual information, call & response information. 4. Fault element provides error information occurred while processing the msg.
  • 18.
    SOAP Message Skeleton <?xmlversion="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding"> <soap:Header> ... </soap:Header> <soap:Body> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope>
  • 19.
    SOAP HTTP Binding Request Response AnHTTP client connects to an HTTP server using TCP. HTTP Client HTTP Server
  • 20.
    SOAP HTTP Binding Afterestablishing a connection, the client can send an HTTP request message to the server: POST /item HTTP/1.1 Host: 189.123.255.239 Content-Type: text/plain Content-Length: 200
  • 21.
    SOAP HTTP Binding Theserver then processes the request and sends an HTTP response back to the client. The response contains a status code that indicates the status of the request: 200 OK  status code Content-Type: text/plain Content-Length: 200
  • 22.
    Why HTTP forSOAP? HTTP is already a widely implemented, and well understood, protocol. SOAP messages are one-way, instead of two-way. one from the "client" to the "server“ and one from the "server" back to the "client”. But SOAP specification also says that when a request/response protocol, such as HTTP, is used, these two messages can be combined in the request/response of the protocol. Most firewalls are already configured to work with HTTP. HTTP makes it easy to build in security, with Secure Sockets Layer (SSL)
  • 23.
  • 24.
    WSDL (Web ServicesDescription Language) • WSDL is an XML document to describe web services and how to access web services A client program connecting to a web service can read the WSDL to determine what functions are available on the server. The client can then use SOAP to actually call one of the functions listed in the WSDL.
  • 25.
    WSDL Document Structure Abstract partWhat? Ie tell about WS How? Ways to access WS Location of WS
  • 27.
    Definition Element  rootelement of all WSDL documents  Associates WS with its namespaces.  Defines one or more WS. contains all the service elements described here. • Types to define datatypes used by WS using XSD. • Message  piece of information exchanged between C/S.
  • 28.
    WSDL (Web ServicesDescription Language) • Operation  actions which are supported by WS. • PortType  collection of operations • Binding  links abstract section with actual section or concrete section. • Port endpoint defined in terms of URL • Service  how to consume WS? Collection of related end pts.
  • 29.
  • 30.
    Definition Element targetNamespace unique logical namespace for WS. xmlns  default WSDL namespace which contains <definition>, <message> … xmlns:tns  optional attribute contains same value as targetNamespace. Xmlns:soap & xmlns:xsd  std namespace for SOAP information and data types.
  • 31.
    Types Element To definedatatypes used by WS using XSD. <types> <schema targetNamespace ="http://www.mysite.com/myservice.wsdl" xmlns="http://www.w3.org/2000/10/XMLSchema"> <element name=“MyRequest"> </element> </schema> </types> User defined schema Std schema
  • 32.
    Message Element Definition elementcontains one or more message elements. <message name="getMyInput"> <part name="term" type="xs:string"/> </message> <message name="getMyOutput"> <part name="value" type="xs:string"/> </message>  Each msg element can contain any no of part child elements. 2 message elements (1- request, 2- response)
  • 33.
    PortType Element PortType elementcontains one or more operation elements. portType  class or I/f Operation  method <portType name=“MyServicePortType"> <operation name=“MyMethod"> <input message=“tns:getMyInput"/> <output message=" tns:getMyOutput"/> </operation> </portType>
  • 34.
  • 35.
    Service Element • Webservice clients can learn the following from the service element: – where to access the service, – through which port to access the web service, and – how the communication messages are defined. • documentation element  to provide human- readable documentation.
  • 36.
    Service Element <service name=“MyService"> <documentation>WSDLFile for MyService</documentation> <port name=“MyServicePort” binding="tns:MyServiceBinding“> <soap:address location="http://www.mysite.com/MyService/"> </port> </service> Example pgm: combine all elements code
  • 37.
  • 38.
    UDDI (Universal Description,Discovery, and Integration) • UDDI is platform independent registry in which business can publish their services & also it provides mechanism to locate web services By OASIS (Advancing Open Standard for Information Society) UDDI provides publication & discovery of WS which are key components of SOA.
  • 39.
    UDDI Basics Public UDDIregistries are hosted by companies such as IBM, Microsoft. DNS Vs UDDI DNS (nameIP address) is a static DB. Where as UDDI provides information on how to find & invoke WS. GUID (Globally Unique Identifiers) to uniquely identify the resources in each registry.
  • 40.
    3 Levels ofInformation in UDDI White Pages  Companies general information such as Name, Address, Contact Number. Yellow Pages Looking up companies by their kind of services. Green Pages Provides information about how to interact with companies web services.
  • 41.
    UDDI Structure UDDI provides4 types of information. 1. Business Information 2. Service Information 3. Binding Information 4. Service Specification
  • 42.
    UDDI Structure Business Entity BusinessService Business Service Binding Template Binding Template Binding Template Binding Template tModel tModel tModel tModel
  • 43.
    UDDI Structure 1.Business Information(abt org, Group of ppl who register their services in registry) Provided by BusinessEntity Element. Supports white pages & yellow pages. This element is top level information manager.
  • 44.
    UDDI Structure 2. ServiceInformation (Resources provided by business) Provided by BusinessService Element. Supports green pages. This element is top level information manager.
  • 45.
    UDDI Structure 3. BindingInformation (info abt how to bind & invoke WS) Provided by BindingTemplate Element. BindingTemplate element is within BindingService element.
  • 46.
    UDDI Structure 4. ServiceSpecification Enclosed within each BIndingTemplate Element. tModel elements (Technical Models) tModel  pointer to WDSL file.