Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Creating a Bottom-Up Java Web Service"
(New page: {| width="100%" cellspacing="5" cellpadding="2" | width="60%" align="left" | <font class="indextop">Creating Bottom Up Web Service</font><br /><font class="indexsub">Creating Bottom Up Web...) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
| width="60%" align="left" | <font class="indextop">Creating Bottom Up Web Service</font><br /><font class="indexsub">Creating Bottom Up Web Service</font> | | width="60%" align="left" | <font class="indextop">Creating Bottom Up Web Service</font><br /><font class="indexsub">Creating Bottom Up Web Service</font> | ||
| width="40%" | | | width="40%" | | ||
− | [[Image: | + | [[Image:Wtplogosmall.png]] |
|} | |} | ||
{| width="100%" cellspacing="5" cellpadding="2" | {| width="100%" cellspacing="5" cellpadding="2" | ||
− | | valign="top" | '''By Kathy Chan'''<br /> June | + | | valign="top" | '''By Kathy Chan'''<br /> June 23, 2008 <br /><br /> |
|- | |- | ||
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | ''' <font color="#ffffff" face="Arial,Helvetica">Introduction</font>''' | | colspan="2" bgcolor="#0080c0" align="left" valign="top" | ''' <font color="#ffffff" face="Arial,Helvetica">Introduction</font>''' | ||
Line 12: | Line 12: | ||
| valign="top" | <br /> | | valign="top" | <br /> | ||
|- | |- | ||
− | | valign="top" | This document is one of a series of tutorials to demonstrate the use of the Web Services tools in the Web Tools Platform Project using the | + | | valign="top" | This document is one of a series of tutorials to demonstrate the use of the Web Services tools in the Web Tools Platform Project using the WTP drivers (it works with WTP 1.5.x, WTP 2.0.x, WTP 3.0.x, and WTP 3.2). |
|- | |- | ||
| valign="top" | This tutorial shows how to create a simple Web service and Web service client from a Java class. The Java class in this scenario converts between the Celsius and Farenheit temperature scales. | | valign="top" | This tutorial shows how to create a simple Web service and Web service client from a Java class. The Java class in this scenario converts between the Celsius and Farenheit temperature scales. | ||
Line 41: | Line 41: | ||
# Select '''Monitor the Web service''' . | # Select '''Monitor the Web service''' . | ||
# If you want to choose a server different from the one defaulted by the wizard, click the '''Server project''' link to [http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/SelectServer/SelectServer.html select a server ]. | # If you want to choose a server different from the one defaulted by the wizard, click the '''Server project''' link to [http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/SelectServer/SelectServer.html select a server ]. | ||
− | # Result: <br />[[Image: | + | # Result: <br />[[Image:Ws_BUWizard.png]]<br /> |
# Click '''Finish''' . | # Click '''Finish''' . | ||
− | # It will take about one minute for the wizard to assemble the Web service and Web service client Web projects, start Apache Tomcat, and deploy the projects to Tomcat. Once finished, the generated Sample JSP Web application will appear in the browser view, maximized here for clarity: <br />[[Image: | + | # It will take about one minute for the wizard to assemble the Web service and Web service client Web projects, start Apache Tomcat, and deploy the projects to Tomcat. Once finished, the generated Sample JSP Web application will appear in the browser view, maximized here for clarity: <br />[[Image:Ws_BUJSP.png]]<br /> |
# Under '''Methods''' , click on '''celsiusToFarenheit(float)''' . | # Under '''Methods''' , click on '''celsiusToFarenheit(float)''' . | ||
# Under '''Inputs''' , enter <tt>37</tt> into the '''celsius''' entry field. | # Under '''Inputs''' , enter <tt>37</tt> into the '''celsius''' entry field. | ||
− | # Click on '''Invoke'''. In the '''Result''' view, you should get a response of '''98.6'''. <br />[[Image: | + | # Click on '''Invoke'''. In the '''Result''' view, you should get a response of '''98.6'''. <br />[[Image:Ws_BUJSPResult.png]]<br /> |
− | # Since you selected the "Monitor Web service" checkbox, a TCP/IP port is automatically created on the Tomcat server. When you invoke the Web service, the '''TCP/IP Monitor''' view comes up automatically showing the SOAP message request and response. Double-click on the '''TCP/IP Monitor''' view and select XML view in the drop-down combo for both request and response. Result: <br />[[Image: | + | # Since you selected the "Monitor Web service" checkbox, a TCP/IP port is automatically created on the Tomcat server. When you invoke the Web service, the '''TCP/IP Monitor''' view comes up automatically showing the SOAP message request and response. Double-click on the '''TCP/IP Monitor''' view and select XML view in the drop-down combo for both request and response. Result: <br />[[Image:Ws_BUMonitor.png]]<br /> |
|- | |- | ||
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | ''' <font color="#ffffff" face="Arial,Helvetica">Explanation</font>''' | | colspan="2" bgcolor="#0080c0" align="left" valign="top" | ''' <font color="#ffffff" face="Arial,Helvetica">Explanation</font>''' |
Latest revision as of 10:10, 13 May 2010
Creating Bottom Up Web Service Creating Bottom Up Web Service |
By Kathy Chan June 23, 2008 | |
Introduction | |
| |
This document is one of a series of tutorials to demonstrate the use of the Web Services tools in the Web Tools Platform Project using the WTP drivers (it works with WTP 1.5.x, WTP 2.0.x, WTP 3.0.x, and WTP 3.2). | |
This tutorial shows how to create a simple Web service and Web service client from a Java class. The Java class in this scenario converts between the Celsius and Farenheit temperature scales. | |
| |
Set Up | |
| |
Before creating the Web service, there are two prerequisites: | |
| |
Creating a bottom up Java bean Web service and Web service client | |
| |
| |
Explanation | |
The Web Service wizard is orchestrating the end-to-end generation, assembly, deployment, installation and execution of the Web service, Web service client, and sample JSPs. In this scenario, we clicked Finish on page one. In effect, this is allowing the wizard to pick reasonable defaults according to the basic high-level choices made on the first page. If you repeat this scenario, but use the Next button to work through the wizard, you will learn more about the kinds of choices that are available and the kinds of defaults being assumed. | |
After completing this scenario, the WSDL for the Converter Web service can be found in ConverterProj/WebContent/wsdl/Converter.wsdl. | |
Now that your Web service is running, there are a few interesting things you can do with this WSDL file. Examples: | |
|