blob: 3a076c373d6788fc5760e52db7806750eb0a8fa6 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Creating a Web service client using Ant tasks" />
<meta name="abstract" content="If you have a WSDL file you can use Ant through the Eclipse workspace to generate a Web service client using the Axis run-time environment." />
<meta name="description" content="If you have a WSDL file you can use Ant through the Eclipse workspace to generate a Web service client using the Axis run-time environment." />
<meta scheme="URI" name="DC.Relation" content="../topics/cwsaxisant.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/rwsclienta.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="twsclienta" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Creating an Axis runtime Web service client from a WSDL file
using command line tools</title>
</head>
<body id="twsclienta"><a name="twsclienta"><!-- --></a>
<h1 class="topictitle1">Creating a Web service client using Ant tasks</h1>
<div><p>If you have a WSDL file you can use Ant through the Eclipse workspace
to generate a Web service client using the Axis run-time environment.</p>
<div class="p">Before creating the Web service client you must:<ul>
<li>complete the prerequisites listed in: <a href="cwsaxisant.html" title="If you prefer not to use the Web service wizard, you can use Ant&#10;files to create Web services and clients using the Axis runtime environment.&#10;The Web services Ant tasks can be run in two ways: through the Eclipse workspace&#10;using Run As &gt; Ant Build..., or they can be run headless through the command line. Once&#10;you have created your Web service, you can then deploy it to a server, test&#10;it, and publish it as a business entity or business service.">Creating Axis runtime environment Web services and clients using Web services Ant tasks</a></li>
<li>create or import a WSDL file into the dynamic Web project you created.</li>
</ul>
</div>
<div class="section">In order to create the Web service client you need to modify the
Ant file and the Ant properties file.</div>
<ol>
<li class="stepexpand"><span>Edit the Ant file (<kbd class="userinput">wsgen.xml</kbd>) that you imported
in the prerequisite steps. Ensure that it points to the client Ant properties
file: it should contain a line stating <kbd class="userinput">&lt;property file="axisclient.properties"/&gt;</kbd>.</span>
Save any changes that you have made.</li>
<li class="stepexpand"><span>Edit the <kbd class="userinput">axisclient.properties</kbd> file that
you imported in the prerequisite steps.</span>
<ol type="a">
<li><span>Ensure that the scenarioType parameter is set to client.</span>
</li>
<li><span>Set the workspace parameter so that it points to the location
of your WSDL file.</span></li>
<li><span>All other parameters are optional and should be deleted if not
explicitly set. The default values for the remaining parameters will be retrieved
from the dynamic project settings. For additional information on how to set
these parameters refer to: <a href="rwsclienta.html" title="The axisclient.properties file is used to&#10;pass data to the Web services Ant tasks when creating an Axis Web service&#10;client. This file shows the available options.">Axis Web service client Ant task properties file reference</a></span></li>
</ol>
Save the <kbd class="userinput">axisclient.properties</kbd> file.</li>
<li class="stepexpand"><span>Right-click <kbd class="userinput">wsgen.xml</kbd> and select <span class="menucascade">
<span class="uicontrol">Run As</span> &gt; <span class="uicontrol">Ant Build...</span></span></span>
</li>
<li class="stepexpand"><span>In the dialog that opens, select the <span class="uicontrol">JRE</span> tab
and select <span class="uicontrol">Run in the same JRE as the workspace</span>.</span>
Click <span class="uicontrol">Apply</span> and then click <span class="uicontrol">Run</span>.
</li>
<li class="stepexpand"><span>Once your Web service has been generated the console displays a <kbd class="userinput">Build
Successful</kbd> message.</span></li>
</ol>
<div class="section">The following files will have been created and placed in the dynamic
Web project's WebContent\wsdl folder:<ul>
<li><em>Service_name</em>SOAP.wsdl </li>
</ul>
The following files will have been created and placed in the dynamic
Web project's WebContent\WEB-INF folder:<ul>
<li>undeploy.wsdd</li>
<li>deploy.wsdd </li>
</ul>
The following files will have been created and placed under the dynamic
Web project's src folder. Depending on the WSDL file on which the Web service
client is based, the files for your Web service client may be different:<ul>
<li><em>Service_name</em>Proxy.java</li>
<li>get<em>Service_name</em>.java</li>
<li>get<em>Service_name</em>Locator.java</li>
<li>get<em>Service_name</em>Soap.java</li>
<li>get<em>Service_name</em>SoapProxy.java</li>
<li>get<em>Service_name</em>SoapStub.java</li>
</ul>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="../topics/rwsclienta.html">Axis Web service client Ant task properties file reference</a></strong><br />
The axisclient.properties file is used to pass data to the Web services Ant tasks when creating an Axis Web service client. This file shows the available options.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/cwsaxisant.html" title="If you prefer not to use the Web service wizard, you can use Ant files to create Web services and clients using the Axis runtime environment. The Web services Ant tasks can be run in two ways: through the Eclipse workspace using Run As &gt; Ant Build..., or they can be run headless through the command line. Once you have created your Web service, you can then deploy it to a server, test it, and publish it as a business entity or business service.">Creating Axis runtime environment Web services and clients using Web services Ant tasks</a></div>
</div>
</div>
</body>
</html>