0% found this document useful (0 votes)
23 views

Web Services

Services

Uploaded by

Arun Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Web Services

Services

Uploaded by

Arun Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 32

Module 3- WEB SERVICES

• AGENDA
• Service Descriptions
• Web services Description Language
• Messaging with SOAP (Simple Object Accessing Protocol)
• Service Discovery
• UDDI (Universal Description, Discovery and Integration)
• Message Exchange Pattern
• Orchestration
• Choreography
• WS Transactions
• Today we will learn

1. What is Web Service


2.Basic concept behind Web Service
3.Why we use it

Web Service-Service available over the Web.


WEB SERVICES DESCRIPTION

• Web services are application components


• Web services communicate using open protocols
• Web services are self-contained and self-describing
• Web services can be used by other applications
• XML is the basis for Web services
CONTINUED……

Web service is a self –describing, self-containing modular application.


Descriptive logic that is packaged, so that it can be located and invoked
programmatically over the internet using a set of low overhead, open
standard network and application protocols(i.e SOAP,UDDI,XML etc)
Why WEB SERVICES

• Interoperability has highest priority.


• When all major platforms could access the Web using Web
browsers, different platforms could interact.
• For these platforms to work together, Web applications were
developed.
• Using Web services your application can publish its function
or message to the rest of the world.
• Web services uses XML to code and decode your data and
SOAP to transport it using open protocols.
Components of a Web Service
•SOAP-A standard way for communication.
•XML- A uniform data representation and exchange
mechanism.
•WSDL-A standard meta language to describe the
services offered.
•UDDI-A mechanism to register and locate WS based
applications.
What Is WSDL
• WSDL stands for Web Services Description Language
• WSDL was developed by Microsoft and IBM initially
• WSDL is an XML-based language for describing Web
services and how to access them.
• WSDL is written in XML.
• WSDL is an XML document
• A Web service is described by:
• 1. Message format.
• 2. Simple message exchange(operations)
WSDL USAGE

• WSDL is often used in combination with SOAP and


XML Schema to provide web services over the Internet
• A client program connecting to a web service can read
the WSDL to determine what functions are available on
the server.
• Any special datatypes used are embedded in the
WSDL file in the form of XML Schema.
• The client can then use SOAP to actually call one of
the functions listed in the WSDL.
CONTINUED…..

• WSDL breaks down web services into three specific,


identifiable elements that can be combined or reused
once defined.
• The three major elements of WSDL that can be defined
separately are −
• Types
• Operations
• Binding
• A WSDL document has various elements, but they are
contained within these three main elements, which can
be developed as separate documents and then they
can be combined or reused to form complete WSDL
files.
Cont….

• Operation − It is the 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 − It is an abstract set of operations mapped
to one or more end-points, defining the collection of
operations for a binding; the collection of operations, as
it is abstract, can be mapped to multiple transports
through various bindings.
• Binding − It is the concrete protocol and data formats
for the operations and messages defined for a
particular port type.
Elements of WSDL

• 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
• 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
Cont…

In addition to these major elements, the WSDL


specification also defines the following utility elements
•Documentation − This element is used to provide
human-readable documentation and can be included
inside any other WSDL element.
•Import − This element is used to import other WSDL
documents or XML Schemas.
STRUCTURE OF WSDL
<definitions>

<types>
datatype definition….
</types>

<message>
definition of the data being communicated…..
</message>

<portType>
set of operations……
</portType>

<binding>
protocol and data format specification……
</binding>

</definitions>
• The <definitions> element must be the root element of
all WSDL documents. It defines the name of the web
service.

<definitions name="HelloService"
targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
................................................
</definitions>
• From the above example, we can conclude that definitions −
• is a container of all the other elements.
• specifies that this document is called HelloService.
• specifies a targetNamespace attribute. The targetNamespace is a
convention of XML Schema that enables the WSDL document to refer to
itself. In this example, we have specified a targetNamespace of
http://www.examples.com/wsdl/HelloService.wsdl
• specifies a default namespace: xmlns=http://schemas.xmlsoap.org/wsdl/.
All elements without a namespace prefix, such as message or portType,
are therefore assumed to be a part of the default WSDL namespace.
• specifies numerous namespaces that are used throughout the remainder
of the document.
<types>
<schema targetNamespace = "http://example.com/stockquote.xsd"
xmlns = "http://www.w3.org/2000/10/XMLSchema">

