geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r917744 [25/31] - in /websites/production/geronimo/content: GMOxDOC20/ GMOxDOC20/geronimo-eclipse-plugin-installation-instructions.data/ cache/
Date Tue, 29 Jul 2014 00:52:21 GMT
Modified: websites/production/geronimo/content/GMOxDOC20/simple-web-service-with-jax-ws.html
==============================================================================
--- websites/production/geronimo/content/GMOxDOC20/simple-web-service-with-jax-ws.html (original)
+++ websites/production/geronimo/content/GMOxDOC20/simple-web-service-with-jax-ws.html Tue
Jul 29 00:52:18 2014
@@ -23,6 +23,7 @@
   <script src='http://geronimo.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
   <script src='http://geronimo.apache.org/resources/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
   <script src='http://geronimo.apache.org/resources/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
+  <script src='http://geronimo.apache.org/resources/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
   
   <script type="text/javascript">
   SyntaxHighlighter.defaults['toolbar'] = false;
@@ -95,24 +96,39 @@
 
       <div class="pagecontent">
         <div class="wiki-content">
-          <div class="wiki-content maincontent"><style type="text/css">/*<![CDATA[*/
-table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
+          <div class="wiki-content maincontent">    
+<div class="atb-scrollbar-macro">
+    <div class="prev">
+        <a shape="rect" href="simple-database-access-sample-application.html" rel="prev">
+                                    <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span>
+                                <span class="title">Simple database access sample application</span>
+            </a>
 
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="simple-database-access-sample-application.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif"
width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="simple-database-access-sample-application.html">Simple
database access sample application</a>&#160;</td><td colspan="1" rowspan="1"
class="ScrollbarParent" width="33%"><sup><a shape="rect" href="sample-applications.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif"
width="8" height="8"></a></sup><a shape="rect" href="sample-applications.html">Sample
applications</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName"
width="33%">&#160;<a shape="rect" href="specjappserver2004.html">SPECjAppServer2004</a></td><td
colspan="
 1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="specjappserver2004.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif"
width="16" height="16"></a></td></tr></table></div>
+    </div>
+    <div class="parent">
+                    <a shape="rect" href="sample-applications.html" rel="parent">
+                                            <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span>
+                                        <span class="title">Sample applications</span>
+                </a>
+
+            </div>
+    <div class="next">
+        <a shape="rect" href="specjappserver2004.html" rel="next">
+                <span class="title">SPECjAppServer2004</span>
+                                    <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span>
+                            </a>
+
+    </div>
+</div>
 
-<h1><a shape="rect" name="SimpleWebServicewithJAX-WS-ApplicationOverview"></a>Application
Overview <a shape="rect" name="SimpleWebServicewithJAX-WS-application"></a></h1>
+<h1 id="SimpleWebServicewithJAX-WS-ApplicationOverviewapplication">Application Overview
<span class="confluence-anchor-link" id="SimpleWebServicewithJAX-WS-application"></span></h1>
 <p>The sample application referred in this article is a simple calculator which performs
addition of two integers. The client application referred here is not a J2EE application.
It is a regular Java client which will call a web service to carry out the application functionality.
Web service is exposed as a Servlet in the Geronimo application server.</p>
 
-<h2><a shape="rect" name="SimpleWebServicewithJAX-WS-Serviceimplementation"></a>Service
implementation</h2>
+<h2 id="SimpleWebServicewithJAX-WS-Serviceimplementation">Service implementation</h2>
 
-<p>The <b>Calculator</b> interface defines the Service Endpoint Interface
(SEI) for the Web Service. </p>
+<p>The <strong>Calculator</strong> interface defines the Service Endpoint
Interface (SEI) for the Web Service. </p>
 
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Calculator.java</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Calculator.java</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 package org.apache.geronimo.samples.jws;
 
