[jboss-svn-commits] JBL Code SVN: r21005 - in labs/jbossesb/workspace/maeste/product: samples/quickstarts and 26 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jul 11 09:15:29 EDT 2008
Author: maeste
Date: 2008-07-11 09:15:28 -0400 (Fri, 11 Jul 2008)
New Revision: 21005
Added:
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/.ant-targets-build.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/build.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/deployment.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbm-queue-service.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbmq-queue-service.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbossesb-properties.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jndi.properties
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/juddi.properties
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/lib/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/listener.log
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/log4j.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/readme.txt
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/smooks-handler.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyRequestAction.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyResponseAction.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler2.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendEsbMessage.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendJMSMessage.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/lib/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/lib/ext/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/lib/ext/jbossws-client.jar
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/classes/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/lib/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/web.xml
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/HelloWorldWS.java
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/view/
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/view/index.jsp
labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties
Modified:
labs/jbossesb/workspace/maeste/product/.classpath
labs/jbossesb/workspace/maeste/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
Log:
odificationa and quickstart sample supporting custom handlers
Modified: labs/jbossesb/workspace/maeste/product/.classpath
===================================================================
--- labs/jbossesb/workspace/maeste/product/.classpath 2008-07-11 07:29:51 UTC (rev 21004)
+++ labs/jbossesb/workspace/maeste/product/.classpath 2008-07-11 13:15:28 UTC (rev 21005)
@@ -84,5 +84,6 @@
<classpathentry kind="lib" path="lib/ext/jaxr-api-1.0rc1.jar"/>
<classpathentry kind="lib" path="lib/ext/jboss-jaxb-intros.jar"/>
<classpathentry kind="lib" path="lib/ext/scout-1.0rc1.jar"/>
+ <classpathentry kind="lib" path="services/soap/lib/ext/Wise-core.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/.ant-targets-build.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/.ant-targets-build.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/.ant-targets-build.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,10 @@
+Quickstart_webservice_consumer_wise
+clean
+deploy
+deploy-jms-dests
+help
+help-quickstarts
+makewar
+run
+undeploy
+undeploy-jms-dests
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/build.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/build.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/build.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,74 @@
+<project name="Quickstart_webservice_consumer_wise4" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="wise-core.properties,smooks-handler.xml" />
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+
+ <property name="war.build.dir" location="${build.dir}/war/classes"/>
+
+
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+ <target name="quickstart-specific-assemblies" depends="makewar"/>
+
+ <target name="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... -->
+ <war warfile="build/${ant.project.name}.war"
+ webxml="${basedir}/war/resources/WEB-INF/web.xml">
+ <webinf dir="${basedir}/war/resources/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${war.build.dir}" includes="**/*.class"/>
+ <fileset dir="${basedir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ <classes dir="${basedir}">
+ <include name="juddi.properties"/>
+ </classes>
+ </war>
+ </target>
+
+ <target name="deploy-war" depends="prepare-deployment">
+ <copy todir="${org.jboss.esb.server.deploy.dir}"
+ file="${build.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="undeploy-war" depends="dependencies">
+ <delete verbose="true" quiet="true"
+ file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="sendjms" depends="compile">
+ <echo>Send ESB message that triggers webservice call</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.test.SendJMSMessage" failonerror="true">
+ <arg value="Jimbo"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+
+ </target>
+
+ <target name="runtest" depends="compile">
+ <echo>Send ESB message that triggers webservice call</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.test.SendEsbMessage" failonerror="true">
+ <arg value="Jimbo"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+</project>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/deployment.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/deployment.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=soap.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer_wise4_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer_wise4_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_consumer_wise4_Request_gw</depends>
+</jbossesb-deployment>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbm-queue-service.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,21 @@
+<?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_consumer_wise4_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_consumer_wise4_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_consumer_wise4_Request_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbmq-queue-service.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,21 @@
+<?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_consumer_wise4_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_consumer_wise4_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_consumer_wise4_Request_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,67 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+ parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ"
+ connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost">
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_consumer_wise4_Request_gw"
+ />
+ </jms-bus>
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_webservice_consumer_wise4_esb" />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service category="MyServiceCategory" name="Webserviceconsumer_wise4"
+ description="Helloworld Webservice Consumer">
+ <listeners>
+ <jms-listener name="JMS-ESBListener"
+ busidref="quickstartEsbChannel" maxThreads="1" />
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartGwChannel"
+ maxThreads="1"
+ is-gateway="true"
+ />
+
+ </listeners>
+ <actions mep="OneWay">
+ <action name="request-mapper"
+ class="org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.MyRequestAction">
+ </action>
+ <action name="soapui-client-action"
+ class="org.jboss.soa.esb.actions.soap.wise.SOAPClient">
+ <property name="wsdl"
+ value="http://127.0.0.1:8080/Quickstart_webservice_consumer_wise4/HelloWorldWS?wsdl" />
+ <property name="SOAPAction" value="sayHello"/>
+ <property name="EndPointName" value="HelloWorldPort"/>
+ <property name="LoggingMessages" value="true" />
+ <property name="smooks-handler-config" value="smooks-handler.xml"></property>
+ <property name="custom-handlers" value="org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.handler.MyCustomLoggingHandler;org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.handler.MyCustomLoggingHandler2" />
+ <property name="serviceName" value="HelloWorldWS"/>
+ <property name="userName" value=""/>
+ <property name="password" value=""/>
+
+ </action>
+ <action name="response-mapper"
+ class="org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.MyResponseAction">
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jbossesb-properties.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jndi.properties
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/jndi.properties 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/juddi.properties
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/juddi.properties 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/listener.log
===================================================================
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/log4j.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/log4j.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/readme.txt
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/readme.txt (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/readme.txt 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,92 @@
+Overview:
+=========
+ This example demonstrates how to consume a 181 Web Service in an ESB action.
+ This ESB will make a webservice request that requires a single "toWhom" string parameter.
+ The webservice will return a greeting response. The ESB simply dislays the response on the
+ console.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts and a
+ more detailed descripton of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+ This quickstart will not currently run in standalone mode.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant undeploy-jms-dests'.
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type 'ant runtest'.
+ 3. Switch back to Application Server console to see the output from the ESB
+
+ 'runtest' target description:
+ In a separate command prompt window, run "ant runtest" to shoot a JMS message
+ into the listener which will then invoke the MyJMSListenerAction and display
+ it to the console. You can modify the build.xml to change the phrase
+ "Hello World" to something else and re-run "ant runtest".
+
+ You should output that looks like this, after running "ant runtest":
+ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ 12:35:47,975 INFO [STDOUT] Request map is: {sayHello.toWhom=Jimbo}
+ 12:35:47,975 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ 12:35:47,990 WARN [HttpMethodBase] Going to buffer response body of large or unknown size. Using
+ getResponseBodyAsStream instead is recommended.
+ 12:35:47,991 INFO [STDOUT]
+ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ 12:35:47,991 INFO [STDOUT] Response Map is:
+ <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ <env:Header></env:Header>
+ <env:Body>
+ <hel:sayHelloResponse xmlns:hel='http://webservice_consumer1/helloworld'>
+ <return>Hello World Greeting for 'Jimbo' on Sat Jul 14 12:35:47 EDT 2007</return>
+ </hel:sayHelloResponse></env:Body></env:Envelope>
+ 12:35:47,991 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
+
+Project file descriptions:
+==========================
+
+ jboss-esb.xml:
+ There is no JMS gateway in this quickstart. A java client talks directly to the ESB
+ listener queue called "queue/quickstart_webservice_consumer1_esb". The actions in
+ jboss-esb.xml convert the ESB message into to a webservice parameter Map, make a call
+ to the HelloWorldWS webservice, then print the response on the console. Both juddi.properties
+ and jbossesb-properties.xml are used when the service first boots up for self-registration
+ based upon the service-category and service-name found in the esb-config.xml file.
+
+ jndi.properties:
+ Needed primarily for org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendESBMessage that is fired by ant runtest.
+
+ log4j.xml:
+ Needed to configure log4J used by both the quickstart and the ESB itself. A listener needs a place to log.
+
+ src/../SendEsbMessage.java:
+ Send a message directly the the ESB internal JMS listener. Demonstrates how one can bypass the
+ gateway and speak directly to an ESB service.
+
+ src/../MyRequestAction.java
+ Convert the message body into a webservice request parameter Map that only has one paramater called
+ "sayHello.toWhom" for the web service call. The request parameter map is named
+ "helloworld-request-parameters".
+
+ org.jboss.soa.esb.actions.soap.SOAPClient
+ This class is used to make the call to the webservice. It will take the
+ parameters that MyRequestAction set in "paramsLocation", call the webservice, then place
+ the response in "responseLocation". This is zero Java code ESB wiring in jboss-esb.xml.
+
+ src/../MyResponseAction.java
+ Retrieve the webservice response and display it on the console. The response location name
+ is "helloworld-response".
+
+ build.xml:
+ Targets and structure description:
+ * the classpath property pulls the jbossesb-properties.xml file and the juddi.properties file to the
+ front of the list
+ * the echoCP task is useful for making sure what you think is in your classpath is actually in your classpath
+ Usage is: ant echoCP > myclasspath.txt
+ This generates a file called myclasspath.txt which can be reviewed in a text editor
+ * the run task calls the Launcher passing in 3 arguments the most important are the esb-config.xml and
+ esb-config-gateway.xml files
+ * the runtest task calls the org.jboss.soa.esb.samples.quickstart.helloworld.test.SendEsbMessage class and passes in an argument representing
+ the string-based message to be pused into the queue the gateway is listening on.
\ No newline at end of file
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/smooks-handler.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/smooks-handler.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/smooks-handler.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <resource-config selector="header">
+ <resource type="xsl">
+ <![CDATA[
+ <sign:sign xmlns:sign="uri://org.example.webservices.signature.Sign">
+ </sign:sign>
+ ]]>
+ </resource>
+ <param name="is-xslt-templatelet">true</param>
+ <param name="action">addto</param>
+ </resource-config>
+
+</smooks-resource-list>
\ No newline at end of file
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyRequestAction.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyRequestAction.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyRequestAction.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import java.util.HashMap;
+
+public class MyRequestAction extends AbstractActionLifecycle
+{
+ protected ConfigTree _config;
+
+ public MyRequestAction(ConfigTree config)
+ {
+ _config = config;
+ }
+
+ public Message noOperation(Message message)
+ {
+ return message;
+ }
+
+ /*
+ * Convert the message into a webservice request map.
+ */
+ public Message process(Message message) throws Exception
+ {
+ logHeader();
+ String msgBody = (String) message.getBody().get();
+ HashMap requestMap = new HashMap();
+
+ // add paramaters to the web service request map
+ requestMap.put("toWhom", msgBody);
+
+ // The "paramsLocation" property was set in jboss-esb.xml to
+ // "helloworld-request-parameters"
+ message.getBody().add(requestMap);
+ System.out.println("Request map is: " + requestMap.toString());
+
+ logFooter();
+ return message;
+ }
+
+ public void exceptionHandler(Message message, Throwable exception)
+ {
+ logHeader();
+ System.out.println("!ERROR!");
+ System.out.println(exception.getMessage());
+ System.out.println("For Message: ");
+ System.out.println(message.getBody().get());
+ logFooter();
+ }
+
+ // This makes it easier to read on the console
+ private void logHeader()
+ {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+ private void logFooter()
+ {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyResponseAction.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyResponseAction.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/MyResponseAction.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import java.util.Map;
+
+public class MyResponseAction extends AbstractActionLifecycle
+{
+ protected ConfigTree _config;
+
+ public MyResponseAction(ConfigTree config)
+ {
+ _config = config;
+ }
+
+ public Message noOperation(Message message)
+ {
+ return message;
+ }
+
+ /*
+ * Retrieve and output the webservice response.
+ */
+ public Message process(Message message) throws Exception
+ {
+
+ logHeader();
+
+ // The "responseLocation" property was set in jboss-esb.xml to
+ // "helloworld-response"
+ Map responseMsg = (Map) message.getBody().get(Body.DEFAULT_LOCATION);
+ System.out.println("Response Map is: " + responseMsg);
+
+ logFooter();
+ return message;
+ }
+
+ public void exceptionHandler(Message message, Throwable exception)
+ {
+ logHeader();
+ System.out.println("!ERROR!");
+ System.out.println(exception.getMessage());
+ System.out.println("For Message: ");
+ System.out.println(message.getBody().get());
+ logFooter();
+ }
+
+ // This makes it easier to read on the console
+ private void logHeader()
+ {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+ private void logFooter()
+ {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.handler;
+
+import java.io.PrintStream;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * This simple SOAPHandler will output the contents of incoming and outgoing
+ * messages. Check the MESSAGE_OUTBOUND_PROPERTY in the context to see if this
+ * is an outgoing or incoming message. Write a brief message to the print stream
+ * and output the message.
+ *
+ * @author Stefano Maestri, stefano.maestri at javalinux.it
+ */
+public class MyCustomLoggingHandler implements SOAPHandler<SOAPMessageContext> {
+
+ private PrintStream outputStream = System.out;
+
+ /**
+ * Default constructor using default System.out PrintStream to print message
+ */
+ public MyCustomLoggingHandler() {
+
+ }
+
+ /**
+ * Constructor for custom PrintStream outputter
+ *
+ * @param outStream
+ * the PrintStream to use to print messages.
+ */
+ public MyCustomLoggingHandler(PrintStream outStream) {
+ this.outputStream = outStream;
+ }
+
+ public Set<QName> getHeaders() {
+ return null;
+ }
+
+ public boolean handleMessage(SOAPMessageContext smc) {
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public boolean handleFault(SOAPMessageContext smc) {
+ logToSystemOut(smc);
+ return true;
+ }
+
+ // nothing to clean up
+ public void close(MessageContext messageContext) {
+ }
+
+ private void logToSystemOut(SOAPMessageContext smc) {
+ Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ if (outboundProperty.booleanValue()) {
+ outputStream.println("\nMY CUSTOM LOGGING - I got this message:");
+ } else {
+ outputStream.println("\nMY CUSTOM LOGGING - I send this message:");
+ }
+ SOAPMessage message = smc.getMessage();
+ try {
+ message.writeTo(outputStream);
+ outputStream.println(""); // just to add a newline
+ } catch (Exception e) {
+ outputStream.println("Exception in handler: " + e);
+ }
+ }
+
+ /**
+ *
+ * @param outputStream
+ * custom PrintStream outputter
+ */
+ public void setOutputStream(PrintStream outputStream) {
+ this.outputStream = outputStream;
+ }
+}
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler2.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler2.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/handler/MyCustomLoggingHandler2.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.handler;
+
+import java.io.PrintStream;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * This simple SOAPHandler will output the contents of incoming and outgoing
+ * messages. Check the MESSAGE_OUTBOUND_PROPERTY in the context to see if this
+ * is an outgoing or incoming message. Write a brief message to the print stream
+ * and output the message.
+ *
+ * @author Stefano Maestri, stefano.maestri at javalinux.it
+ */
+public class MyCustomLoggingHandler2 implements SOAPHandler<SOAPMessageContext> {
+
+ private PrintStream outputStream = System.out;
+
+ /**
+ * Default constructor using default System.out PrintStream to print message
+ */
+ public MyCustomLoggingHandler2() {
+
+ }
+
+ /**
+ * Constructor for custom PrintStream outputter
+ *
+ * @param outStream
+ * the PrintStream to use to print messages.
+ */
+ public MyCustomLoggingHandler2(PrintStream outStream) {
+ this.outputStream = outStream;
+ }
+
+ public Set<QName> getHeaders() {
+ return null;
+ }
+
+ public boolean handleMessage(SOAPMessageContext smc) {
+ logToSystemOut(smc);
+ return true;
+ }
+
+ public boolean handleFault(SOAPMessageContext smc) {
+ logToSystemOut(smc);
+ return true;
+ }
+
+ // nothing to clean up
+ public void close(MessageContext messageContext) {
+ }
+
+ private void logToSystemOut(SOAPMessageContext smc) {
+ Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ if (outboundProperty.booleanValue()) {
+ outputStream.println("\nMY CUSTOM LOGGING 2 - what a beautiful message I have just received:");
+ } else {
+ outputStream.println("\nMY CUSTOM LOGGING 2 - what a beautiful message I'm ready to send:");
+ }
+ SOAPMessage message = smc.getMessage();
+ try {
+ message.writeTo(outputStream);
+ outputStream.println(""); // just to add a newline
+ } catch (Exception e) {
+ outputStream.println("Exception in handler: " + e);
+ }
+ }
+
+ /**
+ *
+ * @param outputStream
+ * custom PrintStream outputter
+ */
+ public void setOutputStream(PrintStream outputStream) {
+ this.outputStream = outputStream;
+ }
+}
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendEsbMessage.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.test;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
+public class SendEsbMessage
+{
+ /*
+ * Send a message directly the the ESB internal JMS listener. Demonstrates
+ * how one can bypass the gateway and speak directly to an ESB service.
+ */
+ public void sendMessage(String message) throws Exception
+ {
+ // Create the delivery adapter for the target service (cache it)
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass",
+ "org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ // Create the delivery adapter for the target service (cache it)
+ ServiceInvoker deliveryAdapter = new ServiceInvoker("MyServiceCategory",
+ "Webserviceconsumer_wise4");
+
+
+ // Create and populate the request message...
+ Message requestMessage = MessageFactory.getInstance().getMessage(
+ MessageType.JBOSS_XML);
+
+ requestMessage.getBody().add(message);
+
+ // Deliver the request message synchronously - timeout after 20
+ // seconds...
+ deliveryAdapter.deliverAsync(requestMessage);
+ }
+
+ public static void main(String args[]) throws Exception
+ {
+ SendEsbMessage sm = new SendEsbMessage();
+ sm.sendMessage(args[0]);
+ }
+
+}
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer_wise4/test/SendJMSMessage.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise4.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer1_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/lib/ext/jbossws-client.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/lib/ext/jbossws-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/resources/WEB-INF/web.xml 2008-07-11 13:15:28 UTC (rev 21005)
@@ -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_consumer1.HelloWorldWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloWorldWS</servlet-name>
+ <url-pattern>/HelloWorldWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/HelloWorldWS.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/HelloWorldWS.java (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/src/org/jboss/soa/esb/samples/quickstart/webservice_consumer1/HelloWorldWS.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -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-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservice_consumer1;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.WebParam;
+
+ at WebService(name = "HelloWorld", targetNamespace = "http://webservice_consumer_wise4/helloworld")
+public class HelloWorldWS
+{
+ @WebMethod
+ public String sayHello(@WebParam(name = "toWhom")
+ String toWhom)
+ {
+
+ String greeting = "Hello World Greeting for '" + toWhom + "' on " + new java.util.Date();
+
+ return greeting;
+
+ }
+}
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/view/index.jsp
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/view/index.jsp (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/war/view/index.jsp 2008-07-11 13:15:28 UTC (rev 21005)
@@ -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
Added: labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties
===================================================================
--- labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties (rev 0)
+++ labs/jbossesb/workspace/maeste/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties 2008-07-11 13:15:28 UTC (rev 21005)
@@ -0,0 +1,4 @@
+wise.tmpDir=/home/oracle/wise
+wise.forceImportObject=true
+wise.keepGeneratedSources=true
+wise.wsImporter.verbose=true
Modified: labs/jbossesb/workspace/maeste/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
===================================================================
--- labs/jbossesb/workspace/maeste/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2008-07-11 07:29:51 UTC (rev 21004)
+++ labs/jbossesb/workspace/maeste/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2008-07-11 13:15:28 UTC (rev 21005)
@@ -32,13 +32,10 @@
import it.javalinux.wise.core.exceptions.WiseException;
import it.javalinux.wise.core.mapper.SmooksMapper;
import it.javalinux.wise.core.mapper.WiseMapper;
-
-import java.io.PrintStream;
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-
+import javax.xml.ws.handler.Handler;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
@@ -50,14 +47,11 @@
import org.jboss.soa.esb.message.MessagePayloadProxy;
/**
- * SOAP Client action processor. <p/> Uses the Wise Client Service to generate
- * JAXWS client class and call the target service. This action then routes that
- * message to that service.
- *
- *
+ * SOAP Client action processor. <p/> Uses the Wise Client Service to generate JAXWS client class and call the target service.
+ * This action then routes that message to that service.
* <h2>Endpoint Operation Specification</h2>
- * Specifying the endpoint operation is a straightforward task. Simply specify
- * the "wsdl" and "SOAPAction" properties on the SOAPClient action as follows:
+ * Specifying the endpoint operation is a straightforward task. Simply specify the "wsdl" and "SOAPAction" properties on the
+ * SOAPClient action as follows:
*
* <pre>
* <action name="soap-wise-client-action" class="org.jboss.soa.esb.actions.soap.wise.SOAPClient">
@@ -66,258 +60,230 @@
* </action>
* </pre>
*
- * The SOAP operation is derived from the SOAPAction. There are some optional
- * attribute:
+ * The SOAP operation is derived from the SOAPAction. There are some optional attribute:
*
* <pre>
* <property name="EndPointName" value="PingWSPort"/>
* </pre>
*
- * The EndPoint invoked. Webservices can have multiple endpoint. If it's not
- * specified the first specified in wsdl will be used
+ * The EndPoint invoked. Webservices can have multiple endpoint. If it's not specified the first specified in wsdl will be used
*
* <pre>
* <property name="SmooksRequestMapper" value="smooks-request-config.xml"/>
* </pre>
*
- * It's a smooks config file to define the mapping java-to-java defined for the
- * request
+ * It's a smooks config file to define the mapping java-to-java defined for the request
*
* <pre>
* <property name="SmooksResponseMapper" value="smooks-response-config.xml"/>
* </pre>
*
- * It's a smooks config file to define the mapping java-to-java defined for the
- * response
+ * It's a smooks config file to define the mapping java-to-java defined for the response
*
* <pre>
* <property name="serviceName" value="PingWS"/>
* </pre>
*
- * It's a symbolic service name used by wise to cache object generation and/or
- * use already generated object. It it isn't provided wise use the servlet name
- * of wsdl.
+ * It's a symbolic service name used by wise to cache object generation and/or use already generated object. It it isn't provided
+ * wise use the servlet name of wsdl.
*
* <pre>
* <property name="userName" value=""/>
* <property name="password" value=""/>
* </pre>
*
- * User and password used if webservice is protected by BAsic Authentication
- * HTTP user and password
- *
- *
+ * User and password used if webservice is protected by BAsic Authentication HTTP user and password
* <h2 id="request-construction">SOAP Request Message Construction</h2>
* The SOAP operation parameters are supplied in one of 2 ways:
* <ol>
- * <li>As a {@link Map} instance set on the <i>default body location</i>
- * (Message.getBody().add(Map))</li>
- * <li>As a {@link Map} instance set on in a <i>named body location</i>
- * (Message.getBody().add(String, Map)), where the name of that body location is
- * specified as the value of the "paramsLocation" action property. </li>
+ * <li>As a {@link Map} instance set on the <i>default body location</i> (Message.getBody().add(Map))</li>
+ * <li>As a {@link Map} instance set on in a <i>named body location</i> (Message.getBody().add(String, Map)), where the name of
+ * that body location is specified as the value of the "paramsLocation" action property. </li>
* </ol>
* The parameter {@link Map} itself can also be populated in one of 2 ways:
* <ol>
- * <li><b>Option 1</b>: With a set of Objects of any type. In this case a
- * smooks config have to be specified in action attribute SmooksRequestMapper
- * and smooks is used to make the java-to-java conversion
- * <li><b>Option 2</b>: With a set of String based key-value pairs(<String,
- * Object>), where the key is the name of the SOAP parameter as specified in
- * wsdls (or in generated class) to be populated with the key's value. </li>
+ * <li><b>Option 1</b>: With a set of Objects of any type. In this case a smooks config have to be specified in action attribute
+ * SmooksRequestMapper and smooks is used to make the java-to-java conversion
+ * <li><b>Option 2</b>: With a set of String based key-value pairs(<String, Object>), where the key is the name of the
+ * SOAP parameter as specified in wsdls (or in generated class) to be populated with the key's value. </li>
* </ol>
- *
- *
* <h2>SOAP Response Message Consumption</h2>
- * The SOAP response object instance can be is attached to the ESB
- * {@link Message} instance in one of the following ways:
+ * The SOAP response object instance can be is attached to the ESB {@link Message} instance in one of the following ways:
* <ol>
* <li>On the <i>default body location</i> (Message.getBody().add(Map))</li>
- * <li>On in a <i>named body location</i> (Message.getBody().add(String,
- * Map)), where the name of that body location is specified as the value of the
- * "responseLocation" action property. </li>
+ * <li>On in a <i>named body location</i> (Message.getBody().add(String, Map)), where the name of that body location is
+ * specified as the value of the "responseLocation" action property. </li>
* </ol>
- * The response object instance can also be populated (from the SOAP response)
- * in one of 3 ways:
+ * The response object instance can also be populated (from the SOAP response) in one of 3 ways:
* <ol>
- * <li><b>Option 1</b>: With a set of Objects of any type. In this case a
- * smooks config have to be specified in action attribute SmooksResponseMapper
- * and smooks is used to make the java-to-java conversion
- * <li><b>Option 2</b>: With a set of String based key-value pairs(<String,
- * Object>), where the key is the name of the SOAP answer as specified in
- * wsdls (or in generated class) to be populated with the key's value. </li>
- *
+ * <li><b>Option 1</b>: With a set of Objects of any type. In this case a smooks config have to be specified in action attribute
+ * SmooksResponseMapper and smooks is used to make the java-to-java conversion
+ * <li><b>Option 2</b>: With a set of String based key-value pairs(<String, Object>), where the key is the name of the
+ * SOAP answer as specified in wsdls (or in generated class) to be populated with the key's value. </li>
* </ol>
- *
- *
* <h2>JAX-WS Handler for the SOAP Request/Response Message</h2>
- * It's often necessary to be able to transform the SOAP request or response,
- * especially in header. This may be to simply add some standard SOAP handlers.
- * Wise support JAXWS Soap Handler, both custom or a predefined one based on
- * smooks. Current implementation of the action have some limitation: support
- * only smooks ones and all handler is intended to transform both input and
- * output messages. These limitations will be removed in future. <p/>
- * Transformation of the SOAP request (before sending) is supported by
- * configuring the SOAPClient action with a Smooks transformation configuration
- * property as follows:
+ * It's often necessary to be able to transform the SOAP request or response, especially in header. This may be to simply add some
+ * standard SOAP handlers. Wise support JAXWS Soap Handler, both custom or a predefined one based on smooks. Current
+ * implementation of the action have some limitation: support only smooks ones and all handler is intended to transform both input
+ * and output messages. These limitations will be removed in future. <p/> Transformation of the SOAP request (before sending) is
+ * supported by configuring the SOAPClient action with a Smooks transformation configuration property as follows:
*
* <pre>
* <property name="smooksTransform" value="/transforms/order-transform.xml" />
* </pre>
*
- * The value of the "smooksTransform" property is resolved by first checking it
- * as a filesystem based resource. Failing that, it's checked as a classpath
- * resource and failing that, as a URI based resource.
- *
+ * The value of the "smooksTransform" property is resolved by first checking it as a filesystem based resource. Failing that, it's
+ * checked as a classpath resource and failing that, as a URI based resource.
* <h2>Logging the SOAP Request/Response Message</h2>
- * It's useful for debug purpose to view soap Message sent and response
- * received. Wise achieve this goal using a JAX-WS handler printing all messages
- * exchanged on System.out You can enable as follow:
+ * It's useful for debug purpose to view soap Message sent and response received. Wise achieve this goal using a JAX-WS handler
+ * printing all messages exchanged on System.out You can enable as follow:
*
* <pre>
* <property name="LoggingMessages" value="true" />
* </pre>
*
- * @author <a
- * href="mailto:stefano.maestri at javalinux.it">stefano.maestri at javalinux.it</a>
+ * @author <a href="mailto:stefano.maestri at javalinux.it">stefano.maestri at javalinux.it</a>
*/
public class SOAPClient extends AbstractActionPipelineProcessor {
- private Logger logger = Logger.getLogger(SOAPClient.class);
- private String wsdl;
- private String soapAction;
- private String endPointName;
- private String smooksRequestMapperURL;
- private String smooksResponseMapperURL;
- private String serviceName;
- private String username;
- private String password;
- // private WSDynamicClient client;
- private List<String> smooksHandler = new ArrayList<String>();
- private MessagePayloadProxy payloadProxy;
- private boolean loggingEnabled = false;
+ private final Logger logger = Logger.getLogger(SOAPClient.class);
+ private final String wsdl;
+ private final String soapAction;
+ private final String endPointName;
+ private final String smooksRequestMapperURL;
+ private final String smooksResponseMapperURL;
+ private String serviceName;
+ private final String username;
+ private final String password;
+ // private WSDynamicClient client;
+ private final List<String> smooksHandler = new ArrayList<String>();
+ private final List<String> customHandlers = new ArrayList<String>();
+ private final MessagePayloadProxy payloadProxy;
+ private boolean loggingEnabled = false;
- public SOAPClient(ConfigTree config) throws ConfigurationException {
- wsdl = config.getRequiredAttribute("wsdl");
- soapAction = config.getRequiredAttribute("SOAPAction");
- endPointName = config.getRequiredAttribute("EndPointName");
- smooksRequestMapperURL = config.getAttribute("SmooksRequestMapper");
- smooksResponseMapperURL = config.getAttribute("SmooksResponseMapper");
- serviceName = config.getAttribute("serviceName");
- serviceName = serviceName != null ? serviceName : wsdl.substring(wsdl
- .lastIndexOf("/"), wsdl.lastIndexOf("?"));
- username = config.getAttribute("username");
- password = config.getAttribute("password");
- logger.info(config.getAttribute("LoggingMessages"));
- loggingEnabled = Boolean.parseBoolean(config
- .getAttribute("LoggingMessages"));
- logger.info("loggingEnabled:" + loggingEnabled);
- ConfigTree[] handlersConfig;
- if (config.getAttribute("smooks-handler-config") != null) {
- smooksHandler.add(config.getAttribute("smooks-handler-config"));
- }
- handlersConfig = config.getChildren("smooks-handlers");
- for (ConfigTree handler : handlersConfig) {
+ public SOAPClient( ConfigTree config ) throws ConfigurationException {
+ wsdl = config.getRequiredAttribute("wsdl");
+ soapAction = config.getRequiredAttribute("SOAPAction");
+ endPointName = config.getRequiredAttribute("EndPointName");
+ smooksRequestMapperURL = config.getAttribute("SmooksRequestMapper");
+ smooksResponseMapperURL = config.getAttribute("SmooksResponseMapper");
+ serviceName = config.getAttribute("serviceName");
+ serviceName = serviceName != null ? serviceName : wsdl.substring(wsdl.lastIndexOf("/"), wsdl.lastIndexOf("?"));
+ username = config.getAttribute("username");
+ password = config.getAttribute("password");
+ logger.info(config.getAttribute("LoggingMessages"));
+ loggingEnabled = Boolean.parseBoolean(config.getAttribute("LoggingMessages"));
+ logger.info("loggingEnabled:" + loggingEnabled);
+ ConfigTree[] handlersConfig;
+ if (config.getAttribute("smooks-handler-config") != null) {
+ smooksHandler.add(config.getAttribute("smooks-handler-config"));
+ }
+ if (config.getAttribute("custom-handlers") != null) {
+ for (String className : config.getAttribute("custom-handlers").split(";")) {
+ customHandlers.add(className);
+ }
- smooksHandler.add(handler.getAttribute("smooks-handler-config"));
- logger.info("added:"
- + handler.getAttribute("smooks-handler-config"));
- }
- payloadProxy = new MessagePayloadProxy(config);
+ }
+ handlersConfig = config.getChildren("custom-handlers");
- }
+ payloadProxy = new MessagePayloadProxy(config);
- public void initialise() throws ActionLifecycleException {
- super.initialise();
- try {
- WSDynamicClientFactory.getInstace().clearCache();
- } catch (Exception e) {
- throw new ActionLifecycleException(
- "Error durinfg wise client cache cleaning", e);
- }
+ }
- }
+ @Override
+ public void initialise() throws ActionLifecycleException {
+ super.initialise();
+ try {
+ WSDynamicClientFactory.getInstace().clearCache();
+ } catch (Exception e) {
+ throw new ActionLifecycleException("Error durinfg wise client cache cleaning", e);
+ }
- @Override
- public void destroy() throws ActionLifecycleException {
- // nop
- }
+ }
- public Message process(final Message message)
- throws ActionProcessingException {
- Map params;
- WSDynamicClient client = null;
- try {
- client = WSDynamicClientFactory.getInstace().getClient(wsdl,
- serviceName, username, password);
- } catch (Exception e) {
- e.printStackTrace();
- throw new ActionProcessingException(
- "Error durinfg wise client creation", e);
- }
+ @Override
+ public void destroy() throws ActionLifecycleException {
+ // nop
+ }
- try {
- params = (Map) payloadProxy.getPayload(message);
- } catch (MessageDeliverException e) {
- throw new ActionProcessingException(
- "Could not locate SOAP message parameters from payload", e);
- }
+ public Message process( final Message message ) throws ActionProcessingException {
+ Map params;
+ WSDynamicClient client = null;
+ try {
+ client = WSDynamicClientFactory.getInstace().getClient(wsdl, serviceName, username, password);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new ActionProcessingException("Error durinfg wise client creation", e);
+ }
- if (params.isEmpty()) {
- logger.warn("Params Map found in message, but the map is empty.");
- }
- Map<String, WSEndpoint> endpointsMap = client.processEndpoints();
- WSEndpoint endpoint;
- if (endPointName != null) {
- endpoint = endpointsMap.get(endPointName);
- } else {
- endpoint = endpointsMap.values().iterator().next();
- }
+ try {
+ params = (Map)payloadProxy.getPayload(message);
+ } catch (MessageDeliverException e) {
+ throw new ActionProcessingException("Could not locate SOAP message parameters from payload", e);
+ }
- for (String config : smooksHandler) {
- logger.info("adding smmoks handler:" + config);
- endpoint.addHandler(new SmooksHandler(config, params));
- }
+ if (params.isEmpty()) {
+ logger.warn("Params Map found in message, but the map is empty.");
+ }
+ Map<String, WSEndpoint> endpointsMap = client.processEndpoints();
+ WSEndpoint endpoint;
+ if (endPointName != null) {
+ endpoint = endpointsMap.get(endPointName);
+ } else {
+ endpoint = endpointsMap.values().iterator().next();
+ }
- if (loggingEnabled) {
- logger.info("adding logging handler");
- endpoint.addHandler(new LoggingHandler());
- }
+ for (String config : smooksHandler) {
+ logger.info("adding smooks handler:" + config);
+ endpoint.addHandler(new SmooksHandler(config, params));
+ }
- Map<String, WSMethod> wsmethodsMap = endpoint.getWSMethods();
+ for (String config : customHandlers) {
+ logger.info("adding custom handler:" + config);
+ try {
+ Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(config);
+ endpoint.addHandler((Handler)clazz.newInstance());
+ } catch (Exception e) {
+ logger.info("Failed during custom handler addition:" + e.getLocalizedMessage());
+ }
+ }
- InvocationResult result;
- try {
- WiseMapper mapper = null;
- if (this.smooksRequestMapperURL != null) {
- mapper = new SmooksMapper(this.smooksRequestMapperURL,
- "smook/report/report.html");
- }
- result = wsmethodsMap.get(this.soapAction).invoke(params, mapper);
- } catch (WiseException e) {
- throw new ActionProcessingException("Could not call method"
- + this.soapAction, e);
- }
- System.out.println("#3:" + result.getType());
- System.out.println("#3:" + result.getValue());
+ if (loggingEnabled) {
+ logger.info("adding logging handler");
+ endpoint.addHandler(new LoggingHandler());
+ }
- WiseMapper mapper = null;
- if (this.smooksResponseMapperURL != null) {
- mapper = new SmooksMapper(this.smooksResponseMapperURL,
- "smook/report/report.html");
- }
- result.setMapper(mapper);
+ Map<String, WSMethod> wsmethodsMap = endpoint.getWSMethods();
- // And process the response into the message...
+ InvocationResult result;
+ try {
+ WiseMapper mapper = null;
+ if (this.smooksRequestMapperURL != null) {
+ mapper = new SmooksMapper(this.smooksRequestMapperURL, "smook/report/report.html");
+ }
+ result = wsmethodsMap.get(this.soapAction).invoke(params, mapper);
+ } catch (WiseException e) {
+ throw new ActionProcessingException("Could not call method" + this.soapAction, e);
+ }
+ System.out.println("#3:" + result.getType());
+ System.out.println("#3:" + result.getValue());
- try {
- System.out.println("#4:" + (result.getMappedResult()).toString());
- payloadProxy.setPayload(message, result.getMappedResult());
- } catch (Exception e) {
- throw new ActionProcessingException(
- "Could not set payload to SOAP message", e);
- }
+ WiseMapper mapper = null;
+ if (this.smooksResponseMapperURL != null) {
+ mapper = new SmooksMapper(this.smooksResponseMapperURL, "smook/report/report.html");
+ }
+ result.setMapper(mapper);
- return message;
- }
+ // And process the response into the message...
+ try {
+ System.out.println("#4:" + (result.getMappedResult()).toString());
+ payloadProxy.setPayload(message, result.getMappedResult());
+ } catch (Exception e) {
+ throw new ActionProcessingException("Could not set payload to SOAP message", e);
+ }
+
+ return message;
+ }
+
}
More information about the jboss-svn-commits
mailing list