WebSphere Enterprise Service Bus for z/OS, Version 6.2.0 Operating Systems: z/OS


Dynamic invocation with unwired EIS import

How to enable dynamic invocation of an endpoint with an unwired EIS data binding import, with endpoint and attribute override.

Introduction

You can invoke services using EIS import bindings whose endpoints are not those specified in the import. For EIS bindings where the Import is connected to JDBC adapters, you can specify a dynamic endpoint using a URL that represents the JNDI name of a Connection Factory.
Figure 1. Illustration of endpoint override by dynamic invocation, with unwired import
A message flows through a module and through the import binding to a Web service. Information in the message can override the endpoint dynamically

You create a mediation module that includes the dynamic endpoint using WebSphere® Integration Developer.

Programmatic override of endpoint addresses

You can use the SCA public API to override the endpoint address. In the following example code, the uri value must conform to the JCA URI standard.
epr = EndpointReferenceFactory.INSTANCE.createEndpointReference();
epr.setAddress(uri);
epr.setBindingType(bindingType);
epr.setImport("Import1");
Service dynamicService = (Service) ServiceManager.INSTANCE.getService(refname, epr);
Identify the correct endpoint type by adding a binding type attribute to the endpoint reference.

Representing the JCA endpoint

An SCA endpoint reference is created, and stores the JNDI for the connection factory that generates the dynamic endpoint. The SCA endpoint reference is stored in the Endpoint Reference in the SCA message. When an SCA message is received, the EIS Import handler identifies the Endpoint Reference in the message, and uses this to find the JNDI of the connection factory that generates a target address. The EIS binding uses the Connection Factory to obtain the target address of the dynamic endpoint. If a target address is found, the message is sent there. If no target address is found, the message is sent to the original endpoint.

JCA URIs have the form:
Read syntax diagramSkip visual syntax diagram
>>-scheme--:--jca-variant--:--jndiName-------------------------><

scheme
The scheme for JCA URI is always jca.
jca-variant
The jca-variant provides more information about the JCA connection, and is always jndi.
jndiName
Identifies the Connection Factory providing the dynamic target address for a message.

An example of a valid JCA URI would be:

jca:jndi:dynamicTestJNDIUnwired

This URI tells the EIS Import handler to look for a Connection Factory defined in JNDI as dynamicTestJNDIUnwired.

Creating a dynamic invocation with an EIS endpoint

To create a mediation module that includes the dynamic endpoint, perform the following tasks:
  1. Create Mediation Module 1, containing a POJO and an unwired Import.
  2. Create Mediation Module 2, containing Export 2 wiring to POJO 2.
  3. Create Mediation Module 3, containing Export 3 wiring to POJO 3.
  4. Check that the Import is an SCA-JCA import, statically configured with an interaction specification and a connection specification, but without any connection factory settings.
  5. Check that the Import is configured to route messages to Export 2.
  6. Check that Export 2 and Export 3 have the same port type.
  7. Deploy the three modules to the server.

Using dynamic invocation

Dynamic invocation for JDBC adapters takes place when the POJO is invoked with JNDI names for the connection factory, the new interation specification, and the new connection specification. The POJO extracts the endpoint information and the connection attributes from the message. The POJO uses the SCA EPR API and the reference wired to the Import to invoke the remote service. The interaction specification and connection specification information is retained in the EPR properties table for later re-use. Any response is returned by the response flow to the POJO.

Instead of using JDBC, the adapters might be for CICS, IMS, or SAP. The adapters which might be connected to the Import must have the same portType. For example, it is an error to use JDBC for Mediation Module 2 at the same time as using CICS for Mediation Module 3.

A one-way invocation message works the same way as a two-way message, except that no response message is returned.

A runtime exception occurs if any one of three conditions is true:
  • The POJO is invoked with empty arguments.
  • The target import is missing or does not exist.
  • The EPR information is missing or incorrect.
The exception is thrown by the import, and returned in the response flow.

reference Reference topic

Terms of use | Feedback


Timestamp icon Last updated: 21 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.zseries.doc/ref/rwesb_dynamicroutingwithUnwiredEISimport.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).