[jboss-svn-commits] JBL Code SVN: r27138 - in labs/jbossesb/workspace/dward/wsproxy/product: samples/quickstarts/webservice_wsproxy_basic and 25 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jun 25 16:24:03 EDT 2009


Author: dward
Date: 2009-06-25 16:24:02 -0400 (Thu, 25 Jun 2009)
New Revision: 27138

Added:
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbm-queue-service.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbmq-queue-service.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbossesb-properties.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jndi.properties
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/juddi.properties
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/lib/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/ext/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/ext/jbossws-client.jar
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/classes/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/lib/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/view/
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp
   labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/
   labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java
   labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
   labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java
Log:
initial addition of wsproxy work


Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,86 @@
+<project name="Quickstart_webservice_wsproxy_basic" default="deploy" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+
+    <property name="additional.deploys" value="wsproxy_basic-wsdl-transform.xml" />
+
+	<!-- Import the base Ant build script... -->
+    <import file="../conf/base-build.xml"/>
+
+    <property name="war.build.dir" location="${build.dir}/war/classes"/>
+
+    <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+    <target name="quickstart-specific-assemblies" depends="makewar"/>
+
+    <target name="quickstart-specific-predeploys">
+		<copy todir="${org.jboss.esb.server.deploy.dir}"
+			file="build/predeploy/${ant.project.name}.war"/>
+		<sleep seconds="3"/>
+	</target>
+
+    <target name="quickstart-specific-undeploys">
+		<delete file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
+	</target>
+
+    <target name="makewar" description="make war">
+        <!-- Compile... -->
+        <mkdir dir="${war.build.dir}" />
+        <javac srcdir="war/src" destdir="${war.build.dir}" debug="true">
+            <classpath>
+                <path refid="compile-classpath" />
+                <fileset dir="war/lib/ext" includes="*.jar" />
+            </classpath>
+        </javac>
+
+        <!-- War... -->
+		<mkdir dir="build/predeploy"/>
+        <war warfile="build/predeploy/${ant.project.name}.war"
+             webxml="${basedir}/war/resources/WEB-INF/web.xml">
+            <webinf dir="${basedir}/war/resources/WEB-INF">
+                <include name="jboss-web.xml"/>
+            </webinf>
+            <classes dir="${war.build.dir}" includes="**/*.class"/>
+            <fileset dir="${basedir}/war/view">
+                <include name="**/*"/>
+            </fileset>
+            <classes dir="${basedir}">
+                <include name="juddi.properties"/>
+            </classes>
+        </war>
+    </target>
+
+    <target name="deploy-war" depends="prepare-deployment">
+        <copy todir="${org.jboss.esb.server.deploy.dir}"
+            file="${build.dir}/${ant.project.name}.war"/>
+    </target>
+
+    <target name="undeploy-war" depends="dependencies">
+        <delete verbose="true" quiet="true"
+          file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
+    </target>
+
+	<target name="runinternal" depends="compile">
+	    <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage" failonerror="true">
+			<arg value="${runtest.arg.url}"/>
+	    	<arg value="${user.name}"/>
+			<classpath refid="exec-classpath"/>
+	    </java>
+	 </target>  
+
+	<target name="rundirect">
+		<echo>Calling JBossWS webservice directly.</echo>
+		<property name="runtest.arg.url" value="http://127.0.0.1:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"/>
+		<antcall target="runinternal"/>
+	</target>
+
+	<target name="runtest">
+		<echo>Calling JBossWS webservice via WSProxy.</echo>
+		<property name="runtest.arg.url" value="http://127.0.0.1:8765"/>
+		<antcall target="runinternal"/>
+	</target>
+
+</project>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_basic_esb</depends>
+</jbossesb-deployment>
+


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbm-queue-service.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_basic_esb"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_basic_esb_reply"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+</server>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbm-queue-service.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbmq-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbmq-queue-service.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_basic_esb">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_basic_esb_reply">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+</server>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbmq-queue-service.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,49 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd" parameterReloadSecs="5">
+
+	<providers>
+		<jbr-provider name="JBR-Http" protocol="http" host="localhost">
+			<jbr-bus busid="Http-1" port="8765"/>
+		</jbr-provider>
+		<jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+			<jms-bus busid="quickstartEsbChannel">
+				<jms-message-filter
+					dest-type="QUEUE"
+					dest-name="queue/quickstart_webservice_wsproxy_basic_esb"
+				/>
+			</jms-bus>
+		</jms-provider>
+	</providers>
+
+	<services>
+		<service category="WebService" name="WSProxy_Basic"
+				 description="Basic WebService Proxy" >
+			<listeners>
+				<jbr-listener name="Http-Gateway"
+					busidref="Http-1"
+					is-gateway="true"
+				/>
+				<jms-listener name="JMS-ESBListener"
+					busidref="quickstartEsbChannel"
+				/>
+			</listeners>
+			<actions mep="RequestResponse">
+				<action name="echo-request"
+						class="org.jboss.soa.esb.actions.SystemPrintln"
+				/>
+				<action name="wsproxy"
+						class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+						<property name="wsdl" value="http://127.0.0.1:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS?wsdl"/>
+						<!-- tcpmon testing -->
+						<!--
+						<property name="endpointUrl" value="http://127.0.0.1:8888/Quickstart_webservice_wsproxy_basic/HelloWorldWS"/>
+						-->
+				</action>
+				<action name="echo-response"
+						class="org.jboss.soa.esb.actions.SystemPrintln"
+				/>
+			</actions>
+		</service>
+	</services>
+
+</jbossesb>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbossesb-properties.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,86 @@
+<?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$ -->
+<!--
+  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"/>
+        <property name="jboss.esb.invm.scope.default" value="NONE"/>
+    </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/"/>
+		<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"/> 
+                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jbossesb-properties.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jndi.properties
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jndi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jndi.properties	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,5 @@
+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
+


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/jndi.properties
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/juddi.properties
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/juddi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/juddi.properties	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,69 @@
+# 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
+  


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/juddi.properties
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id$ -->
+
+<!--
+   | 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>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,34 @@
+Overview:
+=========
+	This example demonstrates how to consume a 181 Web Service via an ESB SOAPProxy action.
+    This ESB will make a webservice request that requires a single "toWhom" string parameter.
+    The webservice will return a greeting response. The ESB simply dislays the response on the 
+    console.  
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+  1. In a command terminal window in the quickstart folder type
+     'ant deploy-jms-dests'.
+  2. In a command terminal window in this folder ("Window1"), type 'ant run'.
+  3. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  4. Switch back to "Window1" to see the output from the ESB
+  5. When finished, interrupt the ESB using Ctrl-C and, in this folder
+     ("Window1"), type 'ant undeploy-jms-dests'.
+
+To Run '.esb' archive mode:
+===========================
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+  2. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  3. Switch back to Application Server console to see the output from the ESB
+  4. In this folder ("Window1"), type 'ant undeploy'.
+
+Project file descriptions:
+==========================
+	TODO


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,90 @@
+/*
+ * 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-2009
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test;
+
+import java.io.InputStream;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+
+/**
+ * @author dward at jboss.org
+ */
+public class SendWSMessage
+{
+	
+	private static final String SOAP_PRE =
+		"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:hel=\"http://webservice_wsproxy_basic/helloworld\">\n" +
+		"   <soapenv:Header/>\n" +
+		"   <soapenv:Body>\n" +
+		"      <hel:sayHello>\n" +
+		"         <toWhom>";
+	
+	private static final String SOAP_POST =
+		         "</toWhom>\n" +
+		"      </hel:sayHello>\n" +
+		"   </soapenv:Body>\n" +
+		"</soapenv:Envelope>";
+	
+	// product/samples/quickstarts/webservice_wsproxy_basic/build.xml - see ant targets: "rundirect" and "runtest"
+	public static void main(String... args) throws Exception
+	{
+		if (args.length < 2)
+		{
+			// for testing main method from Eclipse (ant passes these in)
+			args = new String[]{"http://127.0.0.1:8765", System.getProperty("user.name")};
+		}
+		
+		String url = args[0];
+		System.out.println("****  REQUEST  URL: " + url);
+		PostMethod method = new PostMethod(url);
+		
+		// either or neither of the following two lines can be used
+		method.setRequestHeader("SOAPAction", "\"\"");
+		//method.setRequestHeader("SOAPAction", "\"sayHello\"");
+		
+		String request = SOAP_PRE + args[1] + SOAP_POST;
+		System.out.println("****  REQUEST BODY: " + request);
+		method.setRequestEntity( new StringRequestEntity(request) );
+		
+		HttpClient client = new HttpClient();
+		InputStream response = null;
+		try
+		{
+			int code = client.executeMethod(method);
+			System.out.println("**** RESPONSE CODE: " + code);
+			
+			response = method.getResponseBodyAsStream();
+			byte[] bytes = StreamUtils.readStream(response);
+			System.out.println("**** RESPONSE BODY: " + new String(bytes, method.getResponseCharSet()));
+		}
+		finally
+		{
+			method.releaseConnection();
+			if (response != null)
+			{
+				response.close();
+			}
+		}
+	}
+
+}


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/ext/jbossws-client.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/ext/jbossws-client.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">  
+  <servlet> 
+    <servlet-name>HelloWorldWS</servlet-name>  
+    <servlet-class>org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.HelloWorldWS</servlet-class>  
+  </servlet>  
+  
+  <servlet-mapping> 
+    <servlet-name>HelloWorldWS</servlet-name>  
+    <url-pattern>/HelloWorldWS</url-pattern> 
+  </servlet-mapping>   
+  
+</web-app>


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,40 @@
+/*
+ * 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-2009
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+/**
+ * @author dward at jboss.org
+ */
+ at WebService(name = "HelloWorld", targetNamespace = "http://webservice_wsproxy_basic/helloworld")
+public class HelloWorldWS
+{
+	
+	@WebMethod
+	public String sayHello(@WebParam(name = "toWhom") String toWhom)
+	{
+		String greeting = "Hello World Greeting for '" + toWhom + "' on " + new java.util.Date();
+		return greeting;
+	}
+	
+}


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,9 @@
+<html>
+	<body>
+		This is just a place holder.<br>
+		Verify the that the WS has been deployed by hitting 
+			<a href="http://localhost:8080/jbossws">
+				http://localhost:8080/jbossws
+			</a>
+  </body>
+</html>	
\ No newline at end of file


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,86 @@
+/*
+ * 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-2009
+ */
+package org.jboss.soa.esb.actions.soap.proxy;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.routing.http.HttpRouter;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * @author dward at jboss.org
+ */
+class HttpSOAPProxyTransport extends SOAPProxyTransport
+{
+	
+	private static Logger logger = Logger.getLogger(HttpSOAPProxyTransport.class);
+	
+	private String endpointAddress;
+	private HttpRouter router;
+	
+	HttpSOAPProxyTransport(ConfigTree config, String defaultEndpointAddress) throws ConfigurationException
+	{
+		ConfigTree cloned_config = config.cloneObj();
+		setAttribute(cloned_config, "MappedHeaderList", "SOAPAction, Content-Type, Accept");
+		setAttribute(cloned_config, "method", "POST");
+		setAttribute(cloned_config, "responseType", "STRING");
+		endpointAddress = setAttribute(cloned_config, "endpointUrl", defaultEndpointAddress);
+		router = new HttpRouter(cloned_config);
+	}
+	
+	public String getEndpointAddress()
+	{
+		return endpointAddress;
+	}
+	
+	public void initialise() throws ActionLifecycleException
+	{
+		router.initialise();
+	}
+	
+	public Message process(Message message) throws ActionProcessingException
+	{
+		return router.process(message);
+	}
+	
+	public void destroy() throws ActionLifecycleException
+	{
+		router.destroy();
+	}
+	
+	private String setAttribute(ConfigTree config, String name, String defaultValue)
+	{
+		String value = config.getAttribute(name);
+		if (value == null)
+		{
+			value = defaultValue;
+			config.setAttribute(name, value);
+		}
+		if ( logger.isDebugEnabled() )
+		{
+			logger.debug(name + ": " + value);
+		}
+		return value;
+	}
+	
+}


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,274 @@
+/*
+ * 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-2009
+ */
+package org.jboss.soa.esb.actions.soap.proxy;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.publish.Publish;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.soap.WsdlContractPublisher;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+import org.jboss.ws.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * @author dward at jboss.org
+ */
+ at Publish(WsdlContractPublisher.class)
+public class SOAPProxy extends AbstractActionPipelineProcessor
+{
+	
+	private static Logger logger = Logger.getLogger(SOAPProxy.class);
+	
+	private MessagePayloadProxy payloadProxy;
+	
+	private Map<String,String> soapaction_to_binding = new HashMap<String,String>();
+	private Map<String,String> operation_to_binding = new HashMap<String,String>();
+	private Map<String,SOAPProxyTransport> binding_to_transport = new HashMap<String,SOAPProxyTransport>();
+	
+	public SOAPProxy(ConfigTree config) throws ConfigurationException
+	{
+		payloadProxy = new MessagePayloadProxy(config);
+		String wsdl = config.getRequiredAttribute("wsdl");
+		URL wsdl_url;
+		try
+		{
+			wsdl_url = new URL( wsdl.trim() );
+		}
+		catch (MalformedURLException mue)
+		{
+			throw new ConfigurationException(mue);
+		}
+		WSDLDefinitionsFactory wsdl_def_fact = WSDLDefinitionsFactory.newInstance();
+		WSDLDefinitions wsdl_def = wsdl_def_fact.parse(wsdl_url);
+		for ( WSDLBinding wsdl_bind : wsdl_def.getBindings() )
+		{
+			for ( WSDLBindingOperation wsdl_bind_oper : wsdl_bind.getOperations() )
+			{
+				String binding = wsdl_bind_oper.getWsdlBinding().getName().getLocalPart();
+				if (binding != null)
+				{
+					String soapaction = wsdl_bind_oper.getSOAPAction();
+					if (soapaction != null)
+					{
+						// TODO: do SOAPActions always have quotes around them?
+						soapaction = '"' + soapaction + '"';
+						soapaction_to_binding.put(soapaction, binding);
+						if ( logger.isInfoEnabled() )
+						{
+							logger.info("mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
+						}
+					}
+					String operation = wsdl_bind_oper.getRef().getLocalPart();
+					if (operation != null)
+					{
+						operation_to_binding.put(operation, binding);
+						if ( logger.isInfoEnabled() )
+						{
+							logger.info("mapped operation [" + operation + "] to binding [" + binding + "]");
+						}
+					}
+				}
+			}
+		}
+		for ( WSDLService wsdl_svc : wsdl_def.getServices() )
+		{
+			for ( WSDLEndpoint wsdl_end : wsdl_svc.getEndpoints() )
+			{
+				String binding = wsdl_end.getBinding().getLocalPart();
+				SOAPProxyTransport transport = null;
+				String endpointAddress = wsdl_end.getAddress();
+				if ( endpointAddress.toLowerCase().startsWith("http") )
+				{
+					transport = new HttpSOAPProxyTransport(config, endpointAddress);
+				}
+				// else if jms ...
+				if (transport != null)
+				{
+					binding_to_transport.put(binding, transport);
+					if ( logger.isInfoEnabled() )
+					{
+						logger.info("mapped binding [" + binding + "] to transport [" + transport.getClass().getName() + "] with endpoint address: [" + transport.getEndpointAddress() + "]");
+					}
+				}
+				else
+				{
+					if ( logger.isEnabledFor(Level.WARN) )
+					{
+						logger.warn("could not map binding [" + binding + "] to transport with endpoint address: [" + endpointAddress + "]");
+					}
+				}
+			}
+		}
+	}
+	
+	public void initialise() throws ActionLifecycleException
+	{
+		for ( SOAPProxyTransport transport : binding_to_transport.values() )
+		{
+			transport.initialise();
+		}
+	}
+
+	public Message process(Message message) throws ActionProcessingException
+	{
+		String soapaction = (String)message.getProperties().getProperty("soapaction");
+		String binding = (soapaction != null) ? soapaction_to_binding.get(soapaction) : null;
+		String operation = null;
+		if (binding == null)
+		{
+			operation = getOperation(message);
+			binding = (operation != null) ? operation_to_binding.get(operation) : null;
+		}
+		SOAPProxyTransport transport = (binding != null) ? binding_to_transport.get(binding) : null;
+		if (transport == null)
+		{
+			throw new ActionProcessingException("null transport for soapaction [" + soapaction + "], operation [" + operation + "], binding [" + binding + "]");
+		}
+		else
+		{
+			if ( logger.isDebugEnabled() )
+			{
+				logger.debug("using transport [" + transport.getClass().getName() + "] with endpoint address: [" + transport.getEndpointAddress() + "] for binding [" + binding + "]");
+			}
+			return transport.process(message);
+		}
+	}
+	
+	public void destroy() throws ActionLifecycleException
+	{
+		for ( SOAPProxyTransport transport : binding_to_transport.values() )
+		{
+			transport.destroy();
+		}
+	}
+	
+	private String getOperation(Message message) throws ActionProcessingException
+	{
+		Object payload;
+		try
+		{
+			payload = payloadProxy.getPayload(message);
+		}
+		catch (MessageDeliverException mde)
+		{
+			throw new ActionProcessingException(mde);
+		}
+		InputSource is = null;
+		if (payload instanceof byte[])
+		{
+			is = new InputSource( new ByteArrayInputStream((byte[])payload) );
+		}
+		else if (payload instanceof String)
+		{
+			is = new InputSource( new StringReader((String)payload) );
+		}
+		else
+		{
+			throw new ActionProcessingException( "unsupported payload type: " + payload.getClass().getName() );
+		}
+		String operation = null;
+		ContentHandler ch = new OperationFinder();
+		try
+		{
+			XMLReader xr = XMLReaderFactory.createXMLReader();
+			xr.setContentHandler(ch);
+			xr.parse(is);
+		}
+		catch (SAXException saxe)
+		{
+			throw new ActionProcessingException(saxe);
+		}
+		catch (IOException ioe)
+		{
+			throw new ActionProcessingException(ioe);
+		}
+		catch (OperationFinder.OperationFound of)
+		{
+			operation = of.operation;
+		}
+		return operation;
+	}
+	
+	private class OperationFinder extends DefaultHandler
+	{
+		
+		private boolean insideEnvelope = false;
+		private boolean insideBody = false;
+		
+		@Override
+		public void startElement(String uri, String localName, String qName, Attributes atts)
+		{
+			if ( localName.equals("Envelope") )
+			{
+				insideEnvelope = true;
+			}
+			else if ( localName.equals("Body") )
+			{
+				insideBody = true;
+			}
+			else if (insideEnvelope && insideBody)
+			{
+				// stop parsing as soon as possible!
+				throw new OperationFound(localName);
+			}
+		}
+		
+		@SuppressWarnings("serial")
+		private class OperationFound extends RuntimeException
+		{
+			
+			private String operation;
+			
+			private OperationFound(String operation)
+			{
+				this.operation = operation;
+			}
+			
+		}
+		
+	}
+
+}


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java	                        (rev 0)
+++ labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java	2009-06-25 20:24:02 UTC (rev 27138)
@@ -0,0 +1,32 @@
+/*
+ * 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-2009
+ */
+package org.jboss.soa.esb.actions.soap.proxy;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+
+/**
+ * @author dward at jboss.org
+ */
+abstract class SOAPProxyTransport extends AbstractActionPipelineProcessor
+{
+	
+	public abstract String getEndpointAddress();
+	
+}


Property changes on: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native




More information about the jboss-svn-commits mailing list