Tutorials > Program model > Web services > Create an outbound Web service client for WebSphere Commerce

< Previous | Next >


Generate the MyCompanyMemberServices sample user Web service

In this step we will generate the sample user Web service to test the client API and message configuration performed in the previous steps.


Procedure

  1. Create a new dynamic web project in WebSphere Commerce Developer to contain the sample system.

    1. File > New > Dynamic Web Project.

      1. In the Name field, type: MyCompanyMemberServices.

      2. Ensure the Add project to an EAR option is selected:

        1. EAR project: MyCompanyMemberServicesEAR

      3. Click Finish.

  2. Import the MyCompanyMemberServices.wsdl:

    1. In the Enterprise Explorer view, expand the MyCompanyMemberServices > project > WebContent folder.

    2. Right-click on the WebContent folder.

    3. Select New > Folder.

    4. Name the folder wsdl.

    5. Click Finish.

    6. Right-click on the wsdl folder.

    7. Select Import > FileSystem.

    8. Click Next.

    9. Browse to the temporary directory holding MyCompanyMemberServices.wsdl (previously downloaded) and select MyCompanyMemberServices.wsdl.

    10. Click Finish.

  3. Generate the MyCompanyMemberServices Web Service Skeleton:

    1. In the Enterprise Explorer view, expand the MyCompanyMemberServices > project > WebContent > wsdl folder.

    2. Right-click on the MyCompanyMemberServices.wsdl.

    3. Select WebServices > Generate Java Bean Skeleton.

    4. Navigate to Service Deployment Configuration > Web Service Runtime by clicking Next twice, through the Java Bean Skeleton wizard.

    5. Select IBM WebSphere JAX-RPC.

    6. In the Server-Side Deployment Selection, select Choose Server First.

  4. Add a sample return message to the generated Web service:

    1. In the Enterprise Explorer view, expand the MyCompanyMemberServices > project > Java Resources > src > com.mycompany.www package.

    2. Open MyCompanyMemberServicesImpl.java.

    3. Replace the body of the PushUser method with the following:

      result.value = "Success";
      userIdentifier.value = user.getUserIdentifier();
      

    4. Save the file.

  5. Change the virtual host of the Web Service to WC_default_host:

    1. In the Enterprise Explorer view, expand the MyCompanyMemberServices > project > WebContent > WEB-INF folder.

    2. Open the ibm-web-bnd.xml file.

    3. Change the virtualHostName to " WC_default_host".

    4. Save the file.

After completing these steps, the sample MyCompanyMember member management system has been generated. The next step is to deploy and test WebSphere Commerce with the integrated MyCompanyMember client and the sample member management system.

< Previous | Next >


+

Search Tips   |   Advanced Search