@@ -120,22 +136,22 @@ import javax.jws.WebService;
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 
-@WebService(name="CalculatorPortType",
-            targetNamespace = "http://jws.samples.geronimo.apache.org")
+@WebService(name=&quot;CalculatorPortType&quot;,
+            targetNamespace = &quot;http://jws.samples.geronimo.apache.org&quot;)
 public interface Calculator {
 
     @WebMethod
-    public int add(@WebParam(name = "value1") int value1,
-                   @WebParam(name = "value2") int value2);
+    public int add(@WebParam(name = &quot;value1&quot;) int value1,
+                   @WebParam(name = &quot;value2&quot;) int value2);
 
 }
 ]]></script>
 </div></div>
 
-<p>The <b>CalculatorService</b> class implements the Web Service business
logic. It implements all the methods defined in the SEI. The class does not need to implement
the <b>Calculator</b> interface but must reference it through the @WebService.endpointInterface
annotation. This class will be exposed as a Servlet through <b>web.xml</b> file
even though it does not extend the <b>javax.servlet.Servlet</b> class.<br clear="none">
-The <b>context</b> variable marked with the @Resource annotation will be injected
at runtime. The <b>WebServiceContext</b> can be used to obtain the message context
and security information relative to the call.</p>
+<p>The <strong>CalculatorService</strong> class implements the Web Service
business logic. It implements all the methods defined in the SEI. The class does not need
to implement the <strong>Calculator</strong> interface but must reference it through
the @WebService.endpointInterface annotation. This class will be exposed as a Servlet through
<strong>web.xml</strong> file even though it does not extend the <strong>javax.servlet.Servlet</strong>
class.<br clear="none">
+The <strong>context</strong> variable marked with the @Resource annotation will
be injected at runtime. The <strong>WebServiceContext</strong> can be used to
obtain the message context and security information relative to the call.</p>
 
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>CalculatorService.java</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>CalculatorService.java</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 package org.apache.geronimo.samples.jws;
 
@@ -143,30 +159,30 @@ import javax.annotation.Resource;
 import javax.jws.WebService;
 import javax.xml.ws.WebServiceContext;
 
-@WebService(serviceName = "Calculator",
-            portName="CalculatorPort",
-            endpointInterface = "org.apache.geronimo.samples.jws.Calculator",
-            targetNamespace = "http://jws.samples.geronimo.apache.org",
-            wsdlLocation = "WEB-INF/wsdl/CalculatorService.wsdl")
+@WebService(serviceName = &quot;Calculator&quot;,
+            portName=&quot;CalculatorPort&quot;,
+            endpointInterface = &quot;org.apache.geronimo.samples.jws.Calculator&quot;,
+            targetNamespace = &quot;http://jws.samples.geronimo.apache.org&quot;,
+            wsdlLocation = &quot;WEB-INF/wsdl/CalculatorService.wsdl&quot;)
 public class CalculatorService implements Calculator {
 
     @Resource
     private WebServiceContext context;
 
     public int add(int value1, int value2) {
-        System.out.println("User Principal: " + context.getUserPrincipal());
+        System.out.println(&quot;User Principal: &quot; + context.getUserPrincipal());
         return value1 + value2;
     }
 }
 ]]></script>
 </div></div>
 
-<p>The <b>web.xml</b> descriptor is used to deploy the Web Service. </p>
+<p>The <strong>web.xml</strong> descriptor is used to deploy the Web Service.
</p>
 
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>web.xml</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>web.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;web-app xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; version=&quot;2.5&quot;&gt;
 	&lt;servlet&gt;
 		&lt;display-name&gt;CalculatorService&lt;/display-name&gt;
 		&lt;servlet-name&gt;CalculatorService&lt;/servlet-name&gt;
@@ -185,15 +201,23 @@ public class CalculatorService implement
 ]]></script>
 </div></div>
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col
span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1"
valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif"
width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>web.xml</b><br
clear="none">The <b>web.xml</b> descriptor is not necessary for simple JAX-WS
web service deployments. If the <b>web.xml</b> descriptor is not provided, it
will be automatically generated during deployment.</td></tr></table></div>
+    <div class="aui-message hint shadowed information-macro">
+                    <p class="title">web.xml</p>
+                            <span class="aui-icon icon-hint">Icon</span>
+                <div class="message-content">
+                            
+<p>The <strong>web.xml</strong> descriptor is not necessary for simple
JAX-WS web service deployments. If the <strong>web.xml</strong> descriptor is
not provided, it will be automatically generated during deployment. </p>
+                    </div>
+    </div>
+
 
