IBM BPM, V8.0.1, All platforms > Migrating and upgrading your IBM BPM environment > Migrating from other products > Migrating from WebSphere Studio Application Developer Integration Edition > Additional migration information > Migrating to the SCA programming model > Migrating WebSphere Business Integration Server Foundation client code

Migrating the EJB client

This topic shows how to migrate clients that use an EJB interface to invoke a service.

  1. Drag the Export with SCA Binding from the migrated module onto this new module’s Assembly Editor. This will create an Import with SCA Binding. In order for a client to obtain a reference to this import, a stand-alone reference must be created.

  2. On the palette, select the Standalone References item. Click the Assembly Editor canvas once to create a new standalone reference for this new module.

  3. Select the wire tool and click the service reference and then click Import.

  4. Click OK when alerted that a matching reference will be created on the source node.

  5. You will be asked: It is easier for a Java client to use a Java interface with this reference – would you like to convert the WSDL reference to a compatible Java reference?:

    1. Answer Yes if you would like the client to look up this service and cast it as a Java™ class to invoke it using a Java interface. This new Java interface takes the name of the WSDL PortType, where the package of the interface is derived from the namespace of the WSDL PortType. There is a method defined for each operation defined on the WSDL PortType, and each WSDL message part is represented as an argument to the interface methods.

    2. Answer No if you would like the client to look up this service and use the generic com.ibm.websphere.sca.Service interface to invoke it using the invoke operation as a generic SCA service.
  6. Rename the standalone reference to a more meaningful name, if appropriate, by selecting the Standalone References component in the Assembly Editor. Go to the Properties view and then to the Details tab, drilling down to and selecting the reference that was just created, and modify the name. Remember the name you chose for this reference because the client will need to use this name when invoking the locateService method of the com.ibm.websphere.sca.ServiceManager instance.

  7. Click Save to save the Assembly diagram.
The client must have this new module on its local classpath in order to access the migrated EJB module running on the server.

The following shows what the client code looks like for a service of type "CustomerInfo":

// Create a new ServiceManager
ServiceManager serviceManager = ServiceManager.INSTANCE;

// Locate the CustomerInfo service CustomerInfo customerInfoService = (CustomerInfo) serviceManager.locateService 
("<name-of-standalone-reference-from-previous-step");

	// Invoke the CustomerInfo service 	System.out.println("	[getMyValue] getting customer info...");
	DataObject customer = customerInfoService.getCustomerInfo(customerID);

The client must change how the message is constructed. Previously, the messages were based on the WSIFMessage class, but now they should be based on the commonj.sdo.DataObject class.

: Migrating WebSphere Business Integration Server Foundation client code