четвер, 21 січня 2016 р.

About REST and SOAP services

1. Web services is a technology for transmitting data over the Internet and allowing programmatic access to that data using standard Internet protocols, typically HyperText Transfer Protocol (HTTP).
2. You can think of an individual Web service as a piece of software that performs a specific task (also known as a function), and makes that task available by exposing a set of operations that can be performed (known asmethods or Web methods) with the task. Additionally, each of the methods exposes a set of variables that can accept data passed into the method. These variables are known as parameters or properties. Together, the properties and methods refer to a Web service's interface.
3. Web services provide an application integration technology that can be successfully used over the Internet. 
4. based Web applications that interact with other web applications for the purpose of exchanging data. Web Services can convert your existing applications into Web-applications.
5. A web service takes the help of WSDL to describe the availability of service. It provides a definition of how the Web service works, so that when you create a reference to it
6. WSDL is an XML-based language for describing web services and how to access them.
7. SOAP is an XML-based protocol for exchanging information between computers.
8. Simple Object Access Protocol (SOAP) and REpresentational State Transfer (REST) are two answers to the same question: how to access Web services. 
9. Web services are client and server applications that communicate over the World Wide Web’s (WWW) HyperText Transfer Protocol (HTTP)


Rest:
1. RESTful web services are based on HTTP protocol and its methods PUT, GET, POST, and DELETE. These web services are better integrated with HTTP than SOAP-based services are, and as such do not require XML SOAP messages or WSDL service definitions




There are many differences between SOAP and REST web services. The important 10 differences between SOAP and REST are given below:
No.SOAPREST
1)SOAP is a protocol.REST is an architectural style.
2)SOAP stands for Simple Object Access Protocol.REST stands for REpresentational State Transfer.
3)SOAP can't use REST because it is a protocol.REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP.
4)SOAP uses services interfaces to expose the business logic.REST uses URI to expose business logic.
5)JAX-WS is the java API for SOAP web services.JAX-RS is the java API for RESTful web services.
6)SOAP defines standards to be strictly followed.REST does not define too much standards like SOAP.
7)SOAP requires more bandwidth and resource than REST.REST requires less bandwidth and resource than SOAP.
8)SOAP defines its own security.RESTful web services inherits security measures from the underlying transport.
9)SOAP permits XML data format only.REST permits different data format such as Plain text, HTML, XML, JSON etc.
10)SOAP is less preferred than REST.REST more preferred than SOAP.

  1. @Path may be used on classes and such classes are referred to as root resource classes. @PATH(“calc”) sets the path to the base URI + /calc. The base URI consists of the host, port and any context. We will set this base URI on creating the server.
  2. @Path may also be used on methods of root resource classes. This enables common functionality for a number of resources to be grouped together and potentially reused. So for example @PATH(“/add”) on the method signature indicates the URI path for this method to be invoked is base URI + /calc/add.
  3. @GET annotation is used to indicate that the annotated method will be invoked in response to a HTTP GET request.
  4. @Produces annotation is used to specify the MIME media types of representations a resource can produce and send back to the client. In our example, our web service will produce representations identified by the MIME media type “text/plain” and “text/xml” which are specified using the static fields TEXT_PLAIN and TEXT_XML of MediaType class.
  5. SOAP is an XML-based protocol to let applications exchange information over HTTPSOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. 
  6. Representational State Transfer (REST) is an architectural style that specifies constraints, such as the uniform interface, that if applied to a web service induce desirable properties, such asperformance, scalability, and modifiability, that enable services to work best on the Web. In the REST architectural style, data and functionality are considered resources and are accessed using Uniform Resource Identifiers (URIs), typically links on the Web. The resources are acted upon by using a set of simple, well-defined operations. REST is an architectural style not a protocol.
  7. Advanteges of REST: Fast: RESTful Web Services are fast because there is no strict specification like SOAP. Language and Platform independent: RESTful web services can be written in any programming language and executed in any platform. Permits different data format: RESTful web service permits different data format such as Plain Text, HTML, XML and JSON.
  8. The Web Services Description Language (WSDL) is an XML-based interface definition language that is used for describing the functionality offered by a web service. A WSDL service description contains an abstract definition for a set of operations and messages. WSDL is a xml document containing information about web services such as method name, method parameter and how to access it.
  9. Advanteges of SOAP: WS Security: SOAP defines its own security known as WS Security.
    Language and Platform independent: SOAP web services can be written in any programming language and executed in any platform. 
  10. Disadvanteges of SOAP: is slow
  11. UDDI is an XML-based standard for describing, publishing, and finding web services.

Немає коментарів:

Дописати коментар