-<p>The <b>geronimo-web.xml</b> descriptor is optional but it is used in
this sample to specify the module name. Information about the project (e.g. module's unique
identification, any dependencies) is described inside the &lt;environment&gt; tag.
In this case, there are no dependencies so they do not need to be listed. However, it is a
good idea to give this module some sort of unique identification, so that it can later be
referenced by some other deployable application.</p>
+<p>The <strong>geronimo-web.xml</strong> descriptor is optional but it
is used in this sample to specify the module name. Information about the project (e.g. module's
unique identification, any dependencies) is described inside the &lt;environment&gt;
tag. In this case, there are no dependencies so they do not need to be listed. However, it
is a good idea to give this module some sort of unique identification, so that it can later
be referenced by some other deployable application.</p>
 
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-web.xml</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-web.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"&gt;
-  &lt;dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;web-app xmlns=&quot;http://geronimo.apache.org/xml/ns/j2ee/web-1.1&quot;&gt;
+  &lt;dep:environment xmlns:dep=&quot;http://geronimo.apache.org/xml/ns/deployment-1.1&quot;&gt;
     &lt;dep:moduleId&gt;
       &lt;dep:groupId&gt;${pom.groupId}&lt;/dep:groupId&gt;
       &lt;dep:artifactId&gt;${pom.artifactId}&lt;/dep:artifactId&gt;
@@ -219,75 +243,75 @@ public class CalculatorService implement
 </div></div>
 
 <p>The following WSDL file describes the Web Service:</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>CalculatorService.wsdl</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>CalculatorService.wsdl</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;wsdl:definitions name="Calculator"
-    xmlns="http://schemas.xmlsoap.org/wsdl/"
-    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    targetNamespace="http://jws.samples.geronimo.apache.org"
-    xmlns:tns="http://jws.samples.geronimo.apache.org"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;wsdl:definitions name=&quot;Calculator&quot;
+    xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
+    xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
+    xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
+    xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    targetNamespace=&quot;http://jws.samples.geronimo.apache.org&quot;
+    xmlns:tns=&quot;http://jws.samples.geronimo.apache.org&quot;&gt;
 
     &lt;wsdl:types&gt;
-        &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
-                    xmlns="http://jws.samples.geronimo.apache.org" 
-                    targetNamespace="http://jws.samples.geronimo.apache.org"
-                    attributeFormDefault="unqualified" elementFormDefault="qualified"&gt;
+        &lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;

+                    xmlns=&quot;http://jws.samples.geronimo.apache.org&quot; 
+                    targetNamespace=&quot;http://jws.samples.geronimo.apache.org&quot;
+                    attributeFormDefault=&quot;unqualified&quot; elementFormDefault=&quot;qualified&quot;&gt;
 
-             &lt;xsd:element name="add"&gt;
+             &lt;xsd:element name=&quot;add&quot;&gt;
                 &lt;xsd:complexType&gt;
                    &lt;xsd:sequence&gt;
-                      &lt;xsd:element name="value1" type="xsd:int"/&gt;
-                      &lt;xsd:element name="value2" type="xsd:int"/&gt;
+                      &lt;xsd:element name=&quot;value1&quot; type=&quot;xsd:int&quot;/&gt;
+                      &lt;xsd:element name=&quot;value2&quot; type=&quot;xsd:int&quot;/&gt;
                    &lt;/xsd:sequence&gt;
                 &lt;/xsd:complexType&gt;
              &lt;/xsd:element&gt;
 
-             &lt;xsd:element name="addResponse"&gt;
+             &lt;xsd:element name=&quot;addResponse&quot;&gt;
                 &lt;xsd:complexType&gt;
                    &lt;xsd:sequence&gt;
-                      &lt;xsd:element name="return" type="xsd:int"/&gt;
+                      &lt;xsd:element name=&quot;return&quot; type=&quot;xsd:int&quot;/&gt;
                    &lt;/xsd:sequence&gt;
                 &lt;/xsd:complexType&gt;
              &lt;/xsd:element&gt;
         &lt;/xsd:schema&gt;
     &lt;/wsdl:types&gt;
   
