blob: 5f104e0a6e4508c668179a3e8c8c08592946f9c9 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta name="copyright" content="Copyright (c) 2009 Shane Clarke. 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 Contributors: Shane Clarke - initial API and implementation">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Generate an SEI and a skeleton implementation bean from a WSDL document using Apache CXF</title>
<link href="../book.css" rel="stylesheet" charset="ISO-8859-1" type="text/css">
<script type="text/javascript" language="JavaScript" src="PLUGINS_ROOT/"></script>
<h2>Generate an SEI and a skeleton implementation bean from a WSDL document using Apache CXF</h2>
<li>Install and configure the Apache CXF runtime environment. See the <a href="PLUGINS_ROOT/">Requirements and Installation</a> page for more details.</li>
<li>Create a Dynamic Web Project and enable it for Apache CXF Web services development as described here: <a href="../tasks/create_cxf_project.html">Create a project for CXF Web services</a>.</li>
<li>Create or import a WSDL document into the Web Content folder of the Dynamic Web Project.</li>
To create an SEI and a skeleton implementation bean from a WSDL document using the Apache CXF runtime environment:
<li>Select <a class="command-link"
<img src="PLUGINS_ROOT/" alt="Open the Java EE perspective"><strong>Window &gt; Open Perspective &gt; Java EE</strong></a> from the top level menu to switch to the Java EE perspective.</li>
<li>In the Project Explorer view select the WSDL document that you created or imported into the Dynamic Web Projects Web Content folder.</li>
<li>Open the Web Service wizard by selecting <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.newWizard(")'>
<img src="PLUGINS_ROOT/" alt="Open the new web service wizard"><strong>File &gt; New &gt; Other... &gt; Web Services &gt; Web Service</strong></a> from the top level menu.</li>
<li>Web Services page: select <b>Top down Java bean Web Service</b> as the Web service type and browse to select the WSDL document from which to generate the SEI and implementation bean:
<p><img src="./images/top_down_wizard.png" alt="Top down Web Services Wizard"></p>
<ol type="a">
<li>Move the service slider to the stage of Web services development that you wish to complete.</li>
<li>Develop: Invokes the Apache CXF wsdl2java tool using the preference defaults and the information gathered in the wizard to generate an annotated Service Endpoint Interface and supporting classes. The wizard also generates a JAX-WS endpoint configuration file.</li>
<li>Assemble: If required by the target server this phase
assembles and configures the project that hosts the Web service into an EAR.</li>
<li>Deploy: Generates the deployment artifacts for the Web service.</li>
<li>Install: Installs and configures the Web Module and EARs on the target server.</li>
<li>Start: Starts the target server once the Web service has been installed on it.</li>
<li>Test: Use the Web Service Explorer to test the generated Web service.</li>
<li>Server: Select a server to deploy your Web service to.</li>
<li>Web service runtime: Select Apache CXF 2.x</li>
<li>Service project: Select the project in your workspace into which Apache CXF will generate the code.</li>
<li>If you wish to generate a client for your Web service, select <b>Java Proxy</b> as the Client type:
<li>Move the client slider to the <b>Develop client</b> stage.</li>
<li>Client project: Select a different project into which to generate the client code. The wizard will create the project for you if it doesn't exist and configure it with the CXF Facet.</li>
<li>Publish the Web service: Launch the Web Services Explorer to publish your Web service to a UDDI registry.</li>
<li>Monitor the Web service: Monitor the Web service's SOAP traffic using the TCP/IP Monitor.</li>
<li>Click <b>Next &gt;</b> to move to the first Apache CXF wsdl2java Configuration page:
<li>Output Directory: Specify the source folder in the service project into which the code is generated.</li>
<li>Package Name: Type the Java package name to use for the generated code.</li>
<li>Specify WSDL Namespace to Package Name Mappings: Optionally specify WSDL namespace mappings to Java package names.</li>
<li>Service Name: Specify the name of the WSDL service from which to generate code. The default is to generate code for every service in the WSDL document.</li>
<li>Binding Files: Specify one or more JAX-WS or JAXB binding files.</li>
<li>Click <b>Next &gt;</b> to move to the second Apache CXF wsdl2java configuration page which allows you to override the <a href="../reference/wsdl2java_tab.html">wsdl2java</a> default preferences:
<p>Ensure that the <b>Generate Implementation</b> check box is selected and click <b>Next &gt;</b>
<li>Test Web Service page. This page will be displayed if the service slider on the first page was set to Test service.
<p>Select the launch button to test the Web Service with the <a href="PLUGINS_ROOT/">Web Services Explorer</a>.</p>
<li>Apache CXF JAX-WS client configuration page: This page will be displayed if the client slider on the Web services page was set to <b>Develop client</b>.
<p>Refer to the <a href="./create_client.html">Create a JAX-WS Web Service Client</a> page for information on the options displayed on this page.</p>
<li>Web Service Publication Page: Select whether or not you want to publish this Web service to a UDDI registry. Click <b>Finish</b></li>
<p><img src="../images/ngrelt.png" alt="Related tasks" border="0" ></p>
<a href="../tasks/create_bottomup.html">Create a Web Service from a Java implementation bean using Apache CXF</a><br>
<a href="../tasks/create_client.html">Generate a JAX-WS Web Service Client from a WSDL document using Apache CXF</a><br>