Saturday, 9 August 2014

Web Service Tutorial Series: SOAP and REST

This tutorial series will teach you the basic concepts of web services using different SOAP engines like Apache AXIS2, Apache CXF ,JAX-WS and Jersey.

 It also provides a solution for sending large attachment with SOAP messages by using MTOM (SOAP Message Transmission Optimization Mechanism) which encodes binary data in base64Binary and sends the data as binary attachment rather than keeping it with actual SOAP message. 


This series also shows that by simply making method calls using the SAAJ API, you can read and write SOAP-based XML messages, and you can optionally send and receive such messages over the Internet.


This series will also show developers to build  applications that use database driven web services with persistence framework like Hibernate and then consuming Restful web service in cloud to be invoked by Android and J2ME Client.

You will also learn to develop restful service that will produce the output in diffrent format(json, xml etc) based on the client request. It will also guide you to develop web-service security with Apache CXF. 


Lets get started..!!



1. Developing a web service and consuming it with J2ME Client

This tutorial demonstrates how to develop web service with Java 2 Platform and deploying it in WebSphere Application Server Community Edition (WASCE) and Tomcat server using two simple examples (Hello World and Logging) and invoking them through a J2ME client. Eclipse IDE is also used to develop a web service and deploy it in the WASCE. There is also a Stock-Quote service example in a remote location (not in local host) developed in .NET platform and this tutorial will show how to invoke it using a J2ME client.

Objectives
In this tutorial, learn how to:
  1. Download and Install the web servers (Tomcat and WASCE), if it is not already installed, and make minor additions to it to successfully implement the given examples.
  2. Download and install Sun J2ME Emulator (Java[TM] ME Platform SDK 3.0) for developing J2me Client to invoke the web services.
  3. Download and install Axis2 runtime environment into Tomcat for developing and deploying Web service (Hello World).
  4. Developing web service (Logging) using Eclipse IDE and deploying it in WebSphere Community edition (WASCE).
  5. Accessing Remote web service (Stock Quote) developed in .Net platform and hosted in the Remote machine through J2me client.


  2. Developing the code and contract first approach web service with Axis2


This Tutorial series will describes the way of developing web service with different Web Service Engine like (Axis2,JAX-WS and CXF). Web services can be implemented using different application protocols like SOAP, XML, JSON, RESTful HTTP, and support various transport protocols like HTTP or JMS (Java Message Service). In order to create a Web service, you will need some tools. At a minimum, you will need some type of SOAP processing engine to parse the messages that are received and to call the functions or methods that the message indicates. Many products are on the market that provides this processing. The goal of every Web services development tool is to build a bridge between the SOAP processor and the business logic that is running on the server. Normally, this business logic is kept separate from the SOAP processing logic. 
You will learn how to develop a Credit Card Validation web service with Code first (Bottom up) approach and followed by Product Catalog web service development with Contract First(Top Down) Approach using Axis2.

Objectives
In this tutorial, you will learn how to:
  1. Download and install the web servers (Tomcat), if it is not already installed, and make minor additions to it to successfully implement the given examples.
  2. Download and install Axis2 engine to generate the Stubs as well as Service skeleton.
  3. Download and install Axis2 runtime environment into Tomcat for developing and deploying web service (Credit Card Validation and Product Catalog).
  4. Developing POJO Client for the web service (Credit Card Validation) using Eclipse IDE.



3. File download web service with JAX-WS

This tutorial will show how to develop a simple Hello User web service with JAX-WS and followed by a File Download web service,where client can download file from web service and store in clients location. Finally a SAAJ client will be developed to access the Product Catalog web service developed in Part 1 using Axis2 with Contract First approach. JAX-WS replaces the older JAX-RPC API. Unlike SAAJ, JAX-WS does not require you to know very much about XML or WSDL. The entire XML layer is hidden from developers, who can instead just work with objects generated by web services tools that come with Java SE 6 and EE 5.

Objectives
In this tutorial, you will learn how to:
  1. Develop Hello User and File Download web service and their clients using JAX-WS library in Eclipse IDE.
  2. Develop SAAJ client to send request and receive response from Product Catalog web service using Eclipse IDE.



4. File uploading web service with Apache CFX

This tutorial demonstrates how to develop web service that can upload a file from client machine to the server. The client application submits a file location and invokes the web service which receives the file byte by byte and stores in a fixed specified location.



Objectives
In this tutorial, you will learn how to:

  1. Build a web service using CXF and deploy it in the tomcat server.
  2. Learn how to send large binary attachments using the MTOM standard.
Continue Reading >>


5.  Develop Database driven Web service in Cloud(GAE) and consuming with Android/J2ME clients

This Tutorial will describes the way of developing web service (JAX-WS and REST). Web services can be implemented using different application protocols like SOAP, XML, JSON, Restful HTTP, and support various transport protocols like HTTP or JMS (Java Message Service). This tutorial will help you in developing a Database Driven Information Retrieval Web service with Hibernate, followed by Hello User Restful web service which is deployed in the Google Cloud (GAE). Finally consuming the developed web services with mobile clients (J2ME and Android).

Objectives
In this tutorial, learn how to:

  1. Develop and deploy a JAX-WS Web Service, which operates on DB2 database using Hibernate as an ORM framework.
  2. Develop a simple Restful webservice and deploy it in Cloud (GAE).
  3. Invoke both the above Web Services using an Android Client and a J2ME client.

Continue Reading >>



Restful service  series with Jersey

In this tutorial series you will learn the following:

6.  File Upload and Download Service using Jersey : In this tutorial you will learn how to create File Upload and Download restful Web service
service using jersey.
Continue Reading >>

7.  Conditional Get and Http Caching using Jersey : In this tutorial you will learn the conditional http feature using Jersey.The HTTP Protocol defines a caching mechanism, in which the proxy web-servers can cache pages, files, images etc. Since caching is in place, There is a method which the servers are asked to return the document, either the “cached” or “live” document. Continue Reading >>

8. Jersey (JAX-RS) with Protocol Buffer for high performance Rest API : In this tutorial you will learn how to develop a Restful service with Jersey/JAX-RS using protocol buffer (commonly known as protobuf)for high performance.One of the great things about the JAX-RS specification is that it is very extensible and adding new providers for different mime-types is very easy. One of the interesting binary protocols out there is Google Protocol Buffers. Continue Reading >>

9. Dynamic Content Mapping with Jersey : In this article you will learn how to do return the response dynamically based on header or client request, something called Dynamic Content Mapping,much like Spring's ContentNegotiatingViewResolver.Continue Reading >>





No comments:

Post a Comment