List of Topics
 What are Web Services ?
 How it works ?
 Why Web Services?
 Architecture
 Components
 Security
 How Web Service is implemented?
 Web services samples
 REST
 Web Services can convert your application into a Web-
application which can publish its function or message to
the rest of the world.
 The basic Web Services platform is XML + HTTP
 A application which run on web (Internet or Intranet) and
provides generic services
 The services provided are through the web and in a
standardized format which makes it generic and
independent on the platform or the protocol on which the
service was requested.
What are web services?
What are Web Services cont...
 Web services are open standard ( XML, SOAP, HTTP etc.) based Web
applications that interact with other web applications for the purpose
of exchanging data
 There are two types of Webservices
 SOAP (JAX-WS , Java API for XML Web Services)
 REST (JAX-RS, Java API for RESTful Web Services)
To summarize, a complete web service is, therefore, any service that:
 Is available over the Internet or private (intranet) networks
 Uses a standardized XML messaging system
 Is not tied to any one operating system or programming language
 Is self-describing via a common XML grammar
 Is discoverable via a simple find mechanism
Why Web services ?
 Exposing the existing function on to network:
A Web service is a unit of managed code that can be remotely invoked using
HTTP, that is, it can be activated using HTTP requests. So, Web Services allows
you to expose the functionality of your existing code over the network. Once it
is exposed on the network, other application can use the functionality of your
program.
 Connecting Different Applications i.e. Interoperability:
Web Services allows different applications to talk to each other and share data
and services among themselves. Other applications can also use the services of
the web services. For example VB or .NET application can talk to java web
services and vice versa. So, Web services is used to make the application
platform and technology independent.
Why Web services continued…
 Standardized Protocol:
Web Services uses standardized industry standard protocol for the
communication. All the four layers (Service Transport, XML Messaging, Service
Description and Service Discovery layers) uses the well defined protocol in the
Web Services protocol stack. This standardization of protocol stack gives the
business many advantages like wide range of choices, reduction in the cost due
to competition and increase in the quality.
 Low Cost of communication:
Web Services uses SOAP over HTTP protocol for the communication, so you
can use your existing low cost internet for implementing Web Services. Beside
SOAP over HTTP, Web Services can also be implemented on other reliable
transport mechanisms like FTP etc.
Architecture
Architecture cont…
Web service roles
There are three major roles within the web service
architecture
 Service provider: This is the provider of the web service. The service
provider implements the service and makes it available on the Internet.
 Service requestor: This is any consumer of the web service. The
requestor utilizes an existing web service by opening a network
connection and sending an XML request.
 Service registry: This is a logically centralized directory of services.
The registry provides a central place where developers can publish new
services or find existing ones.
Web Service protocol stack
Protocol stack cont…
 Service transport: This layer is responsible for transporting messages
between applications. Currently, this layer includes hypertext transfer
protocol (HTTP), Simple Mail Transfer Protocol (SMTP), file transfer
protocol (FTP), and newer protocols, such as Blocks Extensible
Exchange Protocol (BEEP).
 XML messaging: This layer is responsible for encoding messages in a
common XML format so that messages can be understood at either
end. Currently, this layer includes XML-RPC and SOAP.
 Service description: This layer is responsible for describing the public
interface to a specific web service. Currently, service description is
handled via the Web Service Description Language (WSDL).
 Service discovery: This layer is responsible for centralizing services
into a common registry, and providing easy publish/find functionality.
Currently, service discovery is handled via Universal Description,
Discovery, and Integration (UDDI).
Components of Web Service
 SOAP (Simple Object Access Protocol)
 Protocol based on XML , used for message transfer
 WSDL (Web Service Description Language)
 XML file used to describe the Web service and how to access them
 UDDI (Universal Description and Discovery Integration)
 Used to register and search for web service
 Directory of web service
 JAX-RPC
 For intercommunication
 HTTP
 For message transfer