-    &lt;wsdl:message name="add"&gt;
-       &lt;wsdl:part name="add" element="tns:add"/&gt;
+    &lt;wsdl:message name=&quot;add&quot;&gt;
+       &lt;wsdl:part name=&quot;add&quot; element=&quot;tns:add&quot;/&gt;
     &lt;/wsdl:message&gt;
 
-    &lt;wsdl:message name="addResponse"&gt;
-       &lt;wsdl:part name="addResponse" element="tns:addResponse"/&gt;
+    &lt;wsdl:message name=&quot;addResponse&quot;&gt;
+       &lt;wsdl:part name=&quot;addResponse&quot; element=&quot;tns:addResponse&quot;/&gt;
     &lt;/wsdl:message&gt;
 
-    &lt;wsdl:portType name="CalculatorPortType"&gt;
-       &lt;wsdl:operation name="add"&gt;
-         &lt;wsdl:input name="add" message="tns:add"/&gt;
-         &lt;wsdl:output name="addResponse" message="tns:addResponse"/&gt;
+    &lt;wsdl:portType name=&quot;CalculatorPortType&quot;&gt;
+       &lt;wsdl:operation name=&quot;add&quot;&gt;
+         &lt;wsdl:input name=&quot;add&quot; message=&quot;tns:add&quot;/&gt;
+         &lt;wsdl:output name=&quot;addResponse&quot; message=&quot;tns:addResponse&quot;/&gt;
        &lt;/wsdl:operation&gt;
     &lt;/wsdl:portType&gt;
         
-    &lt;wsdl:binding name="CalculatorSoapBinding" type="tns:CalculatorPortType"&gt;
-        &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
+    &lt;wsdl:binding name=&quot;CalculatorSoapBinding&quot; type=&quot;tns:CalculatorPortType&quot;&gt;
+        &lt;soap:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;
         
-        &lt;wsdl:operation name="add"&gt;
-            &lt;soap:operation soapAction="add" style="document"/&gt;
-            &lt;wsdl:input name="add"&gt;
-                &lt;soap:body use="literal"/&gt;
+        &lt;wsdl:operation name=&quot;add&quot;&gt;
+            &lt;soap:operation soapAction=&quot;add&quot; style=&quot;document&quot;/&gt;
+            &lt;wsdl:input name=&quot;add&quot;&gt;
+                &lt;soap:body use=&quot;literal&quot;/&gt;
             &lt;/wsdl:input&gt;
-            &lt;wsdl:output name="addResponse"&gt;
-                &lt;soap:body use="literal"/&gt;
+            &lt;wsdl:output name=&quot;addResponse&quot;&gt;
+                &lt;soap:body use=&quot;literal&quot;/&gt;
             &lt;/wsdl:output&gt;
         &lt;/wsdl:operation&gt;
                 
     &lt;/wsdl:binding&gt;
   
-    &lt;wsdl:service name="Calculator"&gt;
-        &lt;wsdl:port name="CalculatorPort" binding="tns:CalculatorSoapBinding"&gt;
-            &lt;soap:address location="http://localhost:8080/jaxws-calculator-1.0/calculator"/&gt;
+    &lt;wsdl:service name=&quot;Calculator&quot;&gt;
+        &lt;wsdl:port name=&quot;CalculatorPort&quot; binding=&quot;tns:CalculatorSoapBinding&quot;&gt;
+            &lt;soap:address location=&quot;http://localhost:8080/jaxws-calculator-1.0/calculator&quot;/&gt;
         &lt;/wsdl:port&gt;
     &lt;/wsdl:service&gt;
       
@@ -295,53 +319,61 @@ public class CalculatorService implement
 ]]></script>
 </div></div>
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col
span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1"
valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif"
width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>webservices.xml</b><br
clear="none">In J2EE version 1.4, the <b>webservices.xml</b> file was also
necessary to describe the Web Service. In Java EE 5 that file is optional and is not required
in this example.</td></tr></table></div>
+    <div class="aui-message hint shadowed information-macro">
+                    <p class="title">webservices.xml</p>
+                            <span class="aui-icon icon-hint">Icon</span>
+                <div class="message-content">
+                            
+<p>In J2EE version 1.4, the <strong>webservices.xml</strong> file was also
necessary to describe the Web Service. In Java EE 5 that file is optional and is not required
in this example. </p>
+                    </div>
+    </div>
+
 
