Deploying a web service to a server using the command line tools

After you create an EAR file by using a web services command-line tool, you can deploy the EAR file to a server to create the code that makes your service available to others.

About this task

You can deploy the EAR file to WebSphere® Application Server by using either the development environment or the administrative console. To deploy the EAR file and test the web service in the development environment, you must import the EAR file then create, configure, and start the web server.

Importing an EAR file

Procedure

  1. Open a workspace.
  2. Go to File > Import > EAR file, and click Next.
  3. Click Browse to select the command-line test directory from which you ran the web services command -line tool. Click Open.
  4. Expand your project directory, which was specified by -project when you ran the web services command-line tool, and select the EAR file that you created. Click Open.
  5. In the Import EAR wizard, target the EAR to the appropriate server. Accept the default settings in the next two windows.
    Tip: Note the name of the web project that was created with the EAR file. If you are importing an EAR file that contains an EJB bean, also note the name of the EJB project. You need this information later to test your web service.
  6. Click Finish.

Results

You imported an EAR file and its corresponding project.

You can now create and configure the server to deploy the web service.

Creating and configuring the web server

About this task

If you already created a server, go to step 4. Alternately you can create a server manually.

Procedure

  1. Select File > New > Other. Select Server and Server from the lists. Click Next.
  2. Specify the host name of the server you want to publish on, or accept the default localhost setting. Select the type of server you want to create and click Next.
  3. Select the port that you want to use, and accept the other default settings. Click Finish.
  4. Switch to the Servers view by going to Window > Show view > Other > Services.
  5. In the Server Configuration pane, right-click your server. Select Add and Remove projects. Select your web service EAR and add it to the server. Click Finish.

Results

After you deploy your web service to the server, you can test it.

Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tdear1.html