What is SOAP?
 SOAP stands for Simple Object Access Protocol
 SOAP is a communication protocol
 SOAP is a format for sending messages
 SOAP is designed to communicate via Internet
 SOAP is platform independent
 SOAP is language independent
 SOAP is based on XML
 SOAP is simple and extensible
 SOAP allows you to get around firewalls
 SOAP is a W3C standard
SOAP is an XML-based protocol to let applications exchange information over
HTTP.
Or more simple: SOAP is a protocol for accessing a Web Service.
What is WSDL?
 WSDL stands for Web Services Description Language
 WSDL is based on XML
 WSDL is used to describe Web services
 WSDL is used to locate Web services
 WSDL is a W3C standard
WSDL is an XML-based language for locating and describing Web services.
What is UDDI?
 UDDI stands for Universal Description, Discovery and
Integration
 UDDI is a directory for storing information about web
services
 UDDI is a directory of web service interfaces described by
WSDL
 UDDI communicates via SOAP
UDDI is a directory service where companies can register and search for
Web services.
XML-RPC
This is the simplest XML based protocol for exchanging
information between computers.
 XML-RPC is a simple protocol that uses XML messages
to perform RPCs.
 Requests are encoded in XML and sent via HTTP POST.
 XML responses are embedded in the body of the HTTP
response.
 XML-RPC is platform-independent.
 XML-RPC allows diverse applications to communicate.
 XML-RPC is the easiest way to get started with web
services.
Security
 Confidentiality
If a client sends an XML request to a server, then question is that can we ensure
that the communication remains confidential?
Answer lies here
 XML-RPC and SOAP run primarily on top of HTTP.
 HTTP has support for Secure Sockets Layer (SSL).
 Communication can be encrypted via the SSL.
 SSL is a proven technology and widely deployed.
 Authentication
If a client connects to a web service, how do we identify the user? And is the
user authorized to use the service?
Following options can be considered but there is no clear consensus on a strong
authentication scheme.
 HTTP includes built-in support for Basic and Digest authentication, and services can
therefore be protected in much the same manner as HTML documents are currently
protected.
Security cont…
 SOAP Security Extensions: Digital Signature (SOAP-DSIG). DSIG leverages public
key cryptography to digitally sign SOAP messages. This enables the client or server to
validate the identity of the other party.
 The Organization for the Advancement of Structured Information Standards
(OASIS) is working on the Security Assertion Markup Language (SAML, It is an
XML-based open standard data format for exchanging authentication and
authorization data between parties, in particular, between an identity provider and a
service provider).
 Network Security
There is currently no easy answer to this problem, and it has been the subject
of much debate. For now, if you are truly intent on filtering out SOAP or XML-
RPC messages, one possibility is to filter out all HTTP POST requests that set
their content type to text/xml.
How Web Service is implemented ?
 Build and Publish
 Find
 Bind and Invoke
Web Service Implementation Cont…
 Pre Conditions
 No one will be able to use your service
 Step 1 :Build and Publish
 Build
 Create your application
 Create your contract file (WSDL)
 Publish
 Register your application as a web service onto any registry
 This process happens on UDDI using a separate SOAP request
 This process is useful only if your web service should be accessible using
Internet
 Post conditions
 Your web service will be available to the Public (If published to any
registry) or will be accessible to intranet users
Web Service Implementation Cont…
 Pre Conditions
 The user needs to access a service but is not aware of the service
details
 Step 2 :Find
 Find
 Search in the registry for a service which provides your needs
 Obtain the necessary details about the service
 Post conditions
 The user will have all the details about the service and gets
ready to contact the service
Web Service Implementation Cont…
 Pre Conditions
 The user will have the contract necessary to identify and call the
service
 Step 3 :Bind
 Bind
 Use the contract file to build the request message.
 Invoke
 Send a request to the service and request for the necessary operation
available from the service.
 The request should be sent in the protocol which is required by the
service
 Post conditions
 The user will receive the response from the service in a format
specified in the contract file.
Web Services samples
 Eclipse tutorial link :
