Oijojojojijo

Only available on StudyMode
  • Download(s) : 68
  • Published : January 30, 2013
Open Document
Text Preview
Create stand-alone Web services applications with Eclipse and Java SE 6: Part 2: The Web service client application Skill Level: Intermediate John Robertson Staff Software Engineer IBM Fiona Lam Software Engineer IBM Yaqian Fang Software Engineer IBM Angela Baird Angela Baird IBM Elena Nossova Analyst/Programmer Independent

18 Sep 2009 Use the Eclipse Integrated Development Environment (IDE) and Java Platform, Standard Edition (Java SE) 6 to create a scnt applications and then run the applications from the command line.

Part 2: The Web service client application © Copyright IBM Corporation 2009. All rights reserved.

Trademarks Page 1 of 27

developerWorks®

ibm.com/developerWorks

Section 1. Before you start
About this series
This tutorial series demonstrates how to create a stand-alone Web services server and client application that you can easily run from the command line with Java SE 6 rather than from within web application server containers. Using a simple Hello World example, you will leverage the Eclipse IDE, Java SE 6, and Apache Ant to easily create fully functioning Web services server and client applications. You will also use the TCP/IP Monitor to examine the communication traffic between the server and client, and use the Eclipse Web Services Explorer tool to test the Web Service.

About this tutorial
This tutorial, Part 2 of the series, describes the creation of a stand-alone Web service client application to communicate with the stand-alone Web service you developed and deployed in Part 1. You will be taken step-by-step through the development and deployment of the Web service client application using the Eclipse IDE, Java SE 6 and Ant.

Objectives
After completing this tutorial you should know: • How to create the client side of a Web service, using the Eclipse IDE to generate and compile the code using Java SE 6. • How to use the Ant Java-based build tool within the Eclipse IDE to run a special Java command to generate some of the code from the WSDL published in Part 1 of the series. • How to use the TCP/IP Monitor within the Eclipse IDE to observe, capture and validate the Web service's SOAP traffic between the server and client. • How to run the server and client applications directly from the command line outside of the Eclipse IDE.

Prerequisites
Part 2: The Web service client application © Copyright IBM Corporation 2009. All rights reserved. Trademarks Page 2 of 27

ibm.com/developerWorks

developerWorks®

This tutorial includes simple steps written for beginning- to intermediate-level Java programmers with some working knowledge of the Java language and Ant builds. Novice to more advanced Java developers will gain some knowledge of how to build, deploy, and run stand-alone Web services servers and distributed clients to provide firewall-friendly remote communications and applications processing.

System requirements
To follow the examples, you need to download: • Eclipse IDE for Java EE Developers • Java SE 6 You don't have to download Ant, as its functionality is bundled with Eclipse. This tutorial uses the Ganymede Package for the Eclipse IDE for Java EE Developers.

Section 2. Create a new project
You may recall from Part 1 that an Eclipse project contains the source code and other related files for your application. It lets you use the project as the code source container or to set up folders inside the project to organize files. You will need to create a new project to construct your Web service client: 1. 2. Select File > New > Project. Expand the Java folder and click Java Project (see Figure 1). Figure 1. Creating a project in Eclipse

Part 2: The Web service client application © Copyright IBM Corporation 2009. All rights reserved.

Trademarks Page 3 of 27

developerWorks®

ibm.com/developerWorks

3. 4.

Click Next. Enter a project name, such as wsClientExample, when prompted, as shown in Figure 2. Figure 2. Entering project details in...
tracking img