Calling Java interfaces from WSDL references

Occasions might arise when you want to access a service with Java™ interfaces from a component that can only support WSDL references. However, you cannot directly draw a wire from a WSDL-typed reference to a Java component or a stateless session bean EJB import that has a Java interface. As well, most component implementations do not allow Java-typed references. The assembly editor provides an easy way of overcoming this difficulty.

Most components in the assembly diagram use WSDL interfaces and references. If such a component needs to call a Java component or a stateless session bean EJB import that has a Java interface, you will not be able to wire the source component's WSDL reference directly to the session bean import that has the Java interface. However, WebSphere® Integration Developer allows you to drag a Java class or a stateless session bean onto the assembly editor canvas as a component or import, respectively. The editor then provides the option to generate a facade map component with a Java reference and a WSDL interface to make it easy for you to complete the wiring. Here are the step-by-step instructions:
  1. Locate the existing Java implementation or stateless session bean that you want to use. You can find the Java implementation in the Java Package Explorer view or the .java file in the Physical Resources view. To find the stateless session bean EJB, open the J2EE perspective and locate the bean in its Project Explorer view.
  2. Drag your Java object into your assembly diagram. A Java class becomes a component when it is dropped on the canvas. A stateless session bean becomes an import.
  3. You are prompted to create a facade map component. Click Yes. A facade map component with a WSDL interface and an equivalent Java reference is created. This facade map component automatically converts the incoming event for the WSDL interface to the equivalent Java outgoing event sent to the service wired to its reference. The following detail from the assembly diagram shows a facade map component, Bridge, that is wired to a stateless session bean import, SLSBImport:
    Bridge component is wired to SLSBImport
  4. Draw a wire from the business process component to the WSDL interface of the bridge component in the assembly. The editor creates a matching WSDL reference on the BusinessProcess component to complete the bridge. The facade map component does not contain any business logic; it just enables a connection between the Java interface and the WSDL reference. The following assembly diagram shows that the BusinessProcess component is wired through the Bridge component to the SLSBImport Java import:BusinessProcess is wired to the Bridge Java component
Your process component can now successfully call the Java component or EJB import.
Related concepts
Business services: Using Java
Business services: Top-down development
Business services: Bottom-up development
Business services: Meet-in-the-middle development
Related tasks
Calling WSDL interfaces from Java references
Related reference
Best practices: Modules and packaging for business services

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.