http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/ind
ex.html
 Bottom to Top approach
 JAVA to WSDL
 Top to bottom approach
 WSDL to JAVA

Web services

  • 2.
    List of Topics What are Web Services ?  How it works ?  Why Web Services?  Architecture  Components  Security  How Web Service is implemented?  Web services samples  REST
  • 3.
     Web Servicescan convert your application into a Web- application which can publish its function or message to the rest of the world.  The basic Web Services platform is XML + HTTP  A application which run on web (Internet or Intranet) and provides generic services  The services provided are through the web and in a standardized format which makes it generic and independent on the platform or the protocol on which the service was requested. What are web services?
  • 4.
    What are WebServices cont...  Web services are open standard ( XML, SOAP, HTTP etc.) based Web applications that interact with other web applications for the purpose of exchanging data  There are two types of Webservices  SOAP (JAX-WS , Java API for XML Web Services)  REST (JAX-RS, Java API for RESTful Web Services) To summarize, a complete web service is, therefore, any service that:  Is available over the Internet or private (intranet) networks  Uses a standardized XML messaging system  Is not tied to any one operating system or programming language  Is self-describing via a common XML grammar  Is discoverable via a simple find mechanism
  • 5.
    Why Web services?  Exposing the existing function on to network: A Web service is a unit of managed code that can be remotely invoked using HTTP, that is, it can be activated using HTTP requests. So, Web Services allows you to expose the functionality of your existing code over the network. Once it is exposed on the network, other application can use the functionality of your program.  Connecting Different Applications i.e. Interoperability: Web Services allows different applications to talk to each other and share data and services among themselves. Other applications can also use the services of the web services. For example VB or .NET application can talk to java web services and vice versa. So, Web services is used to make the application platform and technology independent.
  • 6.
    Why Web servicescontinued…  Standardized Protocol: Web Services uses standardized industry standard protocol for the communication. All the four layers (Service Transport, XML Messaging, Service Description and Service Discovery layers) uses the well defined protocol in the Web Services protocol stack. This standardization of protocol stack gives the business many advantages like wide range of choices, reduction in the cost due to competition and increase in the quality.  Low Cost of communication: Web Services uses SOAP over HTTP protocol for the communication, so you can use your existing low cost internet for implementing Web Services. Beside SOAP over HTTP, Web Services can also be implemented on other reliable transport mechanisms like FTP etc.
  • 7.
  • 8.
  • 9.
    Web service roles Thereare three major roles within the web service architecture  Service provider: This is the provider of the web service. The service provider implements the service and makes it available on the Internet.  Service requestor: This is any consumer of the web service. The requestor utilizes an existing web service by opening a network connection and sending an XML request.  Service registry: This is a logically centralized directory of services. The registry provides a central place where developers can publish new services or find existing ones.
  • 10.
  • 11.
    Protocol stack cont… Service transport: This layer is responsible for transporting messages between applications. Currently, this layer includes hypertext transfer protocol (HTTP), Simple Mail Transfer Protocol (SMTP), file transfer protocol (FTP), and newer protocols, such as Blocks Extensible Exchange Protocol (BEEP).  XML messaging: This layer is responsible for encoding messages in a common XML format so that messages can be understood at either end. Currently, this layer includes XML-RPC and SOAP.  Service description: This layer is responsible for describing the public interface to a specific web service. Currently, service description is handled via the Web Service Description Language (WSDL).  Service discovery: This layer is responsible for centralizing services into a common registry, and providing easy publish/find functionality. Currently, service discovery is handled via Universal Description, Discovery, and Integration (UDDI).
  • 12.
    Components of WebService  SOAP (Simple Object Access Protocol)  Protocol based on XML , used for message transfer  WSDL (Web Service Description Language)  XML file used to describe the Web service and how to access them  UDDI (Universal Description and Discovery Integration)  Used to register and search for web service  Directory of web service  JAX-RPC  For intercommunication  HTTP  For message transfer
  • 13.
    What is SOAP? SOAP stands for Simple Object Access Protocol  SOAP is a communication protocol  SOAP is a format for sending messages  SOAP is designed to communicate via Internet  SOAP is platform independent  SOAP is language independent  SOAP is based on XML  SOAP is simple and extensible  SOAP allows you to get around firewalls  SOAP is a W3C standard SOAP is an XML-based protocol to let applications exchange information over HTTP. Or more simple: SOAP is a protocol for accessing a Web Service.
  • 14.
    What is WSDL? WSDL stands for Web Services Description Language  WSDL is based on XML  WSDL is used to describe Web services  WSDL is used to locate Web services  WSDL is a W3C standard WSDL is an XML-based language for locating and describing Web services.
  • 15.
    What is UDDI? UDDI stands for Universal Description, Discovery and Integration  UDDI is a directory for storing information about web services  UDDI is a directory of web service interfaces described by WSDL  UDDI communicates via SOAP UDDI is a directory service where companies can register and search for Web services.
  • 16.
    XML-RPC This is thesimplest XML based protocol for exchanging information between computers.  XML-RPC is a simple protocol that uses XML messages to perform RPCs.  Requests are encoded in XML and sent via HTTP POST.  XML responses are embedded in the body of the HTTP response.  XML-RPC is platform-independent.  XML-RPC allows diverse applications to communicate.  XML-RPC is the easiest way to get started with web services.
  • 17.
    Security  Confidentiality If aclient sends an XML request to a server, then question is that can we ensure that the communication remains confidential? Answer lies here  XML-RPC and SOAP run primarily on top of HTTP.  HTTP has support for Secure Sockets Layer (SSL).  Communication can be encrypted via the SSL.  SSL is a proven technology and widely deployed.  Authentication If a client connects to a web service, how do we identify the user? And is the user authorized to use the service? Following options can be considered but there is no clear consensus on a strong authentication scheme.  HTTP includes built-in support for Basic and Digest authentication, and services can therefore be protected in much the same manner as HTML documents are currently protected.
  • 18.
    Security cont…  SOAPSecurity Extensions: Digital Signature (SOAP-DSIG). DSIG leverages public key cryptography to digitally sign SOAP messages. This enables the client or server to validate the identity of the other party.  The Organization for the Advancement of Structured Information Standards (OASIS) is working on the Security Assertion Markup Language (SAML, It is an XML-based open standard data format for exchanging authentication and authorization data between parties, in particular, between an identity provider and a service provider).  Network Security There is currently no easy answer to this problem, and it has been the subject of much debate. For now, if you are truly intent on filtering out SOAP or XML- RPC messages, one possibility is to filter out all HTTP POST requests that set their content type to text/xml.
  • 19.
    How Web Serviceis implemented ?  Build and Publish  Find  Bind and Invoke
  • 20.
    Web Service ImplementationCont…  Pre Conditions  No one will be able to use your service  Step 1 :Build and Publish  Build  Create your application  Create your contract file (WSDL)  Publish  Register your application as a web service onto any registry  This process happens on UDDI using a separate SOAP request  This process is useful only if your web service should be accessible using Internet  Post conditions  Your web service will be available to the Public (If published to any registry) or will be accessible to intranet users
  • 21.
    Web Service ImplementationCont…  Pre Conditions  The user needs to access a service but is not aware of the service details  Step 2 :Find  Find  Search in the registry for a service which provides your needs  Obtain the necessary details about the service  Post conditions  The user will have all the details about the service and gets ready to contact the service
  • 22.
    Web Service ImplementationCont…  Pre Conditions  The user will have the contract necessary to identify and call the service  Step 3 :Bind  Bind  Use the contract file to build the request message.  Invoke  Send a request to the service and request for the necessary operation available from the service.  The request should be sent in the protocol which is required by the service  Post conditions  The user will receive the response from the service in a format specified in the contract file.
  • 23.
    Web Services samples Eclipse tutorial link : http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/ind ex.html  Bottom to Top approach  JAVA to WSDL  Top to bottom approach  WSDL to JAVA