Generating the MyCompanyMemberServices sample user web service

In this lesson, you generate the sample user web service to test the client API and message configuration that you completed 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 Project 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 > WebContent folder.
    2. Right-click the WebContent folder.
    3. Select New > Folder.
    4. Name the folder wsdl.
    5. Click Finish.
    6. Right-click the wsdl folder.
    7. Select Import > General > FileSystem.
    8. Click Next.
    9. Browse to the temporary directory that contains the MyCompanyMemberServices.wsdl file that you previously downloaded and select this file.
    10. Click Finish.
  3. Generate the MyCompanyMemberServices web service skeleton:
    1. In the Enterprise Explorer view , expand the MyCompanyMemberServices > WebContent > wsdl folder.
    2. Right-click the MyCompanyMemberServices.wsdl.
    3. Select WebServices > Generate Java Bean Skeleton.
    4. In the Java Bean Skeleton wizard click Next > Next > Finish.
  4. Add a sample return message to the generated web service:
    1. In the Enterprise Explorer view , expand the MyCompanyMemberServices > Java Resources > src > com.mycompany.xmlns.prod.commerce.member package.
    2. Open MyCompanyMemberServicesImpl.java for editing.
    3. Replace the body of the PushUser method with the following code:
      
      result.value = "Success";
      userIdentifier.value = user.getUserIdentifier();
      
    4. Save and close the file.
  5. Change the virtual host of the web Service to WC_default_host:
    1. In the Enterprise Explorer view , expand the MyCompanyMemberServices > WebContent > WEB-INF folder.
    2. Open the ibm-web-bnd.xml file.
    3. Change the virtualHostName to " WC_default_host ".
    4. Save and close the file.

What to do next

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