-<h2><a shape="rect" name="SimpleWebServicewithJAX-WS-JSPbasedJAXWSclient"></a>JSP-based
JAX-WS client</h2>
+<h2 id="SimpleWebServicewithJAX-WS-JSP-basedJAX-WSclient">JSP-based JAX-WS client</h2>
 
-<p>The <b>add.jsp</b> is a basic client for the <b>CalculatorService</b>
Web Service.</p>
+<p>The <strong>add.jsp</strong> is a basic client for the <strong>CalculatorService</strong>
Web Service.</p>
 
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>add.jsp</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>add.jsp</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt;
-&lt;%@ page import="javax.naming.InitialContext,javax.xml.ws.Service,org.apache.geronimo.samples.jws.Calculator"%&gt;
-&lt;html  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
+&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=ISO-8859-1&quot;
pageEncoding=&quot;ISO-8859-1&quot;%&gt;
+&lt;%@ page import=&quot;javax.naming.InitialContext,javax.xml.ws.Service,org.apache.geronimo.samples.jws.Calculator&quot;%&gt;
+&lt;html  xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot;&gt;
 &lt;head&gt;
   &lt;title&gt;Apache Geronimo Sample Application - JAX-WS Calculator&lt;/title&gt;
-  &lt;meta content="text/html; CHARSET=iso-8859-1" http-equiv="Content-Type"&gt;
+  &lt;meta content=&quot;text/html; CHARSET=iso-8859-1&quot; http-equiv=&quot;Content-Type&quot;&gt;
 &lt;/head&gt;
 
 &lt;BODY&gt;
-  &lt;font face="Verdana, Helvetica, Arial"&gt;
+  &lt;font face=&quot;Verdana, Helvetica, Arial&quot;&gt;
 
     &lt;h3&gt;This is a JAX-WS web service sample application.   Please type the
value 1 and value 2 below to see the add result.&lt;/h3&gt;
-    &lt;form action="add.jsp"&gt;
-        Value 1: &lt;input type="text" name="value1"&gt;   Value 2: &lt;input
type="text" name="value2"&gt; &lt;input type="submit" value="Add"&gt;
+    &lt;form action=&quot;add.jsp&quot;&gt;
+        Value 1: &lt;input type=&quot;text&quot; name=&quot;value1&quot;&gt;
  Value 2: &lt;input type=&quot;text&quot; name=&quot;value2&quot;&gt;
&lt;input type=&quot;submit&quot; value=&quot;Add&quot;&gt;
     &lt;/form&gt;
     &lt;br&gt;
 &lt;%
-    String value1 = request.getParameter( "value1" );
-    String value2 = request.getParameter( "value2" );
+    String value1 = request.getParameter( &quot;value1&quot; );
+    String value2 = request.getParameter( &quot;value2&quot; );
 
     if (value1 != null &amp;&amp; value1.trim().length() &gt; 0 &amp;&amp;
         value2 != null &amp;&amp; value2.trim().length() &gt; 0) {
 
-        out.println("&lt;h4&gt;");
+        out.println(&quot;&lt;h4&gt;&quot;);
 
         try {
             int v1 = Integer.parseInt(value1);
             int v2 = Integer.parseInt(value2);
     
             InitialContext ctx = new InitialContext();
-            Service service = (Service)ctx.lookup("java:comp/env/services/Calculator");
+            Service service = (Service)ctx.lookup(&quot;java:comp/env/services/Calculator&quot;);
             Calculator calc = service.getPort(Calculator.class);         
             int sum = calc.add(v1, v2);
-            out.println("Result: " + v1 + " + " + v2 + " = " + sum);
+            out.println(&quot;Result: &quot; + v1 + &quot; + &quot; + v2
+ &quot; = &quot; + sum);
         } catch ( Exception e ) {
-            out.println("Error: " + e.getMessage());
+            out.println(&quot;Error: &quot; + e.getMessage());
        }
 
-       out.println("&lt;/h4&gt;");
+       out.println(&quot;&lt;/h4&gt;&quot;);
     }
 %&gt;
 
