WebSphere JAX-WS address book RSP web service sample setup instructions

Before you begin

Prerequisite: Before running the sample you need to ensure you have a WebSphere® Application Server V8.5 defined. By default a server is created for you when you install WebSphere Application Server. This server can be seen in the Servers view. However if you want to create a new server do the following:
  1. From the File menu, select New > Other > Server > Server > Next.
  2. Select WebSphere Application Server V8.5 as the server type, and click Next.
  3. If you do not have a runtime environment attached to your workspace, you will be prompted for the install directory of WebSphere Application Server.
  4. On the server settings page, click Finish.
  5. To see the server you have created in the workspace, from the Window menu select Show view > Other > Server > Servers > OK.

About this task

To run the sample: Once you have imported the sample, run the sample using the TestClient.jsp:

Procedure

  1. Select jwsAddressBookRSPClient/WebContent/sampleAddressBookPortProxy/TestClient.jsp, right-click and select Run As > Run on Server. Ensure that the WebSphere Application Server V8.5 profile is selected and that the jwsAddressBookRSPEAR is added to the server.
  2. Select the saveAddress method and enter any information in the name field. All other fields are optional. Click Invoke. The Result pane displays true.
  3. Select the findAddress method, enter the name you used during the saveAddress method, and click Invoke. The information saved by the saveAddress method should display in the results pane.

What to do next

There are two ways to view the policy sets associated with the web service and client:
  • Within the jwsAddressBookRSPEAR/META-INF two files are created: clientPolicyAttachements.xml and policyAttachements.xml. By opening these in the default editor you can view the quality of service settings for the client and service respectively.
  • Under the JAX-WS web services node in the Services view, the client and service should be listed. By right-clicking and selecting Manage Policy Set Attachment you can view or modify the policy sets.
To run the sample using a non-default port: If you want to route the web service traffic through the non-default port such as the TCP/IP Monitor, you will need to change the sample default endpoint to match the port number of the monitor.
  1. You can determine the default port WebSphere Application Server is using in the WebSphere administrative console:
    1. Launch the WebSphere Application Server Admin Console by right-clicking your server in the Servers view and selecting Run administrative console.
    2. Expand Servers in the left pane, and select Application servers.
    3. Select your server name from the list. By default this is server1.
    4. On the Configuration tab, search for the Communications heading and expand Ports.
    5. The port used is WC_defaulthost.
  2. Run the TestClient.jsp. Select jwsAddressBookRSPClient/WebContent/sampleAddressBookPortProxy/TestClient.jsp, right-click and select Run As > Run on Server. Ensure that the WebSphere Application Server v8.5 profile is selected and that the jwsAddressBookRSPEAR is added to the server.
  3. In the Quality of Service pane of the JSP, change the port number in the endpoint field, and click Update
Note: Selecting Bypass JAXB and use XML payloads will replace the JAXB bindings view of the TestClient.jsp methods with the raw SOAP message. If you want use this function you need manually enter the required SOAP body entries for input. This is useful when the generated client is unable to deal with all the methods included in the web service, but is unnecessary for the address book sample.

Feedback