The following diagram illustrates an SCA mediation module that has been modified to include use of the Web Services Feature Pack (WSFEP). To provide a Web service endpoint using the WSFEP, a router module has been added containing a bridging bean that provides an alternative to an SCA export for receiving Web service requests. To invoke a Web service using the WSFEP, a custom Java bridging component has been added as an alternative to an SCA import. These two modifications may be done individually in a module or together as shown for this mediation module:
Figure 1. Bridge scenario in SCA module

- In the WSFEP module, the Bridging bean is a JAX-WS-enabled Java bean that provides a Web service endpoint, and calls an SCA component via standalone reference.
- In the SCA mediation module, the Bridging component is an SCA POJO component that uses a JAX-WS API to invoke a Web service.
- These two artifacts are represented in the application as two independent WSFEP endpoints, each with its own policy set configuration.
2. Setting up the development and runtime environments
The example in this article needs to run in a clean environment, so please do not create any profiles in the first two steps:
- Install WebSphere ESB V6.1.2, which includes both WebSphere Application Server V6.1.0.17 and WebSphere ESB V6.1.2.
- Install WSFEP.
- Update with the package
6.1.0.9-WS-WASWebSvc-IFPK53084.pak. - Update with the package
6.1.0-WS-WASWebSvc-WinX32-FP0000017.pak.
For newer versions of the products, there may be some differences, so you should create a WSFEP standalone server with a name such as AppSrv01, and augment it with
the WebSphere ESB profile. Your versions of WebSphere Application Server and WSFEP can be different from those in this article, but they must match each other.
2.2. Installing development tools
- Install Rational Application Developer V7.0.0.0.
- Update package with Installation Manager till you get Rational Application Developer V7.0.0.6 and WebSphere Integration Developer V6.1.0.100
This section describes the combined scenario in a mediation module. If you want, you can implement the individual endpoint enablement and invocation separately. Three artifacts combine to create the bridge scenario application:
- WS FEP-Service
- Provides a JAX-WS Web service that will eventually be invoked by the bridging component in the SCA Mediation Module.
- Bridge-application
- A WSFEP-enhanced SCA mediation module that can invoke and be invoked by applications that require the additional qualities of service supported by the WSFEP, such as SOAP 1.2 and WS-RM.
- Client
- A JAX-WS client application to invoke a Web service provided by the Bridge-application.
After building the artifacts, export them to EAR files and deploy them to the server for testing. You can add policy sets to the EAR files to apply the new Web services policies introduced by WSFEP.
This section describes how to create a Web service provider application that uses the WSFEP. This application will be called from the Bridge-application described in the next section.
- Open Rational Application Developer and create a new workspace.
- Select Windows => Preferences => Installed Runtime => New Server Runtime.
- The type of runtime should be WebSphere Application Server V6.1, and should point to your installation directory.
- Create a new Dynamic Web Module and set the Target runtime to your newly created Server Runtime. Click Next.
- In the next screen, check WebSphere V6.1 Feature Pack for Web Services and click Finish.
- We have provided a Java POJO class named
GreeterImpl.java, which implements the basic function of the Web service to be used as the inbound service endpoint to bridge to the SCA component.
Service implementationpackage services.impl; public class GreeterImpl{ public String sayHi() { return "Hi"; } public String greetMe(String requestType) { return "hello " + requestType; } public void greetMeOneWay(String requestType) { } } - Create a package named
services.impland copy the Java file in. - Create a Web service in the workspace and set Service Implementation to
services.impl.GreeterImpl. Change Web service runtime to IBM WebSphere JAX-WS. Adjust the level to Assemble service and click Next. - In the following screen, check Generate WSDL file into project and click Finish:
Figure 2. Files and folders generated for Web service server by Rational Application Developer

Now you have a WS FEP enhanced Web service.
3.3. Developing the Bridge-application
This section describes how to develop an SCA mediation module that invokes Web services and exposes a Web service endpoint using the WSFEP, which is effectively the same as having a WSFEP-enabled import and export binding in the module. The steps apply to any SCA module, and can be applied separately to invoke a Web service or expose a Web service in an SCA module.
- In the same workspace, click File => New => Mediation Module to create an SCA Mediation Module named
SCAModule. Set its Target Runtime to WebSphere Process Server V6.1. - Under the Data Types node, create a new BO named
StrObjwith a string-typed attribute value named val. This BO is used to carry information in the mediation module. - Create an interface named
SCAIntfand add an operation namedgreetMe, whose input and output are type StrObj. - Add an Interface and a Reference to the mediation component.
- Add a standalone reference and a Java component and link them to the SCA module. Accept the default settings.
- Double click SCAModule and link up in the request flow and response flow.
- In the next a few steps you will modify the Java component to enable the SCA module to access the WSFEP Web service. But before modifying the Java component, you need to create some additional artifacts that it uses to access the Web service. Rational Application Developer can generate the artifacts automatically.
- Create a Java project named
WSFEPClient, which is a temporary project used to generate some artifacts with WSFEP features that are not easily generated in a non-WSFEP-enhanced project. In the project, create a Web Service Client. Set the Service definition toGreeterImplService.wsdlfrom WSFEPService module. - Set Web service runtime to IBM WebSphere JAX-WS and click Finish. New files are generated in the package
services.impl, which you will use in the Java component in SCAModule.
Figure 3. Files and folders generated for Web service client by Rational Application Developer