@@ -351,12 +383,12 @@ public class CalculatorService implement
 ]]></script>
 </div></div>
 
-<p>The <b>add.jsp</b> looks up a Web Service reference in the JNDI tree.
The Web Service reference must first be added the web.xml file.</p>
+<p>The <strong>add.jsp</strong> looks up a Web Service reference in the
JNDI tree. The Web Service reference must first be added the web.xml file.</p>
 
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>web.xml</b></div><div
class="codeContent panelContent">
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>web.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;web-app xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; version=&quot;2.5&quot;&gt;
         .....
 
         &lt;service-ref&gt;
@@ -370,46 +402,54 @@ public class CalculatorService implement
 ]]></script>
 </div></div>
 
-<div class="panelMacro"><table class="noteMacro"><colgroup span="1"><col
span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1"
valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif"
width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Resource
injection in JSP</b><br clear="none">Since the resource injection is not supported
in JSPs the service-ref must be added explicitly to the <b>web.xml</b> file.</td></tr></table></div>
+    <div class="aui-message warning shadowed information-macro">
+                    <p class="title">Resource injection in JSP</p>
+                            <span class="aui-icon icon-warning">Icon</span>
+                <div class="message-content">
+                            
+<p>Since the resource injection is not supported in JSPs the service-ref must be added
explicitly to the <strong>web.xml</strong> file.</p>
+                    </div>
+    </div>
+
 
-<h1><a shape="rect" name="SimpleWebServicewithJAX-WS-BuildingandDeployingSampleApplication"></a>Building
and Deploying Sample Application <a shape="rect" name="SimpleWebServicewithJAX-WS-configure"></a></h1>
+<h1 id="SimpleWebServicewithJAX-WS-BuildingandDeployingSampleApplicationconfigure">Building
and Deploying Sample Application <span class="confluence-anchor-link" id="SimpleWebServicewithJAX-WS-configure"></span></h1>
 
 <p>Checkout the sample source code from SVN:</p>
 
-<p><b><tt>svn checkout <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/jaxws-calculator">http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/jaxws-calculator</a>
calculator</tt></b> </p>
+<p><strong><code>svn checkout <a shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/jaxws-calculator">http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/jaxws-calculator</a>
calculator</code></strong> </p>
 
-<p>The source code will be checked out into the <b>calculator/</b> directory.
This sample code code lives in <b>calculator/jaxws-calculator-war/</b> directory.</p>
+<p>The source code will be checked out into the <strong>calculator/</strong>
directory. This sample code code lives in <strong>calculator/jaxws-calculator-war/</strong>
directory.</p>
 
-<h2><a shape="rect" name="SimpleWebServicewithJAX-WS-RequiredTools"></a>Required
Tools</h2>
+<h2 id="SimpleWebServicewithJAX-WS-RequiredTools">Required Tools</h2>
 
 <p>The tools used for developing and building the Calculator sample application are:</p>
 
-<h3><a shape="rect" name="SimpleWebServicewithJAX-WS-ApacheMaven2.0.x"></a>Apache
Maven 2.0.x</h3>
+<h3 id="SimpleWebServicewithJAX-WS-ApacheMaven2.0.x">Apache Maven 2.0.x</h3>
 
 <p><a shape="rect" class="external-link" href="http://maven.apache.org/">Apache
Maven</a> is used for building the Calculator application.</p>
 
-<h2><a shape="rect" name="SimpleWebServicewithJAX-WS-Building"></a>Building</h2>
+<h2 id="SimpleWebServicewithJAX-WS-Building">Building</h2>
 
-<h3><a shape="rect" name="SimpleWebServicewithJAX-WS-CompileSourceCode"></a>Compile
Source Code</h3>
+<h3 id="SimpleWebServicewithJAX-WS-CompileSourceCode">Compile Source Code</h3>
 
