Scenarios Of HTTP Binding
1) SCA Applications communicating with other Web Applications via HTTP Import.
2) SCA Applications can Expose themselves as HTTP applications and can be used by other HTTP Consumers.
3) Process Server and ESB can communicate over HTTP Infrastructure.
In a SCA based applications all the processing happens in form of Interface and Business Objects.
Data is passed to different component in form of BO via a Interface call.
Whereas in HTTP Protocol the communication in the form of different method calls like SERVICE,GET,POST,DELETE,PUT etc.
Because of the different nature of both protocols, the data from one has to be converted in to other and vice versa.
For ex.
Consider an SCA Application that takes input in a BO and returns the processed output in form of BO.
To call this application over HTTP, the post data of form (or get data) must be converted to DataObject for SCA application to process it. Similarly the output of SCA app (i.e DataObject) must be converted back to native format (HTTP Stream) for the caller (eg. web app) to make use of it.
To achieve this functionality DataHandler & Data Binding comes in to picture. The job of DataHandler & Data Binding is to convert the data from one format to other format. DataHandler & DataBinding achieves the same functionality but there is slight difference between these two.
Datahandlers provide a binding neutral interface and can be associated with any transport bindings while the DataBindings are specific to particular transport bindings. i.e. A DataHandler can be attached to any Export or Import component Having any type of transport Binding (e.g SCA WebService, HTTP) while DataBindings is developed for a specific transport binding (E.g. DataBinding developed for HTTP can be used for Export Import Component having HTTP binding.)
There are various DataHandler and DataBindings are provided by IBM for handling the most of scenarios. If the requirements of an application does not comes under the pre-packaged bindings, we can develop it on our own and can make use of it.
List of Pre Packaged HTTP Binding
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/index.jsp?topic=/com.ibm.wbit.620.help.http.doc/topics/chttpconfig.html
Let's take an example of a sca Application exposed as HTTP Binding & Consumed by a web application using post method.
1) In this example we will create a simple web application (used as service consumer) to call the sca application via submitting a form in a jsp.
2) The sca application will be exposed with HTTP Binding and act as Service provider. When it receives a call from web app with html form data (sent via post method), it will convert the post data in to Business Object because SCA app processing happens in form of Business Objects passed to different component.
3) After processing the response the output stored in response Business Object will be converted back again to native format (i.e. HTTP format for web app to process the received output.)
In the Example discussed We will create a web application that will post the data containing location of PDF file.
The SCA application will get the location and read the PDF & convert it in to byte array and send it back to the caller.