IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with HTTP
Uses of the HTTP binding
The common uses for the HTTP binding with an import, export and function selector are discussed.
The following sections describe the uses of the HTTP binding.
- Scenarios for using the HTTP binding
- HTTP import overview
- HTTP import using a mediation module
- HTTP import using a data binding
- HTTP export overview
- HTTP export using a mediation module
- HTTP export using a data binding
- HTTP export using the pingable function
- HTTP function selectors
Scenarios for using the HTTP binding
Several common scenarios are used with the HTTP binding.
- Service Component Architecture-hosted services can invoke HTTP applications using an HTTP import.
- SCA-hosted services may expose themselves as HTTP-enabled applications, allowing them to be used by HTTP clients, using an HTTP export.
- IBM Process Server and WebSphere Enterprise Service Bus can communicate between themselves across an HTTP infrastructure, allowing users to manage their communications according to corporate standards.
- IBM Process Server and WebSphere Enterprise Service Bus can act as mediators of HTTP communications, transforming and routing messages, which improves the integration of applications using a HTTP network.
- IBM Process Server and WebSphere Enterprise Service Bus can be used to bridge between HTTP and other protocols, such as SOAP/HTTP web services, Java™ Connector Architecture (JCA)-based resource adapters, JMS and so on.
HTTP import overview
An HTTP import binding lets SCA applications communicate with a wide variety of web applications that provide data in different formats such as XML, SOAP, and binary formats. The number of these services is growing every day as people realize the value of Service Oriented Architecture (SOA) concepts.
This import also makes SCA application to SCA application communication easy and lightweight since the only item that one application needs to know about another is the URL address and the message format. If the HTTP import calls another SCA application using an HTTP export and function selector, the application must also be able to determine the function selector used on the HTTP export. The function selector detects what operation on the interface to invoke once the request is received.
For example, if the target HTTP export used a header-based function selector then the HTTP import would need to be configured to provide an operation name in the special HTTP header called TargetFunctionName.
In summary, an HTTP import is a lightweight solution to invoke a remote HTTP service that may provide information in an XML, SOAP or binary format.
HTTP import using a mediation module
A mediation module is used to convert between the interface you want to use and an opaque stream form. With an opaque stream, your application reads a file with no schema specified for it. You must define an interface naming the opaque messages for both a request and a response message and define an HTTP import with this interface. You can use a pre-supplied data binding to treat the request and response HTTP messages as stream messages.
Like an HTTP export scenario, the mediation should perform mapping between the two interfaces. Both a request and a response flow would be necessary for a two-way operation
HTTP import using a data binding
It is also possible to invoke an HTTP application directly from an SCA module. In this case, the HTTP import must be configured with appropriate connection information and a custom or supplied data binding, which converts between the interface used by the SCA module and the native format which will be used for HTTP messages.
HTTP export overview
An HTTP export binding lets SCA applications on IBM BPM or WebSphere Enterprise Service Bus be exposed as an HTTP URL address that can be invoked from the web browser or any other HTTP-enabled web application. Similar to an HTTP import, the HTTP export is a lightweight solution that allows a remote HTTP service to invoke an SCA application and exchange information in an XML, SOAP or binary format
HTTP export using a mediation module
One way to use mediation with respect to an HTTP export would be to build and deploy a separate mediation module, mediating between an HTTP export and an SCA import referencing the IBM BPM service to invoke.
The SCA import would normally be generated by dragging an SCA export from the module that the import would invoke to the module that would contain the import. The HTTP export would be configured to use the pre-supplied data bindings in accordance with expected request messages. The function selector would be configured to use the URL context path in combination with an HTTP method used by the request. You would define an interface listing the appropriate pre-supplied type as parameters to both the request and response messages for each exposed operation.
A mediation module would convert request and response messages between this interface and that exported by the SCA module.
HTTP export using a data binding
If the message format is particularly difficult or a mediation module cannot be used then there is an option to write a data binding in Java and use this with an HTTP export. It may be necessary to write two data bindings; one for the request message and one for the response message if these messages will be in different formats.
Your application could make use of the pre-supplied function selector and use the URL context path and HTTP method specified by a request to determine a target operation to invoke.
HTTP export using the pingable function
Some HTTP clients require a validation of the available HTTP export URL before sending requests. This validation is helpful for requests with large payloads. To allow such validation, a user can configure 0 or more HTTP methods as pingable on the HTTP export.
HTTP function selectors
When the HTTP export receives a request message, it uses the function selector to determine the method name that it needs to invoke on the interface based on the HTTP request information.
For a function selector, you can use one of the IBM-supplied function selectors or use a custom function selector. In the second case, you would supply a Java implementation of the FunctionSelector interface.
The supplied HTTP function selectors are as follows:
- One function selector determines the function to call based on the context path of the URL address and the HTTP method used in the request.
- The second function selector determines the function on the interface to call based on the value of a special HTTP header (TargetFunctionName) value from the request.
Hypertext Transfer Protocol (HTTP) binding
Related concepts:
HTTP binding overview
HTTP data bindings
Related tasks:
Generate an HTTP import binding
Generate an HTTP export binding
Related reference:
Example of the HTTP binding
Limitations of the HTTP binding