Welcome to Java4u

A Single Place for all Java Resources

Looking for something?

Subscribe to this blog!

Receive the latest posts by email.

.Just enter your email below if you want to subscribe!

Email

OAuth 2.0

OAuth 2.0 is an open authorization framework and mainly focuses on authorization flows fand secures access to many well-known web APIs.

Java 8 features

The key features of JDK 8 are Project Lambda (JSR 335), the Nashorn JavaScript Engine, a new Date and Time API (JSR 310), a set of Compact Profiles and the removal of the "permanent generation" from the HotSpot Java Virtual Machine (JVM). A complete list of the new features and capabilities of JDK 8 is available.

Lambda Expression

A lambda expression represents an anonymous function. It comprises of a set of parameters, a lambda operator (->) and a function body.

SOAP vs RESTful

SOAP : Web service use XML messages that follow the Simple Object Access Protocol (SOAP) standard.
RESTful : Web service, often better integrated with HTTP than SOAP-based services are, do not require XML messages or WSDL service–API definitions.

Softwares Engineering / SDLC

Software engineers apply the principles of engineering to the design, development, maintenance, testing, and evaluation of the software and systems that make computers or anything containing software work.

Showing posts with label SOAP. Show all posts
Showing posts with label SOAP. Show all posts

Tuesday, June 17, 2014

WebService Introduction

Web Service : A service that is made available over the web/network & accessible over the network.
And a service that is accessible/ provided over online/network that come under web service
E.g.: In Social Media Web Site we use that service to interact with friends, or in commerce web sites we use the service to purchase products.
So we can call them as web services

Difference b/w standard website & a web service?

Web Site is meant for human consumption.
Web Service is meant for code/application level consumption.

There are primarily two different types of web services
1) SOAP Web service
2) REST Web service

When coming to SOAP its older one and REST is new entry in web service world
Here we have 2 Specifications in Java World
1. JAX-WS is the specification for SOAP web service.
2. JAX-RS is the specification for REST web service.

Friday, June 13, 2014

SOAP vs REST


SOAP : Great at Asynchronous processing and invocation, Formal contracts, Stateful operations
REST : Limited bandwidth and resources, Totally stateless operations, Caching situations





SOAP

  • SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer.
  • SOAP is a XML based messaging protocol and REST is not a protocol but an architectural style.
  • SOAP has a standard specification but there is none for REST.
  • Whole of the web works based on REST style architecture. Consider a shared resource repository and consumers access the resources.
  • Even SOAP based web services can be implemented in RESTful style. REST is a concept that does not tie with any protocols.
  • SOAP is distributed computing style and REST is web style (web is also a distributed computing model).
  • REST messages should be self-contained and should help consumer in controlling the interaction between provider and consumer(example, links in message to decide the next course of action). But SOAP doesn’t has any such requirements.

REST 

  •  REST does not enforces message format as XML or JSON or etc. But SOAP is XML based message protocol.
  • REST follows stateless model. SOAP has specifications for stateful implementation as well.
  • SOAP is strongly typed, has strict specification for every part of implementation. But REST gives the concept and less restrictive about the implementation.
  • herefore REST based implementation is simple compared to SOAP and consumer understanding.
  •  SOAP uses interfaces and named operations to expose business logic. REST uses (generally) URI and methods like (GET, PUT, POST, DELETE) to expose resources.
  • SOAP has a set of standard specifications. WS-Security is the specification for security in the implementation. It is a detailed standard providing rules for security in application implementation. Like this we have separate specifications for messaging, transactions, etc.
  • Unlike SOAP, REST does not has dedicated concepts for each of these. REST predominantly relies on HTTPS.
  •  Above all both SOAP and REST depends on design and implementation of the application.



Areas where SOAP based Web Services is a great solution:


Asynchronous processing and invocation: If application needs a guaranteed level of reliability

and security then SOAP 1.2 offers additional standards to ensure this type of operation. Things like

WSRM – WS-Reliable Messaging etc.



Formal contracts: If both sides (provider and consumer) have to agree on the exchange format

then SOAP 1.2 gives the rigid specifications for this type of interaction.



Stateful operations: If the application needs contextual information and conversational state

management then SOAP 1.2 has the additional specification in the WS* structure to support those things (Security, Transactions, Coordination, etc). Comparatively, the REST approach would make the developers build this custom plumbing.

Areas where Restful Web Services are a great choice:

Limited bandwidth and resources: Remember the return structure is really in any format
(developer defined). Plus, any browser can be used because the REST approach uses the standard GET, PUT, POST, and DELETE verbs. 
Again, remember that REST can also use the XMLHttpRequest object that most modern browsers support today, which adds an extra bonus of AJAX.

Totally stateless operations: If an operation needs to be continued, then REST is not the best
approach and SOAP may fit it better. However, if you need stateless 
CRUD (Create, Read, Update,and Delete) operations, then REST is suitable.

Caching situations: If the information can be cached because of the totally stateless operation of the REST approach, this is perfect.




SOAP vs REST



Click on the link to Download or Watch

SOAP vs REST

WSDL Explaination



Click on the link to Download or Watch


WSDL Explaination