Sunteți pe pagina 1din 7

qwertyuiopasdfghjklzxcvbn

mqwertyuiopasdfghjklzxcv
bnmqwertyuiopasdfghjklzx
cvbnmqwertyuiopasdfghjkl
WEB SERVICES
zxcvbnmqwertyuiopasdfghj
klzxcvbnmqwertyuiopasdfg
-Shivani

hjklzxcvbnmqwertyuiopasd
fghjklzxcvbnmqwertyuiopa
sdfghjklzxcvbnmqwertyuio
pasdfghjklzxcvbnmqwertyu
iopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwe
rtyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbn
mqwertyuiopasdfghjklzxcv
bnmqwertyuiopasdfghjklzx
What is web services
Web services are open standard (XML, SOAP, HTTP etc.) based
Web applications that interact with other web applications for the
purpose of exchanging data.

Web services are built on top of open standards such as TCP/IP,


HTTP, Java, HTML, and XML.

A web service is a communication


between two electronic devices over a world wide web.

In other words , a web service helps to


convert your Application into a Web based Application .

To Summarize Web Service is a service that

Is available over the Internet or private (intranet) networks

Is not tied to any one operating system or programming language

SERVICE ORIENTED ARCHITECTURE

Request service
Service Service
Provider Service response Consumer
WHAT IS SOAP & WHAT IS RESTFUL

Web services which are methods provided by provider open to


consumer could be utilized by using either Soap or Restful standards.

Where can consumer find WSD


What is soap?
consumer.
contact
serve Whatbetween
UDDI
is Soapa
is?client
the registry
and anservice
appropriate
that isweb
used
service
to establish
To call a function/method on another computer, you have to specify a
number of things. Whats the name of the function/method? What
parameters values are you passing to it? What should happen if there
is an error? SOAP is an XML document that just conforms to a
standard structure to answer these questions.
Soap services need WSDL as an input why ?
Soap envelope from the consumer needs an url information of the
service provider, web service name, methods name and what
parameters & their data types do they expect. WSDL which is
published or provided to consumer directly by provider can provide this
information.

Why there is a need to test web services separately?

As the same web service can be used across wide variety of devices
if the service is checked

Once independent of device then it can be safe to use for all devices.

Where can consumer find WSDL ?

Where
Where
can consumer
can consumer
find WSDL
find WSDL
? ?
Provider can list their url for wsdl in UDDI registry service or they can
directly send the wsdl file url to consumer. UDDI is the registry service
that is used to establish contact between a client and an appropriate
web service server.

<?xml version=1.0?>
Syntax of Soap envelope
<?xmlversion="1.0"?>

<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">

<soap:Header>

{ Heres where extraneous information ,like the password data , resides}

</Soap:Header>

<soap:Body>

[Heres where the actual message content resides]

<soap:Fault>

[Here are instructions to server about how to handle errors]

</soap:Fault>

<soap:Body>

</soap:Envelope>

WHAT IS REST
REST Representational State Transfer . The name implies that when the
client sends a request to the server ,the server sends back the
representation of the resource in HTML,XML,JSON,Plain
Text,PDF,JPEG format.
Representational State Transfer (REST) is an architecture principle in
which the web services are viewed as resources and can be uniquely
identified by their URLs. The key characteristic of a RESTful Web
service is the explicit use of HTTP methods to denote the invocation
of different operations
The basic REST design principle uses the HTTP protocol methods for
typical CRUD operations:
POST - Create a resource
GET - Retrieve a resource
PUT Update a resource

DELETE - Delete a resource

HOW SIMPLE IS REST


Querying a phonebook application for the details of a given user.
Querying a phonebook application for the details of a given user.
Querying a phonebook application for the details of a given user.
Querying a phonebook application for the details of a given user.

All we have is the user's ID.


Using Web Services and SOAP, the request would look something like this:

Querying a phonebook application for the details of a given user.


Querying a phonebook application for the details of a given user.
<?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:body pb="http://www.acme.com/phonebook">
<pb:GetUserDetails>
<pb:UserID>12345</pb:UserID>
</pb:GetUserDetails>
</soap:Body>
</soap:Envelope>

(The details are not important; this is just an example.) The entire shebang now has to be sent
(using an HTTP POST request) to the server. The result is probably an XML file, but it will be
embedded, as the "payload", inside a SOAP response envelope.

And with REST? The query will probably look like this:

http://www.acme.com/phonebook/UserDetails/12345

RESTFUL SERVICE
Advantages of Restful services
1. Uniform Interface Resource request invocation is done in
{get,post,put} methods of http
2. Easy to access by using URI
3. Interoperable -> Any platform which has support for http library can
provide or consume Restful services . .net app can easily
communicate with java app
4. Stateless -> Every request from client to server for the resource is
treated as a new request which carries server details every time
when it hits server
5. Scalability -> As the http is stateless protocol application can be
scaled to different clusters for better performance

1.Actual message+ 1.Actual message .Good


soap choice for developing
header,body,envelop web services for mobile
overhead devices
2.Easy to define a 2.It is difficult to set
standard contract contract between
between provider & provider &consumer.
COMPARISONconsumer OF WEB SERVICE IMPLEMENTATION
Starting from wsdl TYPES
2.0
they made it easy
3.It supports web
services standards like
SOAP 3.It does
REST not support
\ like this
transaction web servicesstandard
management, security
which is provided by
soap web services
4. Default de facto
framework
standard for message
4.Default de facto exchange is XML/JSON
standard for message
Advantages of Web Service
Interoperability : Web services are virtually platform independent.

Usability : Web services allow the business logic of many different systems to be
exposed over the Web. This gives your applications the freedom to choose the web
services that they need. Instead of re-inventing the wheel for each client, you need only
include additional application-specific business logic on the client-side.

Reusability : It also makes it easy to deploy legacy code as a Web Service.

S-ar putea să vă placă și