My Bank Sample

Variation: impl.osgiapp and SDO databinding

Overview

This alternate version of the AccountService illustrates implementation impl.osgiapp and SDO databinding.

Architectural Diagram Affiliates Icon

Build

Build Icon

MyBank Account Service Application

The key artifacts that make up this variation of the MyBank Account Service application are:

  • AccountService.wsdl
  • AccountService.java (generated using wsimport from AccountService.wsdl and customized for SDO databinding)
  • sca metadata
    • default.composite
  • osgi metadata
    • blueprint.xml
    • APPLICATION.MF
    • MANIFEST.MF
  • AccountServiceImpl.java (alternate version using SDO databinding)
  • SDO DataObject class instances provide data binding between XML and Java

Compile and package the MyBank Account Service application.

  1. Open a command window and change to the <SCA_SAMPLE_HOME>\MyBank\accountservice directory.
  2. Issue the following command to build the application:

    <WAS_HOME>\profiles\<PROFILE_NAME>\bin\ws_ant compile.variation

    Example command:

    C:\WebSphere\AppServer\profiles\AppSrv01\bin\ws_ant compile.variation
  3. Verify that the build completes without error.
  4. The output of the build command can be found under the <SCA_SAMPLE_HOME>\MyBank\accountservice\target directory. Verify that the following artifacts have been generated by the build:

    <WAS_HOME>\MyBank\accountservice\target\classes (Location of .class files)
    <WAS_HOME>\MyBank\accountservice\target\generated\java (Location of generated Java source)
  5. Verify that the following Java classes have been generated in the <SCA_SAMPLE_HOME>\MyBank\accountservice\target\generated\java\com\mybank\account directory. Note: other classes have been generated by wsimport but here we are not using them. Compare the following files to see the edits which allow SDO databinding

    • AccountService.java
    • AccountService.java.orig
  6. For more detailed information regarding this SDO customization of the wsimport generated JAXB AccountService interface, see the InfoCenter article: "Using a top-down approach to develop SCA components that use SDO"

  7. Issue the following command to package the application:

    <WAS_HOME>\profiles\<PROFILE_NAME>\bin\ws_ant package.variation

    Example command:

    C:\WebSphere\AppServer\profiles\AppSrv01\bin\ws_ant package.variation
  8. Verify that the mybank-accountservice.jar SCA jar and the mybank-accountservice.eba EBA has been generated in the <SCA_SAMPLE_HOME>\MyBank\accountservice\target\ directory. Also present is the intermediate bundle jar which has been packaged into the eba

MyBank Client Application

No difference here.

Install

Install Icon

Automated install: To quickly and easily install this sample variation, you can use the automated install. Run the following command from the MyBank sample directory:

<WAS_HOME>\profiles\<PROFILE_NAME>\bin\ws_ant install.variation
<WAS_HOME>\profiles\<PROFILE_NAME>\bin\ws_ant start
NOTE: If the default port number for SOAP is not 8880 for your application server profile, please update the SOAP port number value in <SCA_SAMPLE_HOME>\common\manage-app.xml to match your profile.

Running

Run Icon
  1. Open a browser window and enter the following URL: http://localhost:9080/AccountServiceComponent/AccountService/?wsdl.

    NOTE: If the default HTTP transport port is not 9080 for your application server profile, the URL above should include the port number for your installation.
  2. Verify that you see the AccountService.wsdl definition in your browser.
  3. Open a browser window and enter the following URL http://localhost:9080/mybankClient/MyBankWeb.jsp.
  4. Verify that you see the MyBank application.
  5. Enter 100 and press Submit.
  6. Verify that you see example data returned.

Uninstall

Uninstall Icon

Automated uninstall: To quickly and easily uninstall this sample and bypass the manual steps following, you can use the automated uninstall. Run the following command from the My Bank sample directory:

<WAS_HOME>\profiles\<PROFILE_NAME>\bin\ws_ant uninstall.variation

Manual uninstall

  1. From the left navigation panel of the Administrative console, expand Applications then Application Types and select Business-level Applications. You should see one My Bank related BLA on this page, MyBankAccountService. Click on MyBankAccountService. Under Deployed assets check all the non Shared Library assets and click delete. These assets are usually marked as "asset" under the Type column.
  2. After the non shared library assets are removed, select all the shared library assets that are left under Deployed assets and delete them. Once all the assets are removed, click on the Save link at the top of the screen.
  3. Expand Applications then Application Types and select Business-level Applications. Select the MyBankAccountService and click on delete and then click the Save link at the top of the screen.
  4. Next you will need to uninstall the My Bank client war. Expand Applications then Application Types and select WebSphere Enterprise Applications. Select mybank-client_war and click on Uninstall. After the client application has been removed click on the Save link at the top of the screen.