- Copy the package into SCAModule. To solve the compile errors, add as an external JAR
<WAS_ROOT>/runtimes/com.ibm.jaxws.thinclient_6.1.0.jar. - Modify the Java component. Add the following snippet under the function
greetMe. Press Ctrl + Shift + O to import the classes needed:
Sample code in the Java componentpublic DataObject greetMe(DataObject input1) { //TODO Needs to be implemented. System.out.println("into java component"); String name = input1.getString("val"); try{ GreeterImplDelegate port = (new GreeterImplService()).getGreeterImplPort(); input1.setString("val", port.greetMe(name)); }catch(Exception ex){ ex.printStackTrace(); System.out.println(ex.getMessage()); input1.setString("val", "Error in java component"); } return input1; } - Now you have an SCA module that can invoke a Web service using WSFEP. In the following steps, you will enhance the SCA module so that it can provide a WSFEP-enabled Web service.
- Create a new Dynamic Web Module and name it to
Your SCA module name + Web(in this sample,SCAModuleWeb). You must follow this name conversion to add the Web module to your SCA module application. Add the project to your SCAModuleApp. - Change the Targeted runtime of the SCAModuleWeb to WebSphere Application Server V6.1(2) (which contains the WS-FEP features), and add Library => Server runtime => WPS.
- Create a package named
scaServiceWeb.impl, a Java class namedSCAServiceWebImpl, and add a method as shown below. Keep the method namegreetMe, corresponding with the one in SCA module interface, although this is not essential. The code is used to invoke the SCAModule standalone reference.
Sample service implementation in SCA moduleimport com.ibm.websphere.bo.BOFactory; import com.ibm.websphere.sca.Service; import com.ibm.websphere.sca.ServiceManager; import commonj.sdo.DataObject; public String greetMe(String requestType) { String ref = "SCAIntfPartner"; String wsdlOperation = "greetMe"; String rtnStr = "error"; try { ServiceManager sm = new ServiceManager(); Service service = (Service) sm.locateService(ref); BOFactory bof = (BOFactory) sm.locateService("com/ibm/websphere/bo/BOFactory"); DataObject inWrapper= bof.createByElement("http://SCAModule/SCAIntf",wsdlOperation); DataObject input = inWrapper.createDataObject("input1"); input.setString("val", requestType); System.out.println("invoking"); DataObject output = (DataObject) service.invoke(wsdlOperation,input); System.out.println("invoked"); if (output!=null) { System.out.println("Result" + output.getString("val")); rtnStr = output.getString("val"); }else{ System.out.println("Null"); } } catch (Exception e) { System.out.println(e); } return rtnStr; } - Use this Java file to create a Dynamic Web Module. Set the Service implementation to
scaServiceWeb.impl.SCAServiceWebImpland set Web service runtime toWebSphere JAX-WS. - Check Generate WSDL file into the project on the next page and click Finish. You will see the familiar folders and files like those in Figure 2.
- Now you have a WSFEP-enhanced SCA module that provides a WSFEP-enabled Web service. You can attach a policy set here, as described below.
3.4. Developing a client application
This section describes how to develop a client application that you can use to call the module you have just completed.
- The procedure of developing a client application is similar to Step 9 under Developing Bridge-application, except that you set the service definition to
SCAServiceWebImplService.wsdlfromSCAModuleWeb. - Create a standalone Java project to invoke the WSFEP Web service provided by SCAModule with the snippet below. Press Ctrl + Shift + O to import the classes needed and add the following code:
Sample code in client project to invoke Web servicepublic static void main(String[] args) { // TODO Auto-generated method stub try{ SCAServiceWebImplDelegate port = (new SCAServiceWebImplService()) .getSCAServiceWebImplPort(); System.out.println(port.greetMe("sunyj")); }catch(Exception ex){ ex.printStackTrace(); } }
Now that you have finished developing the bridged application, you can deploy the projects:
- Export
SCAModuleApptoSCAModuleApp.ear. - Export
WSFEPServiceEARtoWSFEPServiceEAR.ear. - Deploy the two EAR files to the application server and start them using the Admin Console.
- Run
Client.java. You should get a return value ofhello sunyj.
The main reason for using the WSFEP runtime is so you can configure the additional qualities of service it provides, which is done using policy sets.
This section shows you how to add a policy set to the Web service endpoints you added to the SCA module earlier. Use WSAddressing default as an example:
- Right-click on SCAModuleWeb and select New => Others => Server Side Policy Set Attachment.
- Select WSAddressing default. Service Ear Project should be
SCAModuleApp. You have now finished adding a policy set to the server side:
Figure 4. Adding policy set attachment to server side application

- Right-click on Client and select New => Others => Client Side Policy Set Attachment.
- Select WSAddressing default, enter
Default Binding, and click Finish. - If you are using a standalone Java project as the client, use the policy set in the download file at the bottom of this article, instead of the one generated by Rational Application Developer.
You have now finished adding a policy set to both sides of WS endpoint, as shown above in Figure 1. Next you associate the policy set with the Bridging Component.
Use WSReliableMessageing as an example:
- Select WSFEPService and create a Service Side Policy Set Attachment. Use
WSReliableMessageing defaultas an example. Set Service Ear Project to WSFEPServiceEAR and click Finish. Because the SCAModule is built on a WebSphere Process Server runtime, you cannot use the method to create JAX-WS client code with the Rational Application Developer wizard, so you cannot directly add the Client Side Policy Set Attachment. Instead: - Select WSFEPClient and create a Client Side Policy Set Attachment. In the Policy Set drop-down list, select WSReliableMessaging default
and enter
Default Bindingin Binding. Click OK => Finish. - Several files are generated in META-INF. Export
SCAModuletoSCAModuleApp.earand copy these files intoSCAModuleApp.ear\META-INF\.
You have now finished adding a policy set to both sides of the Bridging Component. Next you need to redeploy the EAR files. In the Admin Console, select Enterprise Applications => SCAModuleApp => Service provider policy sets and bindings. The policy set has been attached to the application. Figure 5 shows the service provider policy sets and bindings for the Bridging Component:
Figure 5. Policy set information sample seen in Admin Console

- Run
Client.javaas an application. You should get the return valuehello sunyj. - If you examine the request/response message in WS endpoint (Figure 1), you will see that the snippets below are added to the messages:
Figure 6. Snippet in request/response message of WSAddressing

- If you examine the request/response message in the Bridging component (Figure 1), you will see that the snippets below are added to the messages:
Figure 7. Snippet in request/response message of WSReliableMessaging

| Description | Name | Size | Download method |
|---|---|---|---|
| Standalone java client policy set of WSAddressing | java_client_policy_set.zip | 3 KB | HTTP |
Information about download methods
- WebSphere ESB developer resources page
Technical resources to help you use WebSphere ESB as a flexible connectivity infrastructure for integrating applications and services to support an SOA. - WebSphere ESB product page
Product descriptions, product news, training information, support information, and more. - WebSphere ESB information center
A single Web portal to all WebSphere ESB documentation, with conceptual, task, and reference information on installing, configuring, and using WebSphere ESB. - WebSphere ESB documentation library
WebSphere ESB product manuals. - WebSphere ESB FAQs
Basic questions and answers about the new WebSphere ESB product and its relationship to other WebSphere products. - WebSphere ESB support
A searchable database of support problems and their solutions, plus downloads, fixes, problem tracking, and more. - Redbook: Patterns: SOA Design Using WebSphere Message Broker and WebSphere ESB
Patterns for e-business are a group of proven, reusable assets that can be used to increase the speed of developing and deploying e-business applications. This Redbook shows you how to use WebSphere ESB together with WebSphere Message Broker to implement an ESB within an SOA. Includes scenario to demonstrate design, development, and deployment. - developerWorks WebSphere Business Integration zone
For developers, access to WebSphere Business Integration how-to articles, downloads, tutorials, education, product info, and more. - WebSphere Business Integration products page
For both business and technical users, a handy overview of all WebSphere Business Integration products - WebSphere forums
Product-specific forums where you can get answers to your technical questions and share your expertise with other WebSphere users. - Most popular WebSphere trial downloads
No-charge trial downloads for key WebSphere products. - Trial downloads for IBM software products
No-charge trial downloads for selected IBM® DB2®, Lotus®, Rational®, Tivoli®, and WebSphere® products. - developerWorks technical events and Webcasts
Free technical sessions by IBM experts that can accelerate your learning curve and help you succeed in your most difficult software projects. Sessions range from one-hour Webcasts to half-day and full-day live sessions in cities worldwide.
Ying Ji Sun is a Software Engineer at the IBM China Development Lab. He currently works on the WebSphere Enterprise Service Bus function validation test team. You can contact Ying Ji at sunyj@cn.ibm.com.
Simon Holdsworth is a Software Architect for WebSphere business integration products at the IBM Hursley Software Lab in the UK. He works on the WebSphere Enterprise Service Bus and WebSphere Process Server teams, and is the editor of the SCA, JMS, and Web services bindings specifications on osoa.org. His previous IBM roles include development positions on Web Services Gateway, MQSeries Integrator, Component Broker, DSOM, and CICS. He has an MSc in Mathematical Logic and the Theory of Computation from Bristol University, UK. You can contact Simon at simon_holdsworth@uk.ibm.com.
Jim Ramaker is the Managing Editor of the developerWorks WebSphere Web site team at IBM Silicon Valley Lab in San Jose, CA. He is an editor for the following WebSphere products: WebSphere Enterprise Service Bus, WebSphere Message Broker, WebSphere MQ, and WebSphere DataPower SOA Appliances. You can contact Jim at ramaker@us.ibm.com.