-<p>From command prompt execute the following command in the <b>calculator/jaxws-calculator-war/</b>
folder:</p>
+<p>From command prompt execute the following command in the <strong>calculator/jaxws-calculator-war/</strong>
folder:</p>
 
-<p><b><tt>mvn install</tt></b> </p>
+<p><strong><code>mvn install</code></strong> </p>
 
-<p>After the code is successfully compiled a <b>jaxws-calculator-war-2.0-SNAPSHOT.war</b>
file will be created in the <b>target/</b> subfolder.</p>
+<p>After the code is successfully compiled a <strong>jaxws-calculator-war-2.0-SNAPSHOT.war</strong>
file will be created in the <strong>target/</strong> subfolder.</p>
 
-<h2><a shape="rect" name="SimpleWebServicewithJAX-WS-Deploying"></a>Deploying</h2>
+<h2 id="SimpleWebServicewithJAX-WS-Deploying">Deploying</h2>
 
-<p>Deploy the <b>jaxws-calculator-war-2.0-SNAPSHOT.war</b> using the Geronimo
Console (<a shape="rect" class="external-link" href="http://localhost:8080/console" rel="nofollow">http://localhost:8080/console</a>):</p>
+<p>Deploy the <strong>jaxws-calculator-war-2.0-SNAPSHOT.war</strong> using
the Geronimo Console (<a shape="rect" class="external-link" href="http://localhost:8080/console"
rel="nofollow">http://localhost:8080/console</a>):</p>
 
-<ol><li>Scroll to <b>Deploy New</b> from the <b>Console Navigation</b>
panel.</li><li>Load <b>jaxws-calculator-war-2.0-SNAPSHOT.war</b> from
<b>calculator/jaxws-calculator-war/target/</b> folder in to the <b>Archive</b>
input box.</li><li>Press <b>Install</b> button to deploy application
in the server.</li></ol>
+<ol><li>Scroll to <strong>Deploy New</strong> from the <strong>Console
Navigation</strong> panel.</li><li>Load <strong>jaxws-calculator-war-2.0-SNAPSHOT.war</strong>
from <strong>calculator/jaxws-calculator-war/target/</strong> folder in to the
<strong>Archive</strong> input box.</li><li>Press <strong>Install</strong>
button to deploy application in the server.</li></ol>
 
 
-<h1><a shape="rect" name="SimpleWebServicewithJAX-WS-TestingoftheSample"></a>Testing
of the Sample <a shape="rect" name="SimpleWebServicewithJAX-WS-testing"></a></h1>
+<h1 id="SimpleWebServicewithJAX-WS-TestingoftheSampletesting">Testing of the Sample
<span class="confluence-anchor-link" id="SimpleWebServicewithJAX-WS-testing"></span></h1>
 
-<p>To test this sample service use the <b>add.jsp</b> (<a shape="rect"
class="external-link" href="http://localhost:8080/jaxws-calculator/add.jsp" rel="nofollow">http://localhost:8080/jaxws-calculator/add.jsp</a>)
to invoke the Web Service. Once the JSP page loads type in two values to add and press the
<b>Add</b> button. The result of the addition should show up below. For example:</p>
+<p>To test this sample service use the <strong>add.jsp</strong> (<a
shape="rect" class="external-link" href="http://localhost:8080/jaxws-calculator/add.jsp" rel="nofollow">http://localhost:8080/jaxws-calculator/add.jsp</a>)
to invoke the Web Service. Once the JSP page loads type in two values to add and press the
<strong>Add</strong> button. The result of the addition should show up below.
For example:</p>
 
-<p><span class="image-wrap" style=""><img src="simple-web-service-with-jax-ws.data/screenshot.png"
style="border: 0px solid black"></span></p></div>
+<p><img class="confluence-embedded-image" src="https://cwiki.apache.org/confluence/download/attachments/34685/screenshot.png?version=1&amp;modificationDate=1186140201000&amp;api=v2"
data-image-src="/confluence/download/attachments/34685/screenshot.png?version=1&amp;modificationDate=1186140201000&amp;api=v2"></p></div>
         </div>
 
         



Mime
View raw message