geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r559691 - in /geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp: WEB-INF/geronimo-web.xml WEB-INF/web.xml addResult.jsp
Date Thu, 26 Jul 2007 04:53:34 GMT
Author: linsun
Date: Wed Jul 25 21:53:34 2007
New Revision: 559691

URL: http://svn.apache.org/viewvc?view=rev&rev=559691
Log:
update the sameple to use service-ref

Modified:
    geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/geronimo-web.xml
    geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/web.xml
    geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/addResult.jsp

Modified: geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/geronimo-web.xml?view=diff&rev=559691&r1=559690&r2=559691
==============================================================================
--- geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/geronimo-web.xml
(original)
+++ geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/geronimo-web.xml
Wed Jul 25 21:53:34 2007
@@ -26,4 +26,16 @@
     </dep:moduleId>
   </dep:environment>
 
+
+ <service-ref>
+   <service-ref-name>services/Calculator</service-ref-name>
+   <port>
+      <port-name>CalculatorPort</port-name>
+      <protocol>http</protocol>
+      <host>localhost</host>
+      <port>8080</port>
+      <uri>/jaxws-calculator-war-2.0-SNAPSHOT/calculator</uri>
+   </port>
+ </service-ref>
+
 </web-app>

Modified: geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/web.xml?view=diff&rev=559691&r1=559690&r2=559691
==============================================================================
--- geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/WEB-INF/web.xml
Wed Jul 25 21:53:34 2007
@@ -38,5 +38,11 @@
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>
+
+    <service-ref>
+        <service-ref-name>services/Calculator</service-ref-name>
+        <service-interface>javax.xml.ws.Service</service-interface>
+        <wsdl-file>CalculatorService.wsdl</wsdl-file>
+    </service-ref>
 	
 </web-app>

Modified: geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/addResult.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/addResult.jsp?view=diff&rev=559691&r1=559690&r2=559691
==============================================================================
--- geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/addResult.jsp
(original)
+++ geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/src/main/webapp/addResult.jsp
Wed Jul 25 21:53:34 2007
@@ -15,12 +15,13 @@
    limitations under the License.
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
class="cell"">
-<%@ page import="java.net.URL,javax.xml.namespace.QName,javax.xml.ws.Service,org.apache.geronimo.samples.jws.Calculator"%>
+<%@ page import="javax.naming.InitialContext,javax.xml.ws.Service,org.apache.geronimo.samples.jws.Calculator"%>
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <title>  <title>Apache Geronimo Sample Application - JAX-WS Calculator Result</title>
+    <title>Apache Geronimo Sample Application - JAX-WS Calculator Result</title>
       <meta content="text/html; CHARSET=iso-8859-1" http-equiv="Content-Type">
 </head>
+
 <%
     int value1 = 0;
     int value2 = 0;
@@ -30,12 +31,9 @@
         value1 = Integer.parseInt( request.getParameter( "value1" ) );
         value2 = Integer.parseInt( request.getParameter( "value2" ) );
     
-        URL url = new URL("http://localhost:8080/jaxws-calculator-war-2.0-SNAPSHOT/calculator?wsdl");
-        QName qname = new QName("http://jws.samples.geronimo.apache.org", "Calculator");
-        Service service = Service.create(url, qname);
-        
-        Calculator calc = (Calculator)service.getPort(Calculator.class);
-        
+        InitialContext ctx = new InitialContext();
+        Service service = (Service)ctx.lookup("java:comp/env/services/Calculator");
+        Calculator calc = service.getPort(Calculator.class);         
         sum = calc.add(value1, value2);
     } catch ( Exception e ) {
         e.printStackTrace();



Mime
View raw message