[jboss-svn-commits] JBL Code SVN: r27482 - in labs/jbossesb/trunk/product: samples/quickstarts/conf and 71 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jul 3 05:54:16 EDT 2009
Author: dward
Date: 2009-07-03 05:54:15 -0400 (Fri, 03 Jul 2009)
New Revision: 27482
Added:
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/lib/ext/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/classes/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/view/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/WSProxy_Routed_Rules.drl
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/test/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/test/SendWSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/lib/ext/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/classes/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/web.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/GoodbyeWS.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/HelloWS.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/view/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/view/index.jsp
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_RequestTransform.xsl
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_WsdlTransform.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/test/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/test/SendWSMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/lib/ext/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/classes/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/lib/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/web.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/InvoicingWS.java
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/view/
labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/view/index.jsp
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyWsdlContractPublisher.java
Modified:
labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
Log:
Implemented SOAPProxy: JBESB-2672
Modified: labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml 2009-07-03 09:09:50 UTC (rev 27481)
+++ labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -485,7 +485,7 @@
</qsjava>
</target>
- <target name="deploy" depends="prepare-deployment, check-exploded, deploy-esb, deploy-exploded-esb, quickstart-specific-deploys, display-instructions">
+ <target name="deploy" depends="prepare-deployment, quickstart-specific-predeploys, check-exploded, deploy-esb, deploy-exploded-esb, quickstart-specific-deploys, display-instructions">
<description>deploy will deploy the Quickstart .esb archive to JBoss ESB Server
</description>
</target>
@@ -732,6 +732,10 @@
<echo message="No Quickstart specific assembly tasks." />
</target>
+ <target name="quickstart-specific-predeploys">
+ <echo message="No Quickstart specific predeployments being made." />
+ </target>
+
<target name="quickstart-specific-deploys">
<echo message="No Quickstart specific deployments being made." />
</target>
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/build.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,89 @@
+<project name="Quickstart_webservice_wsproxy_basic" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- 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="quickstart-specific-clean">
+ <delete file="${basedir}/listener.log"/>
+ </target>
+
+ <target name="run">
+ <echo>standalone mode is not available for this quickstart.</echo>
+ </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="runws">
+ <echo>Calling JBossWS webservice directly.</echo>
+ <property name="runtest.arg.url" value="http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"/>
+ <antcall target="runinternal"/>
+ </target>
+
+ <target name="runjbr">
+ <echo>Calling JBossWS webservice via JBossRemotingGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9090"/>
+ <antcall target="runinternal"/>
+ </target>
+ <target name="runtest" depends="runjbr"/>
+
+ <target name="runhttp">
+ <echo>Calling JBossWS webservice via HttpGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9999/WSProxy_Basic/HelloWorldWS/"/>
+ <antcall target="runinternal"/>
+ </target>
+
+</project>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,3 @@
+<jbossesb-deployment>
+</jbossesb-deployment>
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/deployment.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,42 @@
+<?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-PROVIDER" protocol="http" host="localhost">
+ <jbr-bus busid="JBR-BUS" port="9090"/>
+ </jbr-provider>
+ <http-provider name="HTTP-PROVIDER" host="localhost" port="9999">
+ <http-bus busid="HTTP-BUS" context="/WSProxy_Basic/HelloWorldWS"/>
+ </http-provider>
+ </providers>
+
+ <services>
+ <service category="WSProxy_Basic" name="WSProxy"
+ description="Basic WebService Proxy"
+ invmScope="GLOBAL" >
+ <listeners>
+ <jbr-listener name="JBR-GATEWAY"
+ busidref="JBR-BUS"
+ is-gateway="true"
+ />
+ <http-listener name="HTTP-GATEWAY"
+ busidref="HTTP-BUS"
+ is-gateway="true"
+ />
+ </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://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS?wsdl"/>
+ </action>
+ <action name="echo-response"
+ class="org.jboss.soa.esb.actions.SystemPrintln"
+ />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/jboss-esb.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_basic/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,109 @@
+Overview:
+=========
+ Consumption of an external WS endpoint.
+
+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. standalone mode is not available for this quickstart.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ - In your server console, you will see output like this:
+
+02:21:53,792 INFO [SOAPProxy] mapped soapaction [] to binding [HelloWorldBinding]
+02:21:53,792 INFO [SOAPProxy] mapped soapaction [""] to binding [HelloWorldBinding]
+02:21:53,793 INFO [SOAPProxy] mapped operation [sayHello] to binding [HelloWorldBinding]
+02:21:53,807 INFO [SOAPProxy] mapped binding [HelloWorldBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS]
+
+ 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'.
+
+ 'runws' target description:
+ - This simply calls the target JBossWS webservice directly.
+ - The request url is: http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS
+ - Running it will create output similar to the runjbr output below.
+
+ 'runjbr' (alias 'runtest') target description:
+ - This will exercise the target webservice *via* the SOAPProxy, first going
+ through a JBoss Remoting Gateway Listener.
+ - The request url is: http://localhost:9090
+ - Running it will create output like this:
+[java] **** REQUEST URL: http://localhost:9090
+[java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_wsproxy_basic/helloworld"><soapenv:Header/><soapenv:Body><hel:sayHello><toWhom>jdoe</toWhom></hel:sayHello></soapenv:Body></soapenv:Envelope>
+[java] 02:26:12,389 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
+[java] 02:26:12,414 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+[java] 02:26:12,414 DEBUG [main][header] >> "SOAPAction: [\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "Host: localhost:9090[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "Content-Length: 247[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][header] >> "[\r][\n]"
+[java] 02:26:12,415 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://webservice_wsproxy_basic/helloworld"><soapenv:Header/><soapenv:Body><hel:sayHello><toWhom>jdoe</toWhom></hel:sayHello></soapenv:Body></soapenv:Envelope>"
+[java] 02:26:12,431 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
+[java] 02:26:12,433 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
+[java] 02:26:12,433 DEBUG [main][header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0[\r][\n]"
+[java] 02:26:12,434 DEBUG [main][header] << "Date: Thu, 02 Jul 2009 07:26:12 GMT[\r][\n]"
+[java] 02:26:12,434 DEBUG [main][header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+[java] 02:26:12,434 DEBUG [main][header] << "Content-Length: 297[\r][\n]"
+[java] **** RESPONSE CODE: 200
+[java] 02:26:12,438 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld"><return>Hello 'jdoe' on Thu Jul 02 02:26:12 GMT-05:00 2009</return></ns2:sa"
+[java] 02:26:12,438 DEBUG [main][content] << "yHelloResponse></env:Body></env:Envelope>"
+[java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_basic/helloworld"><return>Hello 'jdoe' on Thu Jul 02 02:26:12 GMT-05:00 2009</return></ns2:sayHelloResponse></env:Body></env:Envelope>
+
+ 'runhttp' target description:
+ - This will exercise the target webservice *via* the SOAPProxy, first going
+ through an HTTP Gateway Listener.
+ - The request url is: http://localhost:9999/WSProxy_Basic/HelloWorldWS/
+ - Running it will create output similar to the runjbr output above.
+
+Project file descriptions:
+==========================
+ jboss-esb.xml:
+ A JBoss Remoting Gateway Listener accepts the incoming HTTP call makes it available to the
+ WSProxy_Basic/WSProxy service, who has a message exchange pattern of RequestResponse. In the
+ action chain, there are 3 actions:
+ 1) echo out the incoming SOAP request,
+ 2) use the SOAPProxy class to invoke the original webservice endpoint,
+ 3) echo out the outgoing SOAP response.
+ Configuration:
+ - wsdl (required): The original wsdl url whose WS endpoint will get re-written and exposed as
+ new wsdl from the ESB:
+ http://localhost:8080/contract/contract.jsp?serviceCat=WSProxy_Basic&serviceName=WSProxy&protocol=http
+ Depending upon the <definitions><service><port><soap:address location attribute's protocol
+ (for example "http"), a protocol-specific SOAPProxyTransport implementation is used.
+ For other possible configuration properties, see the specific SOAPProxyTransport implementations
+ themselves.
+
+ log4j.xml:
+ Needed to configure log4J used by the quickstart.
+
+ src/../SendWSMessage.java:
+ Sends a SOAP message to the target webservice endpoint (see "ant run*" above).
+
+ build.xml:
+ Targets and structure description:
+
+ * the runws task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
+ passes in and argument representing the *ORIGINAL* webservice endpoint
+ and an argument representing the string-based message to invoke the webservice with.
+
+ * the runjbr (also runtest) task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
+ passes in and argument representing the *PROXIED* webservice endpoint (via JBoss Remoting)
+ and an argument representing the string-based message to invoke the webservice with.
+
+ * the runhttp task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_basic.test.SendWSMessage class and
+ passes in and argument representing the *PROXIED* webservice endpoint (via HTTP Gateway)
+ and an argument representing the string-based message to invoke the webservice with.
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,98 @@
+/*
+ * 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;
+
+/**
+ * Sends a simple webservice request to the proxied webservice, printing both the request and the response to the console.
+ *
+ * @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\">" +
+ "<soapenv:Header/>" +
+ "<soapenv:Body>" +
+ "<hel:sayHello>" +
+ "<toWhom>";
+
+ private static final String SOAP_POST =
+ "</toWhom>" +
+ "</hel:sayHello>" +
+ "</soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ // see product/samples/quickstarts/webservice_wsproxy_basic/build.xml
+ public static void main(String... args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ // for testing main method from Eclipse (build.xml passes these args in)
+ args = new String[2];
+ //args[0] = "http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"; // original ws ("ant runws")
+ args[0] = "http://localhost:9090"; // proxy via jbr gateway ("ant runjbr" or "ant runtest")
+ //args[0] = "http://localhost:9999/WSProxy_Basic/HelloWorldWS/"; // proxy via http gateway ("ant runhttp")
+ args[1] = System.getProperty("user.name");
+ }
+
+ String url = args[0];
+ System.out.println("**** REQUEST URL: " + url);
+ PostMethod method = new PostMethod(url);
+ method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
+
+ // this line should be used for better performance/interop but is not necessary
+ // http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
+ // http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAPAction_HTTP_Header
+ method.setRequestHeader("SOAPAction", "\"\"");
+
+ 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/trunk/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/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/HelloWorldWS.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+/**
+ * Simple rpc-style webservice that returns a hello greeting (using the passed-in name) and the current date.
+ *
+ * @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)
+ {
+ return "Hello '" + toWhom + "' on " + new java.util.Date();
+ }
+
+}
Property changes on: labs/jbossesb/trunk/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/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_basic/war/view/index.jsp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/WSProxy_Routed_Rules.drl
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/WSProxy_Routed_Rules.drl (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/WSProxy_Routed_Rules.drl 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,26 @@
+package com.jboss.soa.esb.routing.cbr
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+
+expander XPathLanguage.dsl
+
+global java.util.List destinations;
+
+rule "Hello Routing Rule"
+
+ when
+ xpathMatch expr "/soapenv:Envelope/soapenv:Body/hello:sayHello" use namespaces "soapenv=http://schemas.xmlsoap.org/soap/envelope/,hello=http://webservice_wsproxy_routed/hello"
+ then
+ Log : "Routing to Hello...";
+ Destination : "hello";
+
+end
+
+rule "Goodbye Routing Rule"
+ when
+ xpathMatch expr "/soapenv:Envelope/soapenv:Body/goodbye:sayGoodbye" use namespaces "soapenv=http://schemas.xmlsoap.org/soap/envelope/,goodbye=http://webservice_wsproxy_routed/goodbye"
+ then
+ Log : "Routing to Goodbye...";
+ Destination : "goodbye";
+end
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/WSProxy_Routed_Rules.drl
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/build.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,88 @@
+<project name="Quickstart_webservice_wsproxy_routed" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="WSProxy_Routed_Rules.drl"/>
+
+ <!-- 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="quickstart-specific-clean">
+ <delete file="${basedir}/listener.log"/>
+ </target>
+
+ <target name="run">
+ <echo>standalone mode is not available for this quickstart.</echo>
+ </target>
+
+ <target name="runinternal" depends="compile">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_routed.test.SendWSMessage" failonerror="true">
+ <arg value="${runtest.arg.url}"/>
+ <arg value="${user.name}"/>
+ <arg value="${runtest.arg.msg}"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="runhello">
+ <echo>Calling hello JBossWS webservice via JBossRemotingGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9090"/>
+ <property name="runtest.arg.msg" value="hello"/>
+ <antcall target="runinternal"/>
+ </target>
+ <target name="runtest" depends="runhello"/>
+
+ <target name="rungoodbye">
+ <echo>Calling goodbye JBossWS webservice via JBossRemotingGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9090"/>
+ <property name="runtest.arg.msg" value="goodbye"/>
+ <antcall target="runinternal"/>
+ </target>
+
+</project>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/deployment.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,9 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=jbrules.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_cbr_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_cbr_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_hello_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_hello_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_goodbye_esb_reply</depends>
+</jbossesb-deployment>
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/deployment.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbm-queue-service.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,39 @@
+<?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_routed_cbr_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_routed_cbr_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>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_hello_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_routed_hello_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>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_wsproxy_routed_goodbye_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_routed_goodbye_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/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbm-queue-service.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbmq-queue-service.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,39 @@
+<?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_routed_cbr_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_routed_cbr_esb_reply">
+ <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_routed_hello_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_routed_hello_esb_reply">
+ <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_routed_goodbye_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_routed_goodbye_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jbmq-queue-service.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jboss-esb.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,121 @@
+<?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="JBossRemoting" protocol="http" host="localhost">
+ <jbr-bus busid="WSProxy_CBR-GwChannel" port="9090"/>
+ </jbr-provider>
+
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="WSProxy_CBR-EsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_wsproxy_routed_cbr_esb"
+ />
+ </jms-bus>
+ <jms-bus busid="WSProxy_Hello-EsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_wsproxy_routed_hello_esb"
+ />
+ </jms-bus>
+ <jms-bus busid="WSProxy_Goodbye-EsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_wsproxy_routed_goodbye_esb"
+ />
+ </jms-bus>
+ </jms-provider>
+
+ </providers>
+
+ <services>
+
+ <service category="WSProxy_Routed" name="WSProxy_CBR"
+ description="Routed WebService Proxy: CBR">
+ <listeners>
+ <jbr-listener
+ name="WSProxy_CBR-GwListener"
+ busidref="WSProxy_CBR-GwChannel"
+ is-gateway="true"
+ />
+ <jms-listener
+ name="WSProxy_CBR-EsbListener"
+ busidref="WSProxy_CBR-EsbChannel"
+ />
+ </listeners>
+ <actions>
+ <action name="wsproxy_cbr_echo_request"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message before ContentBasedRouter" />
+ </action>
+ <action name="wsproxy_cbr"
+ class="org.jboss.soa.esb.actions.ContentBasedRouter">
+ <property name="ruleSet" value="WSProxy_Routed_Rules.drl"/>
+ <property name="ruleLanguage" value="XPathLanguage.dsl"/>
+ <property name="destinations">
+ <route-to
+ destination-name="hello"
+ service-category="WSProxy_Routed"
+ service-name="WSProxy_Hello" />
+ <route-to
+ destination-name="goodbye"
+ service-category="WSProxy_Routed"
+ service-name="WSProxy_Goodbye" />
+ </property>
+ </action>
+ </actions>
+ </service>
+
+ <service category="WSProxy_Routed" name="WSProxy_Hello"
+ description="Routed WebService Proxy: Hello">
+ <listeners>
+ <jms-listener
+ name="WSProxy_Hello-EsbListener"
+ busidref="WSProxy_Hello-EsbChannel"
+ />
+ </listeners>
+ <actions>
+ <action name="wsproxy_hello_echo_request"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message before Hello SOAPProxy" />
+ </action>
+ <action name="wsproxy_hello_proxy"
+ class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+ <property name="wsdl" value="http://localhost:8080/Quickstart_webservice_wsproxy_routed/HelloWS?wsdl"/>
+ </action>
+ <action name="wsproxy_hello_echo_response"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message after Hello SOAPProxy" />
+ </action>
+ </actions>
+ </service>
+
+ <service category="WSProxy_Routed" name="WSProxy_Goodbye"
+ description="Routed WebService Proxy: Goodbye">
+ <listeners>
+ <jms-listener
+ name="WSProxy_Goodbye-EsbListener"
+ busidref="WSProxy_Goodbye-EsbChannel"
+ />
+ </listeners>
+ <actions>
+ <action name="wsproxy_goodbye_echo_request"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message before Goodbye SOAPProxy" />
+ </action>
+ <action name="wsproxy_goodbye_proxy"
+ class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+ <property name="wsdl" value="http://localhost:8080/Quickstart_webservice_wsproxy_routed/GoodbyeWS?wsdl"/>
+ </action>
+ <action name="wsproxy_goodbye_echo_response"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message after Goodbye SOAPProxy" />
+ </action>
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/jboss-esb.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/log4j.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_routed/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/readme.txt 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,148 @@
+Overview:
+=========
+ Route to appropriate service to fulfill the awaiting WS client's request.
+
+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. standalone mode is not available for this quickstart.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ - In your server console, you will see output like this in the server console:
+
+23:04:51,230 INFO [SOAPProxy] mapped soapaction [] to binding [HelloBinding]
+23:04:51,230 INFO [SOAPProxy] mapped soapaction [""] to binding [HelloBinding]
+23:04:51,230 INFO [SOAPProxy] mapped operation [sayHello] to binding [HelloBinding]
+23:04:51,248 INFO [SOAPProxy] mapped binding [HelloBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_routed/HelloWS]
+23:04:51,268 INFO [JDBCDataStore] Generated token 'authToken:A82FB130-6786-11DE-B130-F2BDF1A7B793' for user: 'jbossesb/JBoss ESB User'
+23:04:51,289 WARN [HttpMethodBase] Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
+23:04:51,407 INFO [SOAPProxy] mapped soapaction [] to binding [GoodbyeBinding]
+23:04:51,408 INFO [SOAPProxy] mapped soapaction [""] to binding [GoodbyeBinding]
+23:04:51,408 INFO [SOAPProxy] mapped operation [sayGoodbye] to binding [GoodbyeBinding]
+23:04:51,408 INFO [SOAPProxy] mapped binding [GoodbyeBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_routed/GoodbyeWS]
+
+ 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'.
+
+ 'runhello' (alias 'runtest') target description:
+ - This will exercise the Hello webservice *via* a SOAPProxy, first going
+ through a JBoss Remoting Gateway Listener, then a ContentBasedRouter
+ to know whih proxied web service to invoke, which in this case is HelloWS.
+ - The request url is: http://localhost:9090
+ - Running it will create output like this in the server console:
+
+23:06:38,225 INFO [STDOUT] Message before ContentBasedRouter:
+23:06:38,226 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hello="http://webservice_wsproxy_routed/hello"><soapenv:Header/><soapenv:Body><hello:sayHello><toWhom>dward</toWhom></hello:sayHello></soapenv:Body></soapenv:Envelope>].
+23:06:38,313 INFO [STDOUT] Routing to Hello...
+23:06:38,440 INFO [STDOUT] Message before Hello SOAPProxy:
+23:06:38,440 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hello="http://webservice_wsproxy_routed/hello"><soapenv:Header/><soapenv:Body><hello:sayHello><toWhom>dward</toWhom></hello:sayHello></soapenv:Body></soapenv:Envelope>].
+23:06:38,454 INFO [STDOUT] Message after Hello SOAPProxy:
+23:06:38,454 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_routed/hello"><return>Hello 'dward' on Thu Jul 02 23:06:38 GMT-05:00 2009</return></ns2:sayHelloResponse></env:Body></env:Envelope>].
+
+ ...and this in the client console:
+
+ [java] **** REQUEST URL: http://localhost:9090
+ [java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hello="http://webservice_wsproxy_routed/hello"><soapenv:Header/><soapenv:Body><hello:sayHello><toWhom>dward</toWhom></hello:sayHello></soapenv:Body></soapenv:Envelope>
+ [java] 23:06:38,011 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
+ [java] 23:06:38,038 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 23:06:38,039 DEBUG [main][header] >> "SOAPAction: ""[\r][\n]"
+ [java] 23:06:38,039 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+ [java] 23:06:38,039 DEBUG [main][header] >> "Host: localhost:9090[\r][\n]"
+ [java] 23:06:38,039 DEBUG [main][header] >> "Content-Length: 249[\r][\n]"
+ [java] 23:06:38,039 DEBUG [main][header] >> "[\r][\n]"
+ [java] 23:06:38,040 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hello="http://webservice_wsproxy_routed/hello"><soapenv:Header/><soapenv:Body><hello:sayHello><toWhom>dward</toWhom></hello:sayHello></soapenv:Body></soapenv:Envelope>"
+ [java] 23:06:38,460 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
+ [java] 23:06:38,461 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
+ [java] 23:06:38,462 DEBUG [main][header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0[\r][\n]"
+ [java] 23:06:38,462 DEBUG [main][header] << "Date: Fri, 03 Jul 2009 04:06:38 GMT[\r][\n]"
+ [java] 23:06:38,462 DEBUG [main][header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 23:06:38,462 DEBUG [main][header] << "Content-Length: 293[\r][\n]"
+ [java] **** RESPONSE CODE: 200
+ [java] 23:06:38,465 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_routed/hello"><return>Hello 'dward' on Thu Jul 02 23:06:38 GMT-05:00 2009</return></ns2:sayHel"
+ [java] 23:06:38,465 DEBUG [main][content] << "loResponse></env:Body></env:Envelope>"
+ [java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayHelloResponse xmlns:ns2="http://webservice_wsproxy_routed/hello"><return>Hello 'dward' on Thu Jul 02 23:06:38 GMT-05:00 2009</return></ns2:sayHelloResponse></env:Body></env:Envelope>
+
+ 'rungoodbye' target description:
+ - This will exercise the Goodbye webservice *via* a SOAPProxy, first going
+ through a JBoss Remoting Gateway Listener, then a ContentBasedRouter
+ to know whih proxied web service to invoke, which in this case is GoodbyeWS.
+ - The request url is: http://localhost:9090
+ - Running it will create output like this in the server console:
+
+23:08:20,321 INFO [STDOUT] Message before ContentBasedRouter:
+23:08:20,321 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:goodbye="http://webservice_wsproxy_routed/goodbye"><soapenv:Header/><soapenv:Body><goodbye:sayGoodbye><toWhom>dward</toWhom></goodbye:sayGoodbye></soapenv:Body></soapenv:Envelope>].
+23:08:20,337 INFO [STDOUT] Routing to Goodbye...
+23:08:20,518 INFO [STDOUT] Message before Goodbye SOAPProxy:
+23:08:20,518 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:goodbye="http://webservice_wsproxy_routed/goodbye"><soapenv:Header/><soapenv:Body><goodbye:sayGoodbye><toWhom>dward</toWhom></goodbye:sayGoodbye></soapenv:Body></soapenv:Envelope>].
+23:08:20,533 INFO [STDOUT] Message after Goodbye SOAPProxy:
+23:08:20,533 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayGoodbyeResponse xmlns:ns2="http://webservice_wsproxy_routed/goodbye"><return>Goodbye 'dward' on Thu Jul 02 23:08:20 GMT-05:00 2009</return></ns2:sayGoodbyeResponse></env:Body></env:Envelope>].
+
+ ...and this in the client console:
+
+ [java] **** REQUEST URL: http://localhost:9090
+ [java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:goodbye="http://webservice_wsproxy_routed/goodbye"><soapenv:Header/><soapenv:Body><goodbye:sayGoodbye><toWhom>dward</toWhom></goodbye:sayGoodbye></soapenv:Body></soapenv:Envelope>
+ [java] 23:08:19,956 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
+ [java] 23:08:19,991 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 23:08:19,992 DEBUG [main][header] >> "SOAPAction: ""[\r][\n]"
+ [java] 23:08:19,993 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+ [java] 23:08:19,993 DEBUG [main][header] >> "Host: localhost:9090[\r][\n]"
+ [java] 23:08:19,993 DEBUG [main][header] >> "Content-Length: 261[\r][\n]"
+ [java] 23:08:19,993 DEBUG [main][header] >> "[\r][\n]"
+ [java] 23:08:19,994 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:goodbye="http://webservice_wsproxy_routed/goodbye"><soapenv:Header/><soapenv:Body><goodbye:sayGoodbye><toWhom>dward</toWhom></goodbye:sayGoodbye></soapenv:Body></soapenv:Envelope>"
+ [java] 23:08:20,539 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
+ [java] 23:08:20,541 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
+ [java] 23:08:20,541 DEBUG [main][header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0[\r][\n]"
+ [java] 23:08:20,541 DEBUG [main][header] << "Date: Fri, 03 Jul 2009 04:08:20 GMT[\r][\n]"
+ [java] 23:08:20,541 DEBUG [main][header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 23:08:20,541 DEBUG [main][header] << "Content-Length: 301[\r][\n]"
+ [java] **** RESPONSE CODE: 200
+ [java] 23:08:20,544 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayGoodbyeResponse xmlns:ns2="http://webservice_wsproxy_routed/goodbye"><return>Goodbye 'dward' on Thu Jul 02 23:08:20 GMT-05:00 2009</return></ns2:"
+ [java] 23:08:20,544 DEBUG [main][content] << "sayGoodbyeResponse></env:Body></env:Envelope>"
+ [java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:sayGoodbyeResponse xmlns:ns2="http://webservice_wsproxy_routed/goodbye"><return>Goodbye 'dward' on Thu Jul 02 23:08:20 GMT-05:00 2009</return></ns2:sayGoodbyeResponse></env:Body></env:Envelope>
+
+Project file descriptions:
+==========================
+ jboss-esb.xml:
+ A JBoss Remoting Gateway Listener accepts the incoming HTTP call makes it available to the
+ WSProxy_Routed/WSProxy_CBR service, who uses a ContentBasedRouter configured with a drools rules
+ file.
+
+ WSProxy_Routed_Rules.drl:
+ Uses xpath expressions to match the body content of the soap envelope, and
+ depending on that content, route to either the "hello" destination (which
+ invokes the HelloWS via a SOAPProxy), or the "goodbye" desitination
+ (which invokes the GoodbyeWS via a SOAPProxy).
+
+ log4j.xml:
+ Needed to configure log4J used by the quickstart.
+
+ src/../SendWSMessage.java:
+ Sends a SOAP message to the target webservice endpoint (see "ant run*" above).
+
+ build.xml:
+ Targets and structure description:
+
+ * the runhello (also runtest) task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_routed.test.SendWSMessage class and
+ passes in and argument representing the *PROXIED* webservice endpoint (via JBoss Remoting)
+ and an argument representing the string-based message to invoke the webservice with.
+ SendWSMessage will submit a soap request which the CBR will determine to route to the proxied
+ (via SOAPProxy) HelloWS.
+
+ * the rungoodbye task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_routed.test.SendWSMessage class and
+ passes in and argument representing the *PROXIED* webservice endpoint (via HTTP Gateway)
+ and an argument representing the string-based message to invoke the webservice with.
+ SendWSMessage will submit a soap request which the CBR will determine to route to the proxied
+ (via SOAPProxy) GoodbyeWS.
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/readme.txt
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/test/SendWSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/test/SendWSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/test/SendWSMessage.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,111 @@
+/*
+ * 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_routed.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;
+
+/**
+ * Sends a simple webservice request to the proxied webservice, printing both the request and the response to the console.
+ *
+ * @author dward at jboss.org
+ */
+public class SendWSMessage
+{
+
+ private static final String HELLO_SOAP_PRE =
+ "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:hello=\"http://webservice_wsproxy_routed/hello\">" +
+ "<soapenv:Header/>" +
+ "<soapenv:Body>" +
+ "<hello:sayHello>" +
+ "<toWhom>";
+
+ private static final String HELLO_SOAP_POST =
+ "</toWhom>" +
+ "</hello:sayHello>" +
+ "</soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ private static final String GOODBYE_SOAP_PRE =
+ "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:goodbye=\"http://webservice_wsproxy_routed/goodbye\">" +
+ "<soapenv:Header/>" +
+ "<soapenv:Body>" +
+ "<goodbye:sayGoodbye>" +
+ "<toWhom>";
+
+ private static final String GOODBYE_SOAP_POST =
+ "</toWhom>" +
+ "</goodbye:sayGoodbye>" +
+ "</soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ // see product/samples/quickstarts/webservice_wsproxy_routed/build.xml
+ public static void main(String... args) throws Exception
+ {
+ if (args.length < 3)
+ {
+ // for testing main method from Eclipse (build.xml passes these args in)
+ args = new String[3];
+ args[0] = "http://localhost:9090"; // proxy via jbr gateway ("ant runhello" or "ant rungoodbye")
+ args[1] = System.getProperty("user.name");
+ args[2] = "hello";
+ }
+
+ String url = args[0];
+ System.out.println("**** REQUEST URL: " + url);
+ PostMethod method = new PostMethod(url);
+ method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
+
+ // this line should be used for better performance/interop but is not necessary
+ // http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
+ // http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAPAction_HTTP_Header
+ method.setRequestHeader("SOAPAction", "\"\"");
+
+ boolean hello = "hello".equals(args[2]);
+ String request = (hello ? HELLO_SOAP_PRE : GOODBYE_SOAP_PRE) + args[1] + (hello ? HELLO_SOAP_POST : GOODBYE_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/trunk/product/samples/quickstarts/webservice_wsproxy_routed/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/test/SendWSMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/web.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,25 @@
+<?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>HelloWS</servlet-name>
+ <servlet-class>org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_routed.HelloWS</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>GoodbyeWS</servlet-name>
+ <servlet-class>org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_routed.GoodbyeWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloWS</servlet-name>
+ <url-pattern>/HelloWS</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>GoodbyeWS</servlet-name>
+ <url-pattern>/GoodbyeWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/GoodbyeWS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/GoodbyeWS.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/GoodbyeWS.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,41 @@
+/*
+ * 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_routed;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+/**
+ * Simple rpc-style webservice that returns a goodbye message (using the passed-in name) and the current date.
+ *
+ * @author dward at jboss.org
+ */
+ at WebService(name = "Goodbye", targetNamespace = "http://webservice_wsproxy_routed/goodbye")
+public class GoodbyeWS
+{
+
+ @WebMethod
+ public String sayGoodbye(@WebParam(name = "toWhom") String toWhom)
+ {
+ return "Goodbye '" + toWhom + "' on " + new java.util.Date();
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/GoodbyeWS.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/HelloWS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/HelloWS.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/HelloWS.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,41 @@
+/*
+ * 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_routed;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+/**
+ * Simple rpc-style webservice that returns a hello message (using the passed-in name) and the current date.
+ *
+ * @author dward at jboss.org
+ */
+ at WebService(name = "Hello", targetNamespace = "http://webservice_wsproxy_routed/hello")
+public class HelloWS
+{
+
+ @WebMethod
+ public String sayHello(@WebParam(name = "toWhom") String toWhom)
+ {
+ return "Hello '" + toWhom + "' on " + new java.util.Date();
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_routed/HelloWS.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/view/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/view/index.jsp (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/view/index.jsp 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_routed/war/view/index.jsp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_RequestTransform.xsl
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_RequestTransform.xsl (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_RequestTransform.xsl 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:inv="http://webservice_wsproxy_versioning/invoicing">
+
+ <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
+
+ <xsl:template match="inv:processInvoice">
+ <xsl:copy>
+ <invoiceNumber><xsl:value-of select="invoiceNumber"/></invoiceNumber>
+ <!-- here we add the processDate element to conform to the newer version -->
+ <!-- (xsl 2 would give us the current-dateTime() function) -->
+ <processDate>2005-12-13T14:13:28.443+01:00</processDate>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="comment()|processing-instruction()">
+ <xsl:copy/>
+ </xsl:template>
+
+</xsl:stylesheet>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_RequestTransform.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_WsdlTransform.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_WsdlTransform.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_WsdlTransform.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<smooks-resource-list
+ xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+ xmlns:g="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd">
+
+ <g:groovy executeOnElement="element">
+ <g:script>
+ <!--
+ use(DOMCategory) {
+ if (element.'@name' == 'processDate') {
+ DomUtils.removeElement(element, false);
+ }
+ }
+ -->
+ </g:script>
+ </g:groovy>
+
+</smooks-resource-list>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/WSProxy_Versioning_WsdlTransform.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/build.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,94 @@
+<project name="Quickstart_webservice_wsproxy_versioning" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="WSProxy_Versioning_WsdlTransform.xml WSProxy_Versioning_RequestTransform.xsl"/>
+
+ <!-- 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="quickstart-specific-clean">
+ <delete file="${basedir}/listener.log"/>
+ </target>
+
+ <target name="run">
+ <echo>standalone mode is not available for this quickstart.</echo>
+ </target>
+
+ <target name="runinternal" depends="compile">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_versioning.test.SendWSMessage" failonerror="true">
+ <arg value="${runtest.arg.url}"/>
+ <arg value="${runtest.arg.ver}"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="runws">
+ <echo>Calling JBossWS webservice directly.</echo>
+ <property name="runtest.arg.url" value="http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS"/>
+ <property name="runtest.arg.ver" value="new"/>
+ <antcall target="runinternal"/>
+ </target>
+
+ <target name="runold">
+ <echo>Calling JBossWS webservice via JBossRemotingGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9090"/>
+ <property name="runtest.arg.ver" value="old"/>
+ <antcall target="runinternal"/>
+ </target>
+ <target name="runtest" depends="runold"/>
+
+ <target name="runnew">
+ <echo>Calling JBossWS webservice via JBossRemotingGatewayListener and WSProxy.</echo>
+ <property name="runtest.arg.url" value="http://localhost:9999"/>
+ <property name="runtest.arg.ver" value="new"/>
+ <antcall target="runinternal"/>
+ </target>
+
+</project>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/deployment.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,3 @@
+<jbossesb-deployment>
+</jbossesb-deployment>
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/deployment.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/jboss-esb.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,85 @@
+<?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-PROVIDER-OldVersion" protocol="http" host="localhost">
+ <jbr-bus busid="JBR-BUS-OldVersion" port="9090"/>
+ </jbr-provider>
+
+ <jbr-provider name="JBR-PROVIDER-NewVersion" protocol="http" host="localhost">
+ <jbr-bus busid="JBR-BUS-NewVersion" port="9999"/>
+ </jbr-provider>
+
+ </providers>
+
+ <services>
+
+ <service category="WSProxy_Versioning" name="WSProxy-OldVersion"
+ description="The old version of the WebService (legacy support)"
+ invmScope="GLOBAL" >
+ <listeners>
+ <jbr-listener name="JBR-GATEWAY-OldVersion"
+ busidref="JBR-BUS-OldVersion"
+ is-gateway="true"
+ />
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="echo-old-request"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message before Transformation" />
+ </action>
+ <!-- we transform the OLD request to fit the NEW schema -->
+ <action name="wsproxy-transform-old-to-new"
+ class="org.jboss.soa.esb.actions.transformation.xslt.XsltAction">
+ <property name="templateFile" value="/WSProxy_Versioning_RequestTransform.xsl"/>
+ <property name="failOnWarning" value="true"/>
+ <property name="resultType" value="STRING"/>
+ </action>
+ <action name="echo-new-request"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message after Transformation but before SOAPProxy" />
+ </action>
+ <action name="wsproxy-invoke-new-version"
+ class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+ <!-- this is the NEW endpoint, because we transformed the OLD request to fit it -->
+ <property name="wsdl" value="http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS?wsdl"/>
+ <property name="wsdlTransform" value="/WSProxy_Versioning_WsdlTransform.xml"/>
+ </action>
+ <action name="echo-response"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message after SOAPProxy" />
+ </action>
+ <!-- we could transform the result here, if we needed to (but we don't) -->
+ </actions>
+ </service>
+
+ <service category="WSProxy_Versioning" name="WSProxy-NewVersion"
+ description="The new version of the WebService (latest and greatest)"
+ invmScope="GLOBAL" >
+ <listeners>
+ <jbr-listener name="JBR-GATEWAY-NewVersion"
+ busidref="JBR-BUS-NewVersion"
+ is-gateway="true"
+ />
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="echo-request"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message before SOAPProxy" />
+ </action>
+ <action name="wsproxy-invoke-new-version"
+ class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+ <!-- this is the NEW endpoint, of course -->
+ <property name="wsdl" value="http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS?wsdl"/>
+ </action>
+ <action name="echo-response"
+ class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message after SOAPProxy" />
+ </action>
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/jboss-esb.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/log4j.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/readme.txt 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,169 @@
+Overview:
+=========
+ Versioning of proxied endpoints is an important aspect of an ESB.
+
+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. standalone mode is not available for this quickstart.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ - In your server console, you will see output like this in your server console:
+
+04:02:17,312 INFO [SOAPProxy] mapped soapaction [] to binding [InvoicingBinding]
+04:02:17,312 INFO [SOAPProxy] mapped soapaction [""] to binding [InvoicingBinding]
+04:02:17,312 INFO [SOAPProxy] mapped operation [processInvoice] to binding [InvoicingBinding]
+04:02:17,326 INFO [SOAPProxy] mapped binding [InvoicingBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS]
+04:02:17,337 WARN [HttpMethodBase] Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
+04:02:17,424 INFO [SOAPProxy] mapped soapaction [] to binding [InvoicingBinding]
+04:02:17,424 INFO [SOAPProxy] mapped soapaction [""] to binding [InvoicingBinding]
+04:02:17,424 INFO [SOAPProxy] mapped operation [processInvoice] to binding [InvoicingBinding]
+04:02:17,425 INFO [SOAPProxy] mapped binding [InvoicingBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS]
+
+ 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'.
+
+ 'runws' target description:
+ - This simply calls the target JBossWS webservice directly.
+ - The request url is: http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS
+ - Running it will create output similar to the runnew output below.
+
+ 'runold' (alias 'runtest') target description:
+ - This will exercise the target webservice *via* the SOAPProxy, first going through a JBoss Remoting Gateway Listener
+ and having it's incoming SOAP request be *transformed* and having a <processDate> elemented added to the body!
+ - Note that the wsl is transformed as well (see "Project file descriptions" below)!
+ - The request url is: http://localhost:9090
+ - Running it will create output like this in the server console:
+
+04:05:02,802 INFO [STDOUT] Message before Transformation:
+04:05:02,802 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing"><soapenv:Header/><soapenv:Body><inv:processInvoice><invoiceNumber>0123456789</invoiceNumber></inv:processInvoice></soapenv:Body></soapenv:Envelope>].
+04:05:02,810 INFO [STDOUT] Message after Transformation but before SOAPProxy:
+04:05:02,810 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing">
+<soapenv:Header/>
+<soapenv:Body>
+<inv:processInvoice>
+<invoiceNumber>0123456789</invoiceNumber>
+<processDate>2005-12-13T14:13:28.443+01:00</processDate>
+</inv:processInvoice>
+</soapenv:Body>
+</soapenv:Envelope>
+].
+04:05:02,973 INFO [InvoicingWS] processInvoice called with invoiceNumber [0123456789] and processDate [Tue Dec 13 08:13:28 GMT-05:00 2005]
+04:05:03,016 INFO [STDOUT] Message after SOAPProxy:
+04:05:03,016 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:processInvoiceResponse xmlns:ns2="http://webservice_wsproxy_versioning/invoicing"><success>true</success></ns2:processInvoiceResponse></env:Body></env:Envelope>].
+
+ - And this in the client console:
+
+ [java] **** REQUEST URL: http://localhost:9090
+ [java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing"><soapenv:Header/><soapenv:Body><inv:processInvoice><invoiceNumber>0123456789</invoiceNumber></inv:processInvoice></soapenv:Body></soapenv:Envelope>
+ [java] 04:05:02,607 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
+ [java] 04:05:02,626 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 04:05:02,627 DEBUG [main][header] >> "SOAPAction: ""[\r][\n]"
+ [java] 04:05:02,628 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+ [java] 04:05:02,628 DEBUG [main][header] >> "Host: localhost:9090[\r][\n]"
+ [java] 04:05:02,628 DEBUG [main][header] >> "Content-Length: 282[\r][\n]"
+ [java] 04:05:02,628 DEBUG [main][header] >> "[\r][\n]"
+ [java] 04:05:02,631 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing"><soapenv:Header/><soapenv:Body><inv:processInvoice><invoiceNumber>0123456789</invoiceNumber></inv:processInvoice></soapenv:Body></soapenv:Envelope>"
+ [java] 04:05:03,018 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
+ [java] 04:05:03,020 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
+ [java] 04:05:03,020 DEBUG [main][header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0[\r][\n]"
+ [java] 04:05:03,020 DEBUG [main][header] << "Date: Fri, 03 Jul 2009 09:05:03 GMT[\r][\n]"
+ [java] 04:05:03,020 DEBUG [main][header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 04:05:03,020 DEBUG [main][header] << "Content-Length: 268[\r][\n]"
+ [java] **** RESPONSE CODE: 200
+ [java] 04:05:03,024 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:processInvoiceResponse xmlns:ns2="http://webservice_wsproxy_versioning/invoicing"><success>true</success></ns2:processInvoiceResponse></env:Body></e"
+ [java] 04:05:03,024 DEBUG [main][content] << "nv:Envelope>"
+ [java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:processInvoiceResponse xmlns:ns2="http://webservice_wsproxy_versioning/invoicing"><success>true</success></ns2:processInvoiceResponse></env:Body></env:Envelope>
+
+ 'runnew' target description:
+ - This will exercise the target webservice *via* the SOAPProxy, first going through a JBoss Remoting Gateway Listener.
+ - Nothing interesting here; it is just like the webservice_wsproxy_basic quickstart.
+ - The request url is: http://localhost:9090
+ - Running it will create output like this in the server console:
+
+04:06:43,687 INFO [STDOUT] Message before SOAPProxy:
+04:06:43,687 INFO [STDOUT] [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing"><soapenv:Header/><soapenv:Body><inv:processInvoice><invoiceNumber>0123456789</invoiceNumber><processDate>2005-12-13T14:13:28.443+01:00</processDate></inv:processInvoice></soapenv:Body></soapenv:Envelope>].
+04:06:43,692 INFO [InvoicingWS] processInvoice called with invoiceNumber [0123456789] and processDate [Tue Dec 13 08:13:28 GMT-05:00 2005]
+04:06:43,694 INFO [STDOUT] Message after SOAPProxy:
+04:06:43,694 INFO [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:processInvoiceResponse xmlns:ns2="http://webservice_wsproxy_versioning/invoicing"><success>true</success></ns2:processInvoiceResponse></env:Body></env:Envelope>].
+
+ - And this in the client console:
+
+ [java] **** REQUEST URL: http://localhost:9999
+ [java] **** REQUEST BODY: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing"><soapenv:Header/><soapenv:Body><inv:processInvoice><invoiceNumber>0123456789</invoiceNumber><processDate>2005-12-13T14:13:28.443+01:00</processDate></inv:processInvoice></soapenv:Body></soapenv:Envelope>
+ [java] 04:06:43,558 DEBUG [main][header] >> "POST / HTTP/1.1[\r][\n]"
+ [java] 04:06:43,593 DEBUG [main][header] >> "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 04:06:43,593 DEBUG [main][header] >> "SOAPAction: ""[\r][\n]"
+ [java] 04:06:43,594 DEBUG [main][header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+ [java] 04:06:43,594 DEBUG [main][header] >> "Host: localhost:9999[\r][\n]"
+ [java] 04:06:43,594 DEBUG [main][header] >> "Content-Length: 338[\r][\n]"
+ [java] 04:06:43,594 DEBUG [main][header] >> "[\r][\n]"
+ [java] 04:06:43,595 DEBUG [main][content] >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://webservice_wsproxy_versioning/invoicing"><soapenv:Header/><soapenv:Body><inv:processInvoice><invoiceNumber>0123456789</invoiceNumber><processDate>2005-12-13T14:13:28.443+01:00</processDate></inv:processInvoice></soapenv:Body></soapenv:Envelope>"
+ [java] 04:06:43,695 DEBUG [main][header] << "HTTP/1.1 200 OK[\r][\n]"
+ [java] 04:06:43,697 DEBUG [main][header] << "Server: Apache-Coyote/1.1[\r][\n]"
+ [java] 04:06:43,697 DEBUG [main][header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0[\r][\n]"
+ [java] 04:06:43,697 DEBUG [main][header] << "Date: Fri, 03 Jul 2009 09:06:43 GMT[\r][\n]"
+ [java] 04:06:43,697 DEBUG [main][header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+ [java] 04:06:43,697 DEBUG [main][header] << "Content-Length: 268[\r][\n]"
+ [java] **** RESPONSE CODE: 200
+ [java] 04:06:43,700 DEBUG [main][content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:processInvoiceResponse xmlns:ns2="http://webservice_wsproxy_versioning/invoicing"><success>true</success></ns2:processInvoiceResponse></env:Body></e"
+ [java] 04:06:43,700 DEBUG [main][content] << "nv:Envelope>"
+ [java] **** RESPONSE BODY: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:processInvoiceResponse xmlns:ns2="http://webservice_wsproxy_versioning/invoicing"><success>true</success></ns2:processInvoiceResponse></env:Body></env:Envelope>
+
+Project file descriptions:
+==========================
+ jboss-esb.xml:
+ * the "WSProxy_Versioning/WSProxy-OldVersion" service's purpose is to
+ allow old webservice clients to continue using that old endpoint
+ without change. It uses an XsltAction to apply a transform on the
+ soap request (see WSProxy_Versioning_RequestTransform.xsl below), and
+ also specifies:
+ - a wsdl to the new endpoint
+ - a wsdlTransform to transform the wsdl to what old clients are
+ expecting (see WSProxy_Versioning_WsdlTransform.xml below).
+ * the "WSProxy_Versioning/WSProxy-NewVersion" service's purpose is to
+ simply allow new webservice clients to start using the new endpoint,
+ however still benefiting from the proxy abstracting the real endpoint
+ from them.
+
+ log4j.xml:
+ Needed to configure log4J used by the quickstart.
+
+ src/../SendWSMessage.java:
+ Sends a SOAP message to the target webservice endpoint (see "ant run*" above).
+
+ WSProxy_Versioning_RequestTransform.xsl:
+ Tranforms the incoming SOAPRequest to the old service endpoint to it can be forwarded
+ along to the new service endpoint.
+ It uses Smooks to add the newly added <processDate> element.
+
+ WSProxy_Versioning_WsdlTransform.xml:
+ Transforms the new service endpoing WSDL so it can be used in the old service endpoint.
+ It uses Smooks to remove the newly added <processDate> element.
+ http://localhost:8080/contract/contract.jsp?serviceCat=WSProxy_Versioning&serviceName=WSProxy-OldVersion&protocol=http
+
+ build.xml:
+ Targets and structure description:
+
+ * the runws task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_versioning.test.SendWSMessage class and
+ executes the real JBossWS webservice directly.
+
+ * the runold (also runtest) task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_versioning.test.SendWSMessage class and
+ executes the "WSProxy_Versioning/WSProxy-OldVersion" service (see jboss-esb.xml description above).
+
+ * the runnew task calls the
+ org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_versioning.test.SendWSMessage class and
+ executes the "WSProxy_Versioning/WSProxy-NewVersion" service (see jboss-esb.xml description above).
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/readme.txt
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/test/SendWSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/test/SendWSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/test/SendWSMessage.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,98 @@
+/*
+ * 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_versioning.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;
+
+/**
+ * Sends a simple webservice request to the proxied webservice, printing both the request and the response to the console.
+ *
+ * @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:inv=\"http://webservice_wsproxy_versioning/invoicing\">" +
+ "<soapenv:Header/>" +
+ "<soapenv:Body>" +
+ "<inv:processInvoice>" +
+ "<invoiceNumber>0123456789</invoiceNumber>";
+
+ private static final String SOAP_POST =
+ "</inv:processInvoice>" +
+ "</soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ // see product/samples/quickstarts/webservice_wsproxy_versioning/build.xml
+ public static void main(String... args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ // for testing main method from Eclipse (build.xml passes these args in)
+ args = new String[2];
+ //args[0] = "http://localhost:8080/Quickstart_webservice_wsproxy_versioning/InvoicingWS"; // original ws ("ant runws")
+ args[0] = "http://localhost:9090"; // the old ws format ("ant runold" or "ant runtest")
+ //args[0] = "http://localhost:9999"; // the new ws format ("ant runnew")
+ args[1] = "old";
+ }
+
+ String url = args[0];
+ System.out.println("**** REQUEST URL: " + url);
+ PostMethod method = new PostMethod(url);
+ method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
+
+ // this line should be used for better performance/interop but is not necessary
+ // http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
+ // http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAPAction_HTTP_Header
+ method.setRequestHeader("SOAPAction", "\"\"");
+
+ boolean old = "old".equals(args[1]);
+ String request = SOAP_PRE + (old ? "" : "<processDate>2005-12-13T14:13:28.443+01:00</processDate>") + 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/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/test/SendWSMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/web.xml 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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>InvoicingWS</servlet-name>
+ <servlet-class>org.jboss.soa.esb.samples.quickstart.webservice_wsproxy_versioning.InvoicingWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>InvoicingWS</servlet-name>
+ <url-pattern>/InvoicingWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/InvoicingWS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/InvoicingWS.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/InvoicingWS.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,55 @@
+/*
+ * 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_versioning;
+
+import java.util.Date;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Simple rpc-style webservice that returns invoice processing success.
+ *
+ * @author dward at jboss.org
+ */
+ at WebService(name = "Invoicing", targetNamespace = "http://webservice_wsproxy_versioning/invoicing")
+public class InvoicingWS
+{
+
+ private static Logger logger = Logger.getLogger(InvoicingWS.class);
+
+ @WebMethod
+ @WebResult(name="success")
+ public Boolean processInvoice(
+ @WebParam(name="invoiceNumber") String invoiceNumber,
+ @WebParam(name="processDate") Date processDate )
+ {
+ if ( logger.isInfoEnabled() )
+ {
+ logger.info("processInvoice called with invoiceNumber [" + invoiceNumber + "] and processDate [" + processDate + "]");
+ }
+ return (processDate != null ? Boolean.TRUE : Boolean.FALSE);
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_versioning/InvoicingWS.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/view/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/view/index.jsp (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/view/index.jsp 2009-07-03 09:54:15 UTC (rev 27482)
@@ -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/trunk/product/samples/quickstarts/webservice_wsproxy_versioning/war/view/index.jsp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/HttpSOAPProxyTransport.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,99 @@
+/*
+ * 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;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+
+/**
+ * Implements http-specific routing of the SOAP request to the target webservice. All config properties are passed through to a
+ * wrapped instance of {@link HttpRouter}, so any of it's config properties can be added to the {@link SOAPProxy} configuration.
+ *
+ * @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, final MessagePayloadProxy payloadProxy, 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) {
+ @Override
+ public MessagePayloadProxy getPayloadProxy() {
+ return payloadProxy;
+ }
+ };
+ }
+
+ 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)
+ {
+ boolean defaulting = false;
+ String value = config.getAttribute(name);
+ if (value == null)
+ {
+ defaulting = true;
+ value = defaultValue;
+ config.setAttribute(name, value);
+ }
+ if ( logger.isDebugEnabled() )
+ {
+ logger.debug(
+ (defaulting ? "defaulting" : "respecting") + " HttpRouter attribute [" + name + "] " +
+ (defaulting ? "to" : "of") + " [" + value + "]" );
+ }
+ return value;
+ }
+
+}
Property changes on: labs/jbossesb/trunk/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/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,310 @@
+/*
+ * 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.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.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;
+
+/**
+ * A SOAPProxy focuses on the consumption of an external WS endpoint (e.g. hosted on .NET, another external Java-based AS, LAMP)
+ * and re-publication of a WS endpoint via the ESB. The ESB sits between the ultimate consumer/client (e.g. .NET WinForm
+ * application) and the ultimate producer (e.g. RoR-hosted WS). The purpose of this intermediary is to provide an abstraction
+ * layer that provides for more loose coupling between the client and service, as they are both completely unaware of each other
+ * (the client no longer has a direct connection to the remote service's hostname/IP address). The client will see modified WSDL
+ * so that the client is pointed to the ESB's exposed endpoint instead of the original, now proxied endpoint.<p/>
+ *
+ * <i>Configuration</i><br/>
+ * <ol>
+ * <li><b>wsdl</b> (required): The original wsdl {@link URL url} whose WS endpoint will get re-written and exposed as new wsdl from
+ * the ESB. Depending upon the <definitions><service><port><soap:address location attribute's protocol (for
+ * example "http"), a protocol-specific {@link SOAPProxyTransport} implementation is used.</li>
+ * </ol>
+ * For other possible configuration properties, see the specific {@link SOAPProxyTransport} implementations themselves.<p/>
+ *
+ * <i>Example:</i><br/>
+ * <pre>
+ * <action name="wsproxy" class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy">
+ * <property name="wsdl" value="http://127.0.0.1:8080/path/HelloWorldWebService?wsdl"/> <!-- required -->
+ * </action>
+ * </pre>
+ *
+ * @author dward at jboss.org
+ */
+ at Publish(SOAPProxyWsdlContractPublisher.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);
+ WSDLDefinitionsFactory wsdl_def_fact = WSDLDefinitionsFactory.newInstance();
+ URL wsdl_url = SOAPProxyWsdlContractPublisher.createLocalWsdlURL(config);
+ 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)
+ {
+ soapaction = "";
+ }
+ if ( !soapaction_to_binding.containsKey(soapaction) )
+ {
+ soapaction_to_binding.put(soapaction, binding);
+ if ( logger.isInfoEnabled() )
+ {
+ logger.info("mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
+ }
+ }
+ // http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
+ // http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAPAction_HTTP_Header
+ if ( !soapaction.startsWith("\"") && !soapaction.endsWith("\"") )
+ {
+ soapaction = '"' + soapaction + '"';
+ if ( !soapaction_to_binding.containsKey(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.containsKey(operation) )
+ {
+ 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, payloadProxy, endpointAddress);
+ }
+ // else if jms ...
+ if (transport != null)
+ {
+ if ( !binding_to_transport.containsKey(binding) )
+ {
+ 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)
+ {
+ if ( logger.isEnabledFor(Level.WARN) )
+ {
+ logger.warn("null binding for soapaction [" + soapaction + "]. Resorting to (potentially expensive) parsing of Envelope to discover operation.");
+ }
+ operation = getOperation(message);
+ binding = (operation != null) ? operation_to_binding.get(operation) : null;
+ if ( binding == null && logger.isEnabledFor(Level.ERROR) )
+ {
+ logger.error("null binding for operation [" + operation + "] in addition to soapaction [" + soapaction + "]");
+ }
+ }
+ 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 + "]");
+ }
+ 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();
+ }
+ }
+
+ // This is a best (and potentially expensive) guess! See logger.warn(String) warning in process(Message) above.
+ 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/trunk/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/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+/**
+ * Sub-classes implement protocol-specific routing of the SOAP request to the target webservice, and expose it's endpoint address.
+ *
+ * @see HttpSOAPProxyTransport
+ *
+ * @author dward at jboss.org
+ */
+abstract class SOAPProxyTransport extends AbstractActionPipelineProcessor
+{
+
+ public abstract String getEndpointAddress();
+
+}
Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyTransport.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyWsdlContractPublisher.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyWsdlContractPublisher.java (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyWsdlContractPublisher.java 2009-07-03 09:54:15 UTC (rev 27482)
@@ -0,0 +1,100 @@
+/*
+ * 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.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.soap.wise.WiseWsdlContractPublisher;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * Provides convenience method to load the remote wsdl respecting all configured HttpClient properties.
+ *
+ * @author dward at jboss.org
+ */
+public class SOAPProxyWsdlContractPublisher extends WiseWsdlContractPublisher
+{
+
+ private static Logger logger = Logger.getLogger(SOAPProxyWsdlContractPublisher.class);
+
+ static URL createLocalWsdlURL(ConfigTree config) throws ConfigurationException
+ {
+ Writer writer = null;
+ try
+ {
+ WsdlLoader loader = new WsdlLoader(config);
+ String wsdl = loader.getWsdl( config.getRequiredAttribute("wsdl") );
+ File file = File.createTempFile(SOAPProxyWsdlContractPublisher.class.getName() + "-", ".wsdl");
+ file.deleteOnExit();
+ writer = new BufferedWriter( new FileWriter(file) );
+ writer.write(wsdl);
+ writer.flush();
+ URL url = file.toURL();
+ if ( logger.isDebugEnabled() )
+ {
+ logger.debug("created local wsdl url: " + url);
+ }
+ return url;
+ }
+ catch (IOException ioe)
+ {
+ throw new ConfigurationException(ioe);
+ }
+ finally
+ {
+ try { if (writer != null) writer.close(); } catch (Throwable t) {}
+ }
+ }
+
+ private static class WsdlLoader extends SOAPProxyWsdlContractPublisher
+ {
+
+ private ConfigTree config;
+
+ private WsdlLoader(ConfigTree config)
+ {
+ this.config = config;
+ }
+
+ public Properties getActionProperties()
+ {
+ Properties props = new Properties();
+ for ( String key : config.getAttributeNames() )
+ {
+ String value = config.getAttribute(key);
+ if (value != null)
+ {
+ props.setProperty(key, value);
+ }
+ }
+ return props;
+ }
+
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxyWsdlContractPublisher.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list