<element name = "TradePriceRequest">


<complexType>
<all>
<element name = "tickerSymbol" type = "string"/>
</all>
</complexType>
</element>

<element name = "TradePrice">


<complexType>
<all>
<element name = "price" type = "float"/>
</all>
</complexType>
</element>

</schema>
</types>
• Types are XML documents, or document parts.
• The types element describes all the data types used
between the client and the server.
• WSDL is not tied exclusively to a specific typing
system.
• WSDL uses the W3C XML Schema specification as its
default choice to define data types.
• If the service uses only XML Schema built-in simple
types, such as strings and integers, then types element
is not required.
• WSDL allows the types to be defined in separate
elements so that the types are reusable with multiple
web services.
• <message name = "SayHelloRequest">
• <part name = "firstName" type = "xsd:string"/>
• </message>

• <message name = "SayHelloResponse">


• <part name = "greeting" type = "xsd:string"/>
• </message>
• The <message> element describes the data being
exchanged between the web service providers and the
consumers.
• Each Web Service has two messages: input and
output.
• The input describes the parameters for the web service
and the output describes the return data from the web
service.
• Each message contains zero or
more <part> parameters, one for each parameter of
the web service function.
• Each <part> parameter associates with a concrete type
defined in the <types> container element.
• <portType name = "Hello_PortType">
• <operation name = "sayHello">
• <input message = "tns:SayHelloRequest"/>
• <output message = "tns:SayHelloResponse"/>
• </operation>
• </portType>
• The <portType> element combines multiple message
elements to form a complete one-way or round-trip
operation.
• For example, a <portType> can combine one request
and one response message into a single
request/response operation. This is most commonly
used in SOAP services. A portType can define multiple
operations.
SOAP:Simple Object Access Protocol

What is SOAP?
– SOAP is a communication protocol
– SOAP is for communication between applications
– 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 will be developed as a W3C standard
• SOAP 1.0: Microsoft, Userland, DevelopMentor
– Specific to COM and HTTP
• SOAP 1.1: includes contributions from IBM and Lotus
– Substitutable transport binding (not just HTTP)
– Substitutable language binding (e.g. Java)
– Substitutable data encoding
– Completely vendor-neutral
– Independent of: programming language, object model, operating system,
or platform
• SOAP 1.2: current working draft from w3.org “XML Protocol” working
group
SOAP Message Structure

• Request and Response messages


– Request invokes a method on a remote
object – Response returns result of
running the method

• SOAP specification defines an


“envelop”
– “envelop” wraps the message itself
– Message is a different vocabulary
– Namespace prefix is used to distinguish
the two parts
SOAP Request message
SOAP Response message
• SOAP hides the technical choices and
implementation details from both parties
Why SOAP?

• Other distributed technologies failed on the Internet


– Unix RPC – requires binary-compatible Unix implementations at
each endpoint
– CORBA – requires compatible ORBs
– RMI – requires Java at each endpoint
– DCOM – requires Windows at each endpoint
• SOAP is the platform-neutral choice
– Simply an XML wire format
– Places no restrictions on the endpoint implementation technology
choices
SOAP Usage Models

• RPC-like message exchange


– Request message bundles up method name and parameters
– Response message contains method return values
– However, it isn’t required by SOAP
• SOAP specification allows any kind of body content
– Can be XML documents of any type
– Example:
• Send a purchase order document to the inbox of B2B partner
• Expect to receive shipping and exceptions report as response
UDDI

• Introduction
• History
• Architecture
• Data inside UDDI
• UDDI Technical Overview
• UDDI data model
• Working
• Conclusion
• References
INTRODUCTION

What is UDDI?
• UDDI stands for Universal Description, Discovery, and
Integration.
• Defines a way to publish and discover information about web
services.
• “Web service” describes specific business functionality to be
used by another company.
• It represents technical specification for publishing and
finding businesses and Web services.

You might also like