This sample is part of a re-engineered version of the sample originally
developed for WebSphere® Studio
Application Developer and highlights leading-edge J2EE technologies and tools
in the IBM® Software
Development Platform, including Web services.
Before you run the Auction Web service, you must import and run
the Auction Web application. For instructions on doing this, please see the
setup instructions for the Auction Web application.
After you import the
Auction Web service sample, you must associate the sample with the WebSphere Application
Server Version 6.1. To associate the sample with the application server, use
these steps:
After you start the Web Service, follow these steps to test it:
- In the Project Explorer view, expand AuctionV60WebServiceClient/WebContent/sampleAuctionListings_PortTypeProxy,
right-click TestClient.jsp, and click Run
As > Run on Server to run the JSP on the server. If the server
is not identified as the default server in the properties of the AuctionV60WebServiceClient
project, then the Server Selection window opens.
- Select WebSphere Application
Server v6.1 and click Finish.
By default, the generated client proxy is set to talk to the Auction
Web service running on a WebSphere Application Server at port 9080. If the
WebSphere Application Server is on a port other than 9080, you would get a
"Connection refused" error when trying to run the sample JSP. If that happens,
after the sample JSP is running on the server, select the
getEndpoint() method
in the method pane of the sample JSP, click
Invoke to
get the endpoint, for example:
http://localhost:9080/AuctionV60WebService/services/AuctionListingsSOAP
Then
select the
setEndpoint() method and paste in the new
port (e.g. changing from 9080 to 9081):
http://localhost:9081/AuctionV60WebService/services/AuctionListingsSOAP
Then
click Invoke. After this, you can invoke the other
methods in the sample JSP with the correct endpoint. However, you need to
do this every time you relaunch the sample JSP.
To change the port permanently,
open the AuctionListing.wsdl file in the WebContent/WEB-INF/wsdl directory
of the AuctionV60WebService and AuctionV60WebServiceClient projects, select
the
Source tab, and search for the entry (near the
end of the file):
<soap:address location="http://localhost:9080/AuctionV60WebService/services/AuctionListingsSOAP"/>
Then change the port from 9080 to the correct port number and save the files.
To
see the Web service description, use these steps:
- In the Project Explorer view of the J2EE perspective, expand JSR-109
Web Services, expand Services, expand AuctionListings,
and then double-click WSDL: /AuctionV60WebService/WebContent/WEB-INF/wsdl/AuctionListings.wsdl to
open the Web Services Description Language (WSDL) file in the WSDL editor.
By default, the file opens in the Graph view.
- Click the Source tab to see the actual WSDL XML
document.
To see the JavaBean Web service implementation, in the Project
Explorer view of the J2EE perspective, expand JSR-109 Web Services,
expand Services, expand AuctionListings,
expand Service Classes, and then double-click ServiceImpl:
org_tempuri_AuctionListingsSOAPImpl to open the Web service implementation
file in the Java™ editor.