geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r124263 - in geronimo/trunk/applications/magicGball/src: java/org/acme resources/ejb/META-INF resources/ejb/META-INF/wsdl
Date Wed, 05 Jan 2005 20:08:37 GMT
Author: dblevins
Date: Wed Jan  5 12:08:35 2005
New Revision: 124263

URL: http://svn.apache.org/viewcvs?view=rev&rev=124263
Log:
Whipped up a ServiceEndpoint interface, related descriptors, and JAX-RPC client for the Magic
G Ball.

Added:
   geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallEndpoint.java
   geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallJaxRpcClient.java
   geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/webservices.xml
   geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/
   geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall-mapping.xml
   geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl
Modified:
   geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java
   geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java
   geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java
   geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml

Modified: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java?view=diff&rev=124263&p1=geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java&r1=124262&p2=geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java&r2=124263
==============================================================================
--- geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java	(original)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBall.java	Wed Jan  5 12:08:35
2005
@@ -21,6 +21,6 @@
  *
  * @version $Rev: 46301 $ $Date: 2004-09-18 13:03:59 -0700 (Sat, 18 Sep 2004) $
  */
-public interface MagicGBall extends javax.ejb.EJBLocalObject {
+public interface MagicGBall extends javax.ejb.EJBObject {
 	public String ask(String question) throws java.rmi.RemoteException;
 }

Modified: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java?view=diff&rev=124263&p1=geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java&r1=124262&p2=geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java&r2=124263
==============================================================================
--- geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java	(original)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java	Wed Jan
 5 12:08:35 2005
@@ -41,8 +41,8 @@
 	public void ask(String question) throws Exception {
         Context ctx = new InitialContext();
         MagicGBallHome ejbHome = (MagicGBallHome) ctx.lookup("java:comp/env/mGball");
-        MagicGBall m8ball = ejbHome.create();
-        String answer = m8ball.ask(question);
+        MagicGBall mGball = ejbHome.create();
+        String answer = mGball.ask(question);
 
         System.out.println(answer);
 	}

Added: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallEndpoint.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallEndpoint.java?view=auto&rev=124263
==============================================================================
--- (empty file)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallEndpoint.java	Wed Jan
 5 12:08:35 2005
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.acme;
+/**
+ * ServiceEndpoint interface for Enterprise Bean: MagicGBall
+ *
+ * @version $Rev: 46301 $ $Date: 2004-09-18 13:03:59 -0700 (Sat, 18 Sep 2004) $
+ */
+public interface MagicGBallEndpoint extends java.rmi.Remote {
+	public String ask(String question) throws java.rmi.RemoteException;
+}

Modified: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java?view=diff&rev=124263&p1=geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java&r1=124262&p2=geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java&r2=124263
==============================================================================
--- geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java	(original)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallHome.java	Wed Jan 
5 12:08:35 2005
@@ -21,7 +21,7 @@
  *
  * @version $Rev: 46301 $ $Date: 2004-09-18 13:03:59 -0700 (Sat, 18 Sep 2004) $
  */
-public interface MagicGBallHome extends javax.ejb.EJBLocalHome {
+public interface MagicGBallHome extends javax.ejb.EJBHome {
 	/**
 	 * Creates a default instance of Session Bean: MagicGBall
 	 */

Added: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallJaxRpcClient.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallJaxRpcClient.java?view=auto&rev=124263
==============================================================================
--- (empty file)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallJaxRpcClient.java	Wed
Jan  5 12:08:35 2005
@@ -0,0 +1,50 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.acme;
+
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
+
+public class MagicGBallJaxRpcClient {
+    public static void main(String[] args) {
+        if (args.length < 1) {
+            System.err.println("Please ask a question");
+            System.exit(-1);
+        }
+
+        try {
+            URL wsdlURL = new URL("http://localhost:8000/services/MagicGBall?wsdl");
+            String namespaceURI = "http://acme.org/magicGball";
+            QName serviceQName = new QName(namespaceURI, "MagicGBallService");
+            QName portQName = new QName(namespaceURI, "MagicGBallPort");
+
+            ServiceFactory serviceFactory = ServiceFactory.newInstance();
+            Service service = serviceFactory.createService(wsdlURL, serviceQName);
+            MagicGBallEndpoint mGball = (MagicGBallEndpoint) service.getPort(portQName, MagicGBallEndpoint.class);
+
+            for (int i = 0; i < args.length; i++) {
+                String question = args[i];
+                String answer = mGball.ask(question);
+                System.out.println(answer);
+            }
+        } catch (Exception e) {
+            System.err.println(e.toString());
+        }
+    }
+}

Modified: geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml?view=diff&rev=124263&p1=geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml&r1=124262&p2=geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml&r2=124263
==============================================================================
--- geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml	(original)
+++ geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/ejb-jar.xml	Wed Jan
 5 12:08:35 2005
@@ -9,6 +9,7 @@
 			<remote>org.acme.MagicGBall</remote>
 			<local-home>org.acme.MagicGBallLocalHome</local-home>
 			<local>org.acme.MagicGBallLocal</local>
+			<service-endpoint>org.acme.MagicGBallEndpoint</service-endpoint>
 			<ejb-class>org.acme.MagicGBallBean</ejb-class>
 			<session-type>Stateless</session-type>
 			<transaction-type>Container</transaction-type>

Added: geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/webservices.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/webservices.xml?view=auto&rev=124263
==============================================================================
--- (empty file)
+++ geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/webservices.xml	Wed
Jan  5 12:08:35 2005
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:mgb="http://acme.org/magicGball"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
+    version="1.1">
+
+    <webservice-description>
+        <webservice-description-name>MagicGBallWebService</webservice-description-name>
+        <wsdl-file>META-INF/wsdl/MagicGBall.wsdl</wsdl-file>
+        <jaxrpc-mapping-file>META-INF/wsdl/MagicGBall-mapping.xml</jaxrpc-mapping-file>
+        <port-component>
+            <port-component-name>MagicGBall</port-component-name>
+            <wsdl-port>mgb:MagicGBallPort</wsdl-port>
+            <service-endpoint-interface>org.acme.MagicGBallEndpoint</service-endpoint-interface>
+            <service-impl-bean>
+                <ejb-link>MagicGBall</ejb-link>
+            </service-impl-bean>
+        </port-component>
+    </webservice-description>
+</webservices>

Added: geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall-mapping.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall-mapping.xml?view=auto&rev=124263
==============================================================================
--- (empty file)
+++ geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall-mapping.xml
Wed Jan  5 12:08:35 2005
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
+                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                   xmlns:wsdl="http://acme.org/magicGball"
+                   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"
+                   version="1.1">
+
+  <package-mapping>
+    <package-type>org.acme</package-type>
+    <namespaceURI>http://acme.org/magicGball</namespaceURI>
+  </package-mapping>
+</java-wsdl-mapping>

Added: geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl
Url: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl?view=auto&rev=124263
==============================================================================
--- (empty file)
+++ geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl
Wed Jan  5 12:08:35 2005
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="MagicGBallDefinition" targetNamespace="http://acme.org/magicGball"
+    xmlns:test="http://acme.org/magicGball"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+    <types/>
+
+    <message name="askRequest">
+        <part name="String_1" type="xsd:string"/>
+    </message>
+    <message name="askResponse">
+        <part name="result" type="xsd:string"/>
+    </message>
+
+    <portType name="MagicGBallType">
+        <operation name="echo" parameterOrder="String_1">
+            <input message="mgb:askRequest"/>
+            <output message="mgb:askResponse"/>
+        </operation>
+    </portType>
+
+    <binding name="MagicGBallBinding" type="mgb:MagicGBallType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+        <operation name="echo">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="http://openejb.org/test-ejb-jar"/>
+            </input>
+            <output>
+                <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="http://openejb.org/test-ejb-jar"/>
+            </output>
+        </operation>
+    </binding>
+
+    <service name="MagicGBallService">
+        <port name="MagicGBallPort" binding="mgb:MagicGBallBinding">
+            <soap:address location="http://localhost:8000/services/MagicGBall"/>
+        </port>
+    </service>
+</definitions>

Mime
View raw message