[jboss-svn-commits] JBL Code SVN: r10715 - in labs/jbossesb/trunk/product: core/listeners/src/org/jboss/soa/esb/listeners and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Apr 3 13:36:20 EDT 2007


Author: tfennelly
Date: 2007-04-03 13:36:19 -0400 (Tue, 03 Apr 2007)
New Revision: 10715

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendMessage.java
Removed:
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/lib/
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/listener.log
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendJMSMessage.java
Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/soap/JBossWSAdapter.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
   labs/jbossesb/trunk/product/samples/quickstarts/base-build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/readme.txt
Log:
Some more JBossWS changes.

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/soap/JBossWSAdapter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/soap/JBossWSAdapter.java	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/soap/JBossWSAdapter.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -22,6 +22,7 @@
 import org.jboss.soa.esb.actions.ActionPipelineProcessor;
 import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
 import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.ConfigurationException;
@@ -33,6 +34,7 @@
 import javax.xml.soap.SOAPMessage;
 import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
+import java.io.UnsupportedEncodingException;
 
 /**
  * JBoss Webservices endpoint adapter.
@@ -65,14 +67,16 @@
         ServiceEndpointManager epManager = factory.getServiceEndpointManager();
         ObjectName sepID = getServiceEndpointForDestination(epManager, jbossws_endpoint);
         ServiceEndpoint sep = epManager.getServiceEndpointByID(sepID);
+        byte[] soapMessage;
 
+        soapMessage = getSOAPMessagePayload(message);
         try {
             messageTL.set(message);
-            SOAPMessage resMessage = sep.handleRequest(null, null, new ByteArrayInputStream(message.getBody().getContents()));
+            SOAPMessage resMessage = sep.handleRequest(null, null, new ByteArrayInputStream(soapMessage));
             ByteArrayOutputStream os = new ByteArrayOutputStream();
 
             resMessage.writeTo(os);
-            message.getBody().setContents(os.toByteArray());
+            ActionUtils.setTaskObject(message, os.toByteArray());
         }
         catch (Exception ex) {
             throw new ActionProcessingException("Cannot process SOAP request", ex);
@@ -83,6 +87,23 @@
         return message;
     }
 
+    private byte[] getSOAPMessagePayload(Message message) throws ActionProcessingException {
+        byte[] soapMessage;
+        Object messagePayload = ActionUtils.getTaskObject(message);
+        if(messagePayload instanceof byte[]) {
+            soapMessage = (byte[])messagePayload;
+        } else if(messagePayload instanceof String) {
+            try {
+                soapMessage = ((String)messagePayload).getBytes("UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                throw new ActionProcessingException("Unable to decode SOAP message payload.", e);
+            }
+        } else {
+            throw new ActionProcessingException("Unable to decode SOAP message payload.  Must be either a byte[] or java.lang.String.");
+        }
+        return soapMessage;
+    }
+
     public static void setMessage(final Message message) {
         messageTL.set(message);
     }

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -144,7 +144,9 @@
                 }
                 catch (final NoSuchMethodException nsme)
                 {
-                    throw new ManagedLifecycleException("Managed instance " + classname + " does not have correct constructor") ;
+                    throw new ManagedLifecycleException("Managed instance [" + classname +
+                            "] does not have correct constructor.  This class must contain a public constructor of the form 'public " +
+                            instanceClass.getSimpleName() + "(" + ConfigTree.class.getName() + " config);'");
                 }
                 final ManagedLifecycle instance ;
                 try

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -123,7 +123,7 @@
      * @throws org.jboss.soa.esb.ConfigurationException
      *          for configuration errors during initialisation.
      */
-    protected JBossRemotingGatewayListener(ConfigTree config) throws ConfigurationException {
+    public JBossRemotingGatewayListener(ConfigTree config) throws ConfigurationException {
         super(config);
     }
 
@@ -399,7 +399,9 @@
             if(properties != null) {
                 Set<Map.Entry> propertyEntrySet = properties.entrySet();
                 for (Map.Entry entry : propertyEntrySet) {
-                    message.getProperties().setProperty(entry.toString(), entry.getValue());
+                    if(entry.getValue() != null) {
+                        message.getProperties().setProperty(entry.toString(), entry.getValue());
+                    }
                 }
             }
         }

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -25,6 +25,7 @@
 import java.util.Map;
 
 import org.jboss.internal.soa.esb.thirdparty.Base64;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
 import org.jboss.soa.esb.MarshalException;
 import org.jboss.soa.esb.UnmarshalException;
 import org.jboss.soa.esb.message.Properties;
