blob: d54efc0d10ca0b2493490e5efe02c93c882d7920 [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 using Ant tasks in the Workbench" />
<meta name="abstract" content="You can use Ant through the Eclipse workspace to generate a Web service using the Axis run-time environment. Both top-down and bottom-up Web services development is supported with the Ant tasks." />
<meta name="description" content="You can use Ant through the Eclipse workspace to generate a Web service using the Axis run-time environment. Both top-down and bottom-up Web services development is supported with the Ant tasks." />
<meta scheme="URI" name="DC.Relation" content="../topics/cwsaxisant.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/rtdwsa.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/rbuwsa.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="ttdwsa" 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 using Ant tasks in the Workbench</title>
</head>
<body id="ttdwsa"><a name="ttdwsa"><!-- --></a>
<h1 class="topictitle1">Creating a Web service using Ant tasks in the Workbench</h1>
<div><p>You can use Ant through the Eclipse workspace to generate a Web
service using the Axis run-time environment. Both top-down and bottom-up Web
services development is supported with the Ant tasks.</p>
<div class="p">Before creating the Web service 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>if you are creating a top-down Web service, create or import a WSDL file
into the <kbd class="userinput">WebConent</kbd> folder of the dynamic Web project
you created.</li>
<li>If you are creating a bottom-up Web service, create or import a Java bean
into the <kbd class="userinput">src</kbd> folder of the dynamic Web project.</li>
</ul>
</div>
<div class="section">In order to create the Web service you need to modify the Ant file
and the service 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 service Ant properties
file: it should contain a line stating <kbd class="userinput">&lt;property file="axisservice.properties"/&gt;</kbd>.</span>
Save any changes that you have made.</li>
<li class="stepexpand"><span>Edit the <kbd class="userinput">axisservice.properties</kbd> file that
you imported in the prerequisite steps.</span>
<ol type="a">
<li class="substepexpand"><span>Ensure that the scenarioType parameter is set to service.</span>
</li>
<li class="substepexpand"><span>Set the workspace parameter so that it points to the location
of your WSDL file or Java bean.</span></li>
<li class="substepexpand"><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 and preferences. For additional information
on how to set these parameters refer to: </span> <ul>
<li><a href="rtdwsa.html" title="The axisservice.properties file is used&#10;to pass data to the Web services Ant tasks when creating an Axis Web service&#10;. This file shows the available options.">Top-down Axis Web service Ant task properties file reference</a></li>
<li><a href="rbuwsa.html" title="The axisservice.properties file is used&#10;to pass data to the Web services Ant tasks when creating an Axis Web service&#10;. This file shows the available options.">Bottom-up Axis Web service Ant task properties file reference</a></li>
</ul>
</li>
</ol>
Save the <kbd class="userinput">axisservice.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 WSDL file for the service will have been created and placed in
the dynamic Web project's WebContent\wsdl folder. The following files will
have been created and placed in a subdirectory of the dynamic Web project's
WebContent\WEB-INF folder:<ul>
<li>web.xml</li>
<li>undeploy.wsdd</li>
<li>deploy.wsdd </li>
</ul>
If you are creating a top-down Web service, Web service files similar
to the following ones will be created and placed under the dynamic Web project's
src folder. Depending on the WSDL file on which the Web service is based,
the files for your Web service may be different:<ul>
<li><em>Service_name</em>_PortType.java</li>
<li><em>Service_name</em>_Service.java</li>
<li><em>Service_name</em>_ServiceLocator.java</li>
<li><em>Service_name</em>SOAPImpl.java</li>
<li><em>Service_name</em>SOAPSkeleton.java</li>
<li><em>Service_name</em>SOAPStub.java</li>
</ul>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="../topics/rtdwsa.html">Top-down Axis Web service Ant task properties file reference</a></strong><br />
The axisservice.properties file is used to pass data to the Web services Ant tasks when creating an Axis Web service . This file shows the available options.</li>
<li class="ulchildlink"><strong><a href="../topics/rbuwsa.html">Bottom-up Axis Web service Ant task properties file reference</a></strong><br />
The axisservice.properties file is used to pass data to the Web services Ant tasks when creating an Axis Web service . 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>