Implementing the MyCompanyMember client API

In the lesson, you create the MyCompanyMember client API in the WebSphereCommerceServerExtensionsLogic project. This API uses the SDOs generated in the previous step to send request messages and handle response messages.

About this task

The API consists of the following artifact:

  • MyCompanyMemberFacadeClient
    • Uses MyCompanyPushUserInvocationServiceObjectImpl to convert the request SDO (PushUser) to the request xml.
    • Instructs the WebSphere Commerce messaging system to transmit the message.
    • Use MyCompanyPushUserConfirmationInvocationServiceObjectImpl to convert the response xml to the response SDO (PushUserConfirmation).

To implement the API:

Procedure

  1. Update the build path for the WebSphereCommerceServerExtensionsLogic project to reference the MyCompanyMemberDataObjects project.
    1. In the Enterprise Explorer view, right-click the WebSphereCommerceServerExtensionsLogic project.
    2. Select Properties.
    3. In the left pane, select Java Build Path.
    4. In the center pane, select the Projects tab.
    5. Click Add.
    6. Select the MyCompanyMemberDataObjects project.
    7. Click OK > OK.
  2. Create the MyCompanyMemberClientFacade class to transmit the request message.
    1. In the Enterprise Explorer view, expand the WebSphereCommerceServerExtensionsLogic project.
    2. Right-click the src folder.
    3. Select New > Package.
    4. In the field Name, type: com.mycompany.commerce.member.client.
    5. Click Finish.
    6. Right-click the com.mycompany.commerce.member.client package.
    7. Select New > Class.
      1. In the field Name, type: MyCompanyMemberClientFacadeImpl.
      2. Click Finish.
    8. Replace the contents of this class with the contents of the following downloadable sample code: MyCompanyMemberClientFacadeImpl.java
    9. Save and close the file.