@@ -57,12 +58,16 @@
 
 	public Object setProperty(String name, Object value)
 	{
-		if (value instanceof Serializable)
-			return _table.put(name, (Serializable) value);
-		else
-			throw new IllegalArgumentException("value must be XmlSerializable");
-	}
+        AssertArgument.isNotNull(name, "name");
+        AssertArgument.isNotNull(value, "value");
 
+        if (!(value instanceof Serializable)) {
+			throw new IllegalArgumentException("Value of property '" + name + "' must implement " + Serializable.class.getName() + ".  Value is of type " + value.getClass().getName());
+        }
+
+        return _table.put(name, (Serializable) value);
+    }
+
 	public Object remove(String name)
 	{
 		return _table.remove(name);

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -52,7 +52,7 @@
     /**
      * Factory singleton instance.
      */
-    private static CourierFactory instance;
+    private static CourierFactory instance = new CourierFactory();
 
     static
     {

Modified: labs/jbossesb/trunk/product/samples/quickstarts/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/base-build.xml	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/base-build.xml	2007-04-03 17:36:19 UTC (rev 10715)
@@ -8,8 +8,8 @@
     <property name="classes" value="build/classes" />
 
 	<path id="compile-classpath">
-		<fileset dir="lib" includes="*.jar" /> <!-- Quickstart Specific Jars. -->
-		<fileset dir="../../../lib/ext" includes="*.jar" /> <!-- Product Dependencies. -->
+        <path refid="quickstart-dependencies-classpath" />
+        <fileset dir="../../../lib/ext" includes="*.jar" /> <!-- Product Dependencies. -->
 		<fileset dir="${esb.product.lib.dir}" includes="*.jar" /> <!-- Product Jars. -->
 	</path>
 	<path id="exec-classpath">
@@ -19,8 +19,11 @@
 		<path refid="compile-classpath" />
 		<fileset dir="${jbosshome.dir}/server/default/lib" includes="jboss-j2ee.jar" /> <!-- Required for JMS Client Code. -->
 	</path>
+    <path id="quickstart-dependencies-classpath">
+        <fileset dir="lib" includes="*.jar" /> <!-- Quickstart Specific Jars. -->
+    </path>
 
-	<target name="compile" depends="clean">
+    <target name="compile" depends="clean">
 		<mkdir dir="${classes}" />
 		<javac srcdir="src" destdir="${classes}">
 			<classpath refid="compile-classpath" />

Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/build.xml	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/build.xml	2007-04-03 17:36:19 UTC (rev 10715)
@@ -5,6 +5,10 @@
     <!-- Import the base Ant build script... -->
     <import file="../base-build.xml"/>
 
+    <path id="quickstart-dependencies-classpath">
+        <fileset dir="${jbosshome.dir}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
+    </path>
+
     <target name="quickstart-specific-assemblies" depends="assert-ws-available">
         <!-- Overriden from the target of the same name in base-build.xml. -->
         <!-- Called by the "deploy" target.  Don't call directly!! -->
@@ -19,24 +23,35 @@
     </target>
 
     <target name="runtest">
-        <antcall target="saygoodbye_01" />
-        <antcall target="saygoodbye_02" />
+        <antcall target="saygoodbye_over_jms" />
+        <antcall target="saygoodbye_over_http" />
+        <antcall target="saygoodbye_over_socket" />
     </target>
 
-    <target name="saygoodbye_01" depends="compile">
-        <echo>Invoking a JBossWS Endpoint that will issue a response.</echo>
-        <java fork="yes" classname="quickstart.webservice_jbossws_adapter_01.test.SendJMSMessage" failonerror="true">
-            <arg value="01" />
+    <target name="saygoodbye_over_jms" depends="compile">
+        <echo>Invoking a JBossWS Endpoint over JMS (via JBoss ESB).</echo>
+        <java fork="yes" classname="quickstart.webservice_jbossws_adapter_01.test.SendMessage" failonerror="true">
+            <arg value="jms" />
             <classpath refid="exec-classpath" />
         </java>
     </target>
 
-    <target name="saygoodbye_02" depends="compile">
-        <echo>Invoking a JBossWS Endpoint that will NOT issue a response.</echo>
-        <java fork="yes" classname="quickstart.webservice_jbossws_adapter_01.test.SendJMSMessage" failonerror="true">
-            <arg value="02" />
+    <target name="saygoodbye_over_http" depends="compile">
+        <echo>Invoking a JBossWS Endpoint over HTTP (via JBoss ESB).</echo>
+        <java fork="yes" classname="quickstart.webservice_jbossws_adapter_01.test.SendMessage" failonerror="true">
+            <arg value="http" />
+            <arg value="8765" />
             <classpath refid="exec-classpath" />
         </java>
     </target>
 
+    <target name="saygoodbye_over_socket" depends="compile">
+        <echo>Invoking a JBossWS Endpoint over a raw socket connection (via JBoss ESB).</echo>
+        <java fork="yes" classname="quickstart.webservice_jbossws_adapter_01.test.SendMessage" failonerror="true">
+            <arg value="socket" />
+            <arg value="8888" />
+            <classpath refid="exec-classpath" />
+        </java>
+    </target>
+
 </project>
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jboss-esb.xml	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jboss-esb.xml	2007-04-03 17:36:19 UTC (rev 10715)
@@ -9,31 +9,45 @@
                       jndi-URL="localhost">
 
             <jms-bus busid="quickstartGwChannel">
-                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_jbossws_adapter_01_gw" />
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_jbossws_adapter_01_gw"/>
             </jms-bus>
             <jms-bus busid="quickstartEsbChannel">
-                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_jbossws_adapter_01_esb" />
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_jbossws_adapter_01_esb"/>
             </jms-bus>
+        </jms-provider>
 
-        </jms-provider>
+        <jbr-provider name="JBR-Http" protocol="http" host="localhost">
+            <jbr-bus busid="Http-1" port="8765" />
+        </jbr-provider>
+
+        <jbr-provider name="JBR-Socket" protocol="socket" host="localhost">
+            <jbr-bus busid="Socket-1" port="8888" />
+        </jbr-provider>
+
     </providers>
 
     <services>
 
         <service category="MyServiceCategory" name="MyService" description="WS Frontend speaks natively to the ESB">
+
             <listeners>
-                <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel" is-gateway="true" maxThreads="1" />
-                <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" maxThreads="1" />
+                <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel" is-gateway="true" maxThreads="1"/>
+                <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
+                <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true" maxThreads="1"/>
+
+                <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" maxThreads="1"/>
             </listeners>
             <actions>
                 <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message" value="[Quickstart_webservice_jbossws_adapter_01] Message before invoking jbossws endpoint" />
+                    <property name="message"
+                              value="[Quickstart_webservice_jbossws_adapter_01] Message before invoking jbossws endpoint"/>
                 </action>
                 <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.JBossWSAdapter">
-                    <property name="jbossws-endpoint" value="GoodbyeWorldWS" />
+                    <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
                 </action>
                 <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message" value="[Quickstart_webservice_jbossws_adapter_01] Message after invoking jbossws endpoint" />
+                    <property name="message"
+                              value="[Quickstart_webservice_jbossws_adapter_01] Message after invoking jbossws endpoint"/>
                 </action>
             </actions>
         </service>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jbossesb-properties.xml	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jbossesb-properties.xml	2007-04-03 17:36:19 UTC (rev 10715)
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  JBoss, Home of Professional Open Source
-  Copyright 2006, JBoss Inc., and others contributors as indicated 
-  by the @authors tag. All rights reserved. 
-  See the copyright.txt in the distribution for a
-  full listing of individual contributors. 
-  This copyrighted material is made available to anyone wishing to use,
-  modify, copy, or redistribute it subject to the terms and conditions
-  of the GNU Lesser General Public License, v. 2.1.
-  This program is distributed in the hope that it will be useful, but WITHOUT A 
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
-  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
-  You should have received a copy of the GNU Lesser General Public License,
-  v.2.1 along with this distribution; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-  MA  02110-1301, USA.
-  
-  (C) 2005-2006,
-  @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
-  These options are described in the JBossESB manual.
-  Defaults are provided here for convenience only.
- 
-  Please read through this file prior to using the system, and consider
-  updating the specified entries.
--->
-<esb
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
-    <properties name="core">
-		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
-		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
-		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
-    </properties>
-    <properties name="registry">      
-    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
-    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
-    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
-    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
-    	<property name="org.jboss.soa.esb.registry.implementationClass" 
-    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.factoryClass" 
-    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.user" 
-    		value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.registry.password" 
-    	  value="password"/>
-    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
-    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
-    		value="org.apache.ws.scout.transport.RMITransport"/>
-    </properties>
-    <properties name="transports" depends="core">
-    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
-    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
-    </properties>
-    <properties name="connection">
-    	<property name="min-pool-size" value="5"/>
-    	<property name="max-pool=size" value="10"/>
-    	<property name="blocking-timeout-millis" value="5000"/>
-    	<property name="abandoned-connection-timeout" value="10000"/>
-    	<property name="abandoned-connection-time-interval" value="30000"/>
-    </properties>
-    <properties name="dbstore">
-		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
-		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
-		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
-		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
-		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
-		<!--table managed by pool to test for valid connections - created by pool automatically -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
-		<!-- # of milliseconds to timeout waiting for a connection from pool -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
-    </properties>
-    <properties name="messagerouting">
-    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
-    </properties>
-</esb>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jndi.properties	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/jndi.properties	2007-04-03 17:36:19 UTC (rev 10715)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/juddi.properties	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/juddi.properties	2007-04-03 17:36:19 UTC (rev 10715)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/listener.log
===================================================================

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/log4j.xml	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/log4j.xml	2007-04-03 17:36:19 UTC (rev 10715)
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Log4j Configuration                                                  -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
-   | For more configuration infromation and examples see the Jakarta Log4j
-   | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
-
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Message\n -->
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
-      </layout>
-   </appender>
-
-   <!-- ================================= -->
-   <!-- Preserve messages in a local file -->
-   <!-- ================================= -->
-
-   <!-- A size based file rolling appender -->
-   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <param name="File" value="./listener.log"/>
-     <param name="Append" value="false"/>
-     <param name="MaxFileSize" value="500KB"/>
-     <param name="MaxBackupIndex" value="1"/>
-
-     <layout class="org.apache.log4j.PatternLayout">
-       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
-     </layout>	    
-   </appender>
-
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <category name="org.jboss">
-      <priority value="WARN"/>
-   </category>
-   <category name="org.jboss.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.jboss.internal.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.apache">
-      <priority value="ERROR"/>
-   </category>
-   <category name="quickstart">
-      <priority value="INFO"/>
-   </category>
-   <!-- ======================= -->
-   <!-- Setup the Root category -->
-   <!-- ======================= -->
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-      <appender-ref ref="FILE"/>
-   </root>
-
-</log4j:configuration>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/readme.txt	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/readme.txt	2007-04-03 17:36:19 UTC (rev 10715)
@@ -1,10 +1,8 @@
 Overview:
 =========
-    This example demonstrates how to develop and host a 181 Web Service on 
-    the JBoss Application Server. This Web Service is then used to make a
-    synchronous call into the ESB.
-  
+   TODO
 
+
 Before Running:
 ===============
 1. Update the "jbosshome.dir" property in the quickstarts.properties file in "../".
@@ -14,39 +12,10 @@
 3. Make sure the JBoss Application server is running.
 
 
-
 To Run:
 =======
 1. In the first command window, execute "ant".  This will compile the project, build
-the needed jars and deploy the WAR component to the Application Server.  If you are 
+the needed jars and deploy the ESB archive component to the Application Server.  If you are 
 monitoring the Application Server console you will see it hot deploy the WAR.
 
-2. Using a browser, hit the following URL: "http://localhost:8080/jbossws".
-
-You should see something like the following:
-------------------------------------------------------------------------------------------
-|   jboss.ws:di=quickstartWAR1.war,port=HelloWorldPort,service=HelloWorldWSService       |
-|   http://yourMachineName:8080/quickstartWAR1/HelloWorldWS?wsdl                         |
-------------------------------------------------------------------------------------------
-
-3. Use for favorite Web Service testing tool to invoke the Web Service. A great one
-is called SoapUI at www.soapui.org.  
-
-The ESB console should produce the following messages:
-
-     [java] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-     [java] Body: Your Name
-     [java] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-
-
-     [java] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-     [java] Body: Hello From ESB MyAction: Your Name
-     [java] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-
-The AS console should produce the following message:
-     22:47:30,531 INFO  [STDOUT] I'm Hit! Your Name  
-
-This assumes you put in "Your Name" as the parameter in your WS client testing tool.
-     
-     
-    
\ No newline at end of file
+2. Run "ant runtest". 
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendJMSMessage.java	2007-04-03 16:04:30 UTC (rev 10714)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendJMSMessage.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package quickstart.webservice_jbossws_adapter_01.test;
-
-import org.jboss.internal.soa.esb.util.StreamUtils;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-public class SendJMSMessage {
-    QueueConnection conn;
-    QueueSession session;
-    Queue que;
-    
-    
-    public void setupConnection() throws JMSException, NamingException
-    {
-    	InitialContext iniCtx = new InitialContext();
-    	Object tmp = iniCtx.lookup("ConnectionFactory");
-    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
-    	conn = qcf.createQueueConnection();
-    	que = (Queue) iniCtx.lookup("queue/quickstart_webservice_jbossws_adapter_01_gw");
-    	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
-    	conn.start();
-    }
-    
-    public void stop() throws JMSException 
-    { 
-        conn.stop();
-        session.close();
-        conn.close();
-    }
-    
-    public void sendMessage(String messageNum) throws JMSException {
-    	
-        QueueSender send = session.createSender(que);
-        String msg = new String(StreamUtils.readStream(getClass().getResourceAsStream("soap_message_" + messageNum + ".xml")));
-        ObjectMessage tm = session.createObjectMessage(msg);
-
-        send.send(tm);
-        send.close();
-    }
-       
-    
-    public static void main(String args[]) throws Exception
-    {        	    	
-    	SendJMSMessage sm = new SendJMSMessage();
-    	sm.setupConnection();
-    	sm.sendMessage(args[0]); 
-    	sm.stop();
-    	
-    }
-    
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendMessage.java (from rev 10694, labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendMessage.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendMessage.java	2007-04-03 17:36:19 UTC (rev 10715)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package quickstart.webservice_jbossws_adapter_01.test;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Client;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.net.InetAddress;
+
+public class SendMessage {
+    QueueConnection conn;
+    QueueSession session;
+    Queue que;
+
+    public void sendMessageOverJMS(String message) throws JMSException, NamingException {
+        QueueSender sender = null;
+
+    	setupJMSConnection();
+        try {
+            ObjectMessage tm = null;
+
+            sender = session.createSender(que);
+            tm = session.createObjectMessage(message);
+            sender.send(tm);
+        } finally {
+            if(sender != null) {
+                sender.close();
+            }
+            cleanupJMSConnection();
+        }
+    }
+
+    private void sendMessageToJBRListener(String protocol, int port, String message) throws Throwable {
+        String locatorURI = protocol + "://localhost:" + port;
+        InvokerLocator locator = new InvokerLocator(locatorURI);
+        System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);
+
+        Client remotingClient = null;
+        try {
+            remotingClient = new Client(locator);
+            remotingClient.connect();
+
+            // Deliver the message to the listener...
+            Object response = remotingClient.invoke(message);
+            System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");
+        } finally {
+            if(remotingClient != null) {
+                remotingClient.disconnect();
+            }
+        }
+    }
+
+    public void setupJMSConnection() throws JMSException, NamingException
+    {
+    	InitialContext iniCtx = new InitialContext();
+    	Object tmp = iniCtx.lookup("ConnectionFactory");
+    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+    	conn = qcf.createQueueConnection();
+    	que = (Queue) iniCtx.lookup("queue/quickstart_webservice_jbossws_adapter_01_gw");
+    	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+    	conn.start();
+    }
+
+    public void cleanupJMSConnection() throws JMSException
+    {
+        conn.stop();
+        session.close();
+        conn.close();
+    }
+
+    private static String getMessage(String messageNum) {
+        String msg = new String(StreamUtils.readStream(SendMessage.class.getResourceAsStream("soap_message_" + messageNum + ".xml")));
+        return msg;
+    }
+
+    public static void main(String args[]) throws Throwable
+    {        	    	
+    	SendMessage sm = new SendMessage();
+        String msg = getMessage("01");
+
+        String protocol = args[0];
+        if(protocol.equals("jms")) {
+            sm.sendMessageOverJMS(msg);
+        } else {
+            sm.sendMessageToJBRListener(protocol, Integer.parseInt(args[1]), msg);
+        }
+    }
+}
\ No newline at end of file


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_jbossws_adapter_01/src/quickstart/webservice_jbossws_adapter_01/test/SendMessage.java
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the jboss-svn-commits mailing list