[jboss-svn-commits] JBL Code SVN: r24723 - in labs/jbossesb/trunk/product: samples/quickstarts/webservice_consumer_wise and 8 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jan 14 18:08:46 EST 2009
Author: maeste
Date: 2009-01-14 18:08:46 -0500 (Wed, 14 Jan 2009)
New Revision: 24723
Added:
labs/jbossesb/trunk/product/services/soap/lib/ext/wise-core.jar
labs/jbossesb/trunk/product/services/soap/src/main/resources/wise-config.beans/
labs/jbossesb/trunk/product/services/soap/src/main/resources/wise-config.beans/META-INF/
labs/jbossesb/trunk/product/services/soap/src/main/resources/wise-config.beans/META-INF/jboss-beans.xml
Removed:
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/wise-core.properties
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/wise-core.properties
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/wise-core.properties
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties
labs/jbossesb/trunk/product/services/soap/lib/ext/Wise-core.jar
Modified:
labs/jbossesb/trunk/product/.classpath
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-config-XMLGregorianCalendar.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-response-config.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
Log:
JBESB-2275: wise 1.0 is integrated and all samples works like previus version. Just a problem in a smooks mapping, to be reviewd in sample 2 for which I've already opened an issue
Modified: labs/jbossesb/trunk/product/.classpath
===================================================================
--- labs/jbossesb/trunk/product/.classpath 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/.classpath 2009-01-14 23:08:46 UTC (rev 24723)
@@ -15,6 +15,7 @@
<classpathentry excluding="**/.svn/" kind="src" path="rosetta/tests/src"/>
<classpathentry kind="src" path="services/soap/src/main/java"/>
<classpathentry kind="src" path="services/soap/src/test/java"/>
+ <classpathentry kind="src" path="services/soapui-client/src/main/java"/>
<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/ext/activation.jar"/>
@@ -85,6 +86,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="lib" path="services/soap/lib/ext/wise-core.jar" sourcepath="/wise-core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/build.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/build.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -5,8 +5,6 @@
${line.separator}
</description>
- <property name="additional.deploys" value="wise-core.properties" />
-
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
@@ -16,7 +14,7 @@
<target name="quickstart-specific-checks" depends="assert-ws-available"/>
- <target name="quickstart-specific-assemblies" depends="makewar"/>
+ <target name="quickstart-specific-assemblies" />
<target name="makewar" description="make war">
<!-- Compile... -->
@@ -44,7 +42,7 @@
</war>
</target>
- <target name="deploy-war" depends="prepare-deployment">
+ <target name="deploy-war" depends="prepare-deployment, makewar">
<copy todir="${org.jboss.esb.server.deploy.dir}"
file="${build.dir}/${ant.project.name}.war"/>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/jboss-esb.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/jboss-esb.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -46,7 +46,7 @@
<property name="SOAPAction" value="sayHello"/>
<property name="EndPointName" value="HelloWorldPort"/>
- <property name="serviceName" value="HelloWorldWS"/>
+ <property name="serviceName" value="HelloWorldWSService"/>
<property name="userName" value=""/>
<property name="password" value=""/>
</action>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/wise-core.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/wise-core.properties 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise/wise-core.properties 2009-01-14 23:08:46 UTC (rev 24723)
@@ -1,4 +0,0 @@
-wise.tmpDir=/home/oracle/wise
-wise.forceImportObject=true
-wise.keepGeneratedSources=true
-wise.wsImporter.verbose=true
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/build.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/build.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -5,7 +5,7 @@
${line.separator}
</description>
- <property name="additional.deploys" value="wise-core.properties,smooks-config-XMLGregorianCalendar.xml,smooks-response-config.xml" />
+ <property name="additional.deploys" value="smooks-config-XMLGregorianCalendar.xml,smooks-response-config.xml" />
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
@@ -16,7 +16,7 @@
<target name="quickstart-specific-checks" depends="assert-ws-available"/>
- <target name="quickstart-specific-assemblies" depends="makewar"/>
+ <target name="quickstart-specific-assemblies" />
<target name="makewar" description="make war">
<!-- Compile... -->
@@ -44,7 +44,7 @@
</war>
</target>
- <target name="deploy-war" depends="prepare-deployment">
+ <target name="deploy-war" depends="prepare-deployment, makewar">
<copy todir="${org.jboss.esb.server.deploy.dir}"
file="${build.dir}/${ant.project.name}.war"/>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/jboss-esb.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/jboss-esb.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -48,7 +48,7 @@
<property name="SmooksRequestMapper" value="smooks-config-XMLGregorianCalendar.xml"/>
<property name="SmooksResponseMapper" value="smooks-response-config.xml"/>
<property name="LoggingMessages" value="false" />
- <property name="serviceName" value="PingWS"/>
+ <property name="serviceName" value="PingWSService"/>
<property name="userName" value=""/>
<property name="password" value=""/>
</action>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-config-XMLGregorianCalendar.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-config-XMLGregorianCalendar.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-config-XMLGregorianCalendar.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -8,7 +8,7 @@
<resource-config selector="org.jboss.soa.esb.samples.quickstart.webservice__consumer__wise2.ExternalObject">
<resource>org.milyn.javabean.BeanPopulator</resource>
<param name="beanId">complexObject</param>
- <param name="beanClass">it.javalinux.wise.ComplexObject</param>
+ <param name="beanClass">webservice_consumer_wise2.pingws.ComplexObject</param>
<param name="bindings">
<binding property="integerField" type="Integer" selector="internal number" />
<binding property="stringField" selector="internal text" />
@@ -16,7 +16,7 @@
</param>
</resource-config>
<resource-config selector="decoder:XMLGregorianCalendar">
- <resource>it.javalinux.wise.smooks.decoders.XMLGregorianCalendarDecoder</resource>
+ <resource>org.jboss.wise.smooks.decoders.XMLGregorianCalendarDecoder</resource>
<param name="format">yyyy-MM-dd HH:mm:ss.S z</param>
</resource-config>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-response-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-response-config.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/smooks-response-config.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -5,7 +5,7 @@
<param name="stream.filter.type">SAX</param>
</resource-config>
- <resource-config selector="it.javalinux.wise.ComplexObject">
+ <resource-config selector="webservice_consumer_wise2.pingws.ComplexObject">
<resource>org.milyn.javabean.BeanPopulator</resource>
<param name="beanId">ExternalObject</param>
<param name="beanClass">org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise2.ExternalObject</param>
@@ -15,7 +15,7 @@
</param>
</resource-config>
- <resource-config selector="it.javalinux.wise.ComplexObject">
+ <resource-config selector="webservice_consumer_wise2.pingws.ComplexObject">
<resource>org.milyn.javabean.BeanPopulator</resource>
<param name="beanId">InternalObject</param>
<param name="beanClass">org.jboss.soa.esb.samples.quickstart.webservice_consumer_wise2.InternalObject</param>
@@ -25,7 +25,7 @@
</param>
</resource-config>
- <resource-config selector="it.javalinux.wise.ComplexObject">
+ <resource-config selector="webservice_consumer_wise2.pingws.ComplexObject">
<resource>org.milyn.javabean.BeanPopulator</resource>
<param name="beanId">messageDate</param>
<param name="beanClass">java.util.HashMap</param>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/wise-core.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/wise-core.properties 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise2/wise-core.properties 2009-01-14 23:08:46 UTC (rev 24723)
@@ -1,4 +0,0 @@
-wise.tmpDir=/home/oracle/wise
-wise.forceImportObject=true
-wise.keepGeneratedSources=true
-wise.wsImporter.verbose=true
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/build.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/build.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -5,7 +5,7 @@
${line.separator}
</description>
- <property name="additional.deploys" value="wise-core.properties,smooks-handler.xml" />
+ <property name="additional.deploys" value="smooks-handler.xml" />
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
@@ -16,7 +16,7 @@
<target name="quickstart-specific-checks" depends="assert-ws-available"/>
- <target name="quickstart-specific-assemblies" depends="makewar"/>
+ <target name="quickstart-specific-assemblies" />
<target name="makewar" description="make war">
<!-- Compile... -->
@@ -44,7 +44,7 @@
</war>
</target>
- <target name="deploy-war" depends="prepare-deployment">
+ <target name="deploy-war" depends="prepare-deployment, makewar">
<copy todir="${org.jboss.esb.server.deploy.dir}"
file="${build.dir}/${ant.project.name}.war"/>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/jboss-esb.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/jboss-esb.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -48,7 +48,7 @@
<property name="LoggingMessages" value="true" />
<property name="smooks-handler-config" value="smooks-handler.xml"></property>
- <property name="serviceName" value="HelloWorldWS"/>
+ <property name="serviceName" value="HelloWorldWSService"/>
<property name="userName" value=""/>
<property name="password" value=""/>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/wise-core.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/wise-core.properties 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise3/wise-core.properties 2009-01-14 23:08:46 UTC (rev 24723)
@@ -1,4 +0,0 @@
-wise.tmpDir=/home/oracle/wise
-wise.forceImportObject=true
-wise.keepGeneratedSources=true
-wise.wsImporter.verbose=true
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/build.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/build.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -16,7 +16,7 @@
<target name="quickstart-specific-checks" depends="assert-ws-available"/>
- <target name="quickstart-specific-assemblies" depends="makewar"/>
+ <target name="quickstart-specific-assemblies" />
<target name="makewar" description="make war">
<!-- Compile... -->
@@ -44,7 +44,7 @@
</war>
</target>
- <target name="deploy-war" depends="prepare-deployment">
+ <target name="deploy-war" depends="prepare-deployment, makewar">
<copy todir="${org.jboss.esb.server.deploy.dir}"
file="${build.dir}/${ant.project.name}.war"/>
</target>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/jboss-esb.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -48,7 +48,7 @@
<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="serviceName" value="HelloWorldWSService"/>
<property name="userName" value=""/>
<property name="password" value=""/>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_consumer_wise4/wise-core.properties 2009-01-14 23:08:46 UTC (rev 24723)
@@ -1,4 +0,0 @@
-wise.tmpDir=/home/oracle/wise
-wise.forceImportObject=true
-wise.keepGeneratedSources=true
-wise.wsImporter.verbose=true
Deleted: labs/jbossesb/trunk/product/services/soap/lib/ext/Wise-core.jar
===================================================================
(Binary files differ)
Added: labs/jbossesb/trunk/product/services/soap/lib/ext/wise-core.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/services/soap/lib/ext/wise-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2009-01-14 23:04:33 UTC (rev 24722)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2009-01-14 23:08:46 UTC (rev 24723)
@@ -22,22 +22,10 @@
package org.jboss.soa.esb.actions.soap.wise;
-import it.javalinux.wise.core.client.InvocationResult;
-import it.javalinux.wise.core.client.WSDynamicClient;
-import it.javalinux.wise.core.client.WSDynamicClientFactory;
-import it.javalinux.wise.core.client.WSEndpoint;
-import it.javalinux.wise.core.client.WSMethod;
-import it.javalinux.wise.core.client.handler.LoggingHandler;
-import it.javalinux.wise.core.client.handler.SmooksHandler;
-import it.javalinux.wise.core.exceptions.WiseException;
-import it.javalinux.wise.core.mapper.SmooksMapper;
-import it.javalinux.wise.core.mapper.WiseMapper;
-import it.javalinux.wise.core.utils.SmooksCache;
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;
import org.jboss.soa.esb.actions.ActionLifecycleException;
@@ -46,11 +34,24 @@
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.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSEndpoint;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.handlers.LoggingHandler;
+import org.jboss.wise.core.handlers.SmooksHandler;
+import org.jboss.wise.core.mapper.SmooksMapper;
+import org.jboss.wise.core.mapper.WiseMapper;
+import org.apache.log4j.Logger;
/**
- * 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:
+ * 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:
*
* <pre>
* <action name="soap-wise-client-action" class="org.jboss.soa.esb.actions.soap.wise.SOAPClient">
@@ -121,8 +122,10 @@
* </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. <p/> Transformation of the SOAP request (before sending) is supported by
- * configuring the SOAPClient action with a Smooks transformation configuration property as follows:
+ * custom or a predefined one based on smooks.
+ * <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" />
@@ -149,227 +152,178 @@
*
* @author <a href="mailto:stefano.maestri at javalinux.it">stefano.maestri at javalinux.it</a>
*/
-public class SOAPClient extends AbstractActionPipelineProcessor
-{
+public class SOAPClient extends AbstractActionPipelineProcessor {
- 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;
- private String smooksRequestReport = null;
- private String smooksResponseReport = null;
+ 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;
+ private String smooksRequestReport = null;
+ private String smooksResponseReport = null;
- private WSMethod method = null;
- private WSEndpoint endpoint;
+ private WSMethod method = null;
+ private WSEndpoint endpoint;
- 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");
- smooksRequestReport = config.getAttribute("smooksRequestReport");
- smooksResponseReport = config.getAttribute("smooksResponseReport");
- 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);
- }
+ 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");
+ smooksRequestReport = config.getAttribute("smooksRequestReport");
+ smooksResponseReport = config.getAttribute("smooksResponseReport");
+ 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);
+ }
- }
- handlersConfig = config.getChildren("custom-handlers");
+ }
+ handlersConfig = config.getChildren("custom-handlers");
- payloadProxy = new MessagePayloadProxy(config);
+ payloadProxy = new MessagePayloadProxy(config);
- }
+ }
- @Override
- public void initialise() throws ActionLifecycleException
- {
- super.initialise();
- try
- {
- WSDynamicClientFactory.getInstace().clearCache();
- SmooksCache.getInstance().clear();
- Object params;
- WSDynamicClient client = null;
- // get client from cache
- 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 initialise() throws ActionLifecycleException {
+ super.initialise();
+ try {
+ WSDynamicClientFactory.initialise();
+ Object params;
+ WSDynamicClient client = null;
+ // get client from cache
+ try {
+ client = WSDynamicClientFactory.getInstance().getJAXWSClient(wsdl, username, password);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new ActionProcessingException("Error durinfg wise client creation", e);
+ }
- Map<String, WSEndpoint> endpointsMap = client.processEndpoints();
- if (endPointName != null)
- {
- this.setEndpoint(endpointsMap.get(endPointName));
- }
- else
- {
- this.setEndpoint(endpointsMap.values().iterator().next());
- }
+ this.setMethod(client.getWSMethod(this.serviceName, this.endPointName, this.soapAction));
+ this.setEndpoint(this.getMethod().getEndpoint());
- for (String config : customHandlers)
- {
- logger.info("adding custom handler:" + config);
- try
- {
- Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(config);
- this.getEndpoint().addHandler((Handler)clazz.newInstance());
+ for (String config : customHandlers) {
+ logger.info("adding custom handler:" + config);
+ try {
+ Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(config);
+ this.getEndpoint().addHandler((Handler)clazz.newInstance());
+ } catch (Exception e) {
+ logger.info("Failed during custom handler addition:" + e.getLocalizedMessage());
+ }
}
- catch (Exception e)
- {
- logger.info("Failed during custom handler addition:" + e.getLocalizedMessage());
+
+ if (loggingEnabled) {
+ logger.info("adding logging handler");
+ this.getEndpoint().addHandler(new LoggingHandler());
}
- }
- if (loggingEnabled)
- {
- logger.info("adding logging handler");
- this.getEndpoint().addHandler(new LoggingHandler());
- }
-
- this.getEndpoint().setUsername(username);
- this.getEndpoint().setPassword(password);
-
+ // this.getEndpoint().setUsername(username);
+ // this.getEndpoint().setPassword(password);
- Map<String, WSMethod> wsmethodsMap = this.getEndpoint().getWSMethods();
- this.setMethod(wsmethodsMap.get(this.soapAction));
+ } catch (Exception e) {
+ throw new ActionLifecycleException("Error durinfg wise client cache cleaning", e);
+ }
- }
- catch (Exception e)
- {
- throw new ActionLifecycleException("Error durinfg wise client cache cleaning", e);
- }
+ }
- }
+ @Override
+ public void destroy() throws ActionLifecycleException {
+ // nop
+ }
- @Override
- public void destroy() throws ActionLifecycleException
- {
- // nop
- }
+ public Message process( final Message message ) throws ActionProcessingException {
+ Object params;
+ WiseMapper responseMapper = null;
+ WiseMapper requestMapper = null;
- public Message process(final Message message) throws ActionProcessingException
- {
- Object params;
- WiseMapper responseMapper = null;
- WiseMapper requestMapper = null;
+ if (this.smooksRequestMapperURL != null) {
+ requestMapper = new SmooksMapper(this.smooksRequestMapperURL, this.smooksRequestReport);
+ }
- if (this.smooksRequestMapperURL != null)
- {
- requestMapper = new SmooksMapper(this.smooksRequestMapperURL, this.smooksRequestReport);
- }
+ if (this.smooksResponseMapperURL != null) {
+ responseMapper = new SmooksMapper(this.smooksResponseMapperURL, this.smooksResponseReport);
+ }
- if (this.smooksResponseMapperURL != null)
- {
- responseMapper = new SmooksMapper(this.smooksResponseMapperURL, this.smooksResponseReport);
- }
+ try {
+ params = payloadProxy.getPayload(message);
+ } catch (MessageDeliverException e) {
+ throw new ActionProcessingException("Could not locate SOAP message parameters from payload", e);
+ }
- try
- {
- params = 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 smooks handler:" + config);
+ if (params instanceof Map) {
+ this.getEndpoint().addHandler(new SmooksHandler(config, (Map)params));
+ } else {
+ this.getEndpoint().addHandler(new SmooksHandler(config, null));
+ }
+ }
- for (String config : smooksHandler)
- {
- logger.info("adding smooks handler:" + config);
- if (params instanceof Map)
- {
- this.getEndpoint().addHandler(new SmooksHandler(config, (Map)params));
- }
- else
- {
- this.getEndpoint().addHandler(new SmooksHandler(config, null));
- }
- }
+ InvocationResult result = null;
+ try {
+ result = this.getMethod().invoke(params, requestMapper);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new ActionProcessingException("Could not call method" + this.soapAction, e);
+ }
- InvocationResult result = null;
- try
- {
- result = this.getMethod().invoke(params, requestMapper);
- }
- catch (WiseException e)
- {
- throw new ActionProcessingException("Could not call method" + this.soapAction, e);
- }
+ try {
+ Map map = result.getMapRequestAndResult(responseMapper, (Map)params);
+ payloadProxy.setPayload(message, map);
+ } catch (Exception e) {
+ throw new ActionProcessingException("Could not set payload to SOAP message", e);
+ }
- try
- {
- Map map = result.getMappedResult(responseMapper, (Map)params);
- payloadProxy.setPayload(message, map);
- }
- catch (Exception e)
- {
- throw new ActionProcessingException("Could not set payload to SOAP message", e);
- }
+ return message;
+ }
- return message;
- }
+ /**
+ * @return the method
+ */
+ public synchronized WSMethod getMethod() {
+ return method;
+ }
- /**
- * @return the method
- */
- public synchronized WSMethod getMethod()
- {
- return method;
- }
+ /**
+ * @param method the method to set
+ */
+ public synchronized void setMethod( WSMethod method ) {
+ this.method = method;
+ }
- /**
- * @param method the method to set
- */
- public synchronized void setMethod(WSMethod method)
- {
- this.method = method;
- }
+ /**
+ * @return the endpoint
+ */
+ public synchronized WSEndpoint getEndpoint() {
+ return endpoint;
+ }
- /**
- * @return the endpoint
- */
- public synchronized WSEndpoint getEndpoint()
- {
- return endpoint;
- }
+ /**
+ * @param endpoint the endpoint to set
+ */
+ public synchronized void setEndpoint( WSEndpoint endpoint ) {
+ this.endpoint = endpoint;
+ }
- /**
- * @param endpoint the endpoint to set
- */
- public synchronized void setEndpoint(WSEndpoint endpoint)
- {
- this.endpoint = endpoint;
- }
-
}
Added: labs/jbossesb/trunk/product/services/soap/src/main/resources/wise-config.beans/META-INF/jboss-beans.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/resources/wise-config.beans/META-INF/jboss-beans.xml (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/resources/wise-config.beans/META-INF/jboss-beans.xml 2009-01-14 23:08:46 UTC (rev 24723)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean name="WiseKernelLocator"
+ class="org.jboss.wise.core.jbossmc.KernelUtil">
+ <property name="kernel">
+ <inject bean="jboss.kernel:service=Kernel"/>
+ </property>
+ </bean>
+
+ <bean name="WiseClientConfiguration" class="org.jboss.wise.core.jbossmc.beans.WiseClientConfiguration" >
+ <property name="defaultUserName">foo</property>
+ <property name="defaultPassword">pwd</property>
+ <property name="defaultTmpDeployDir">/home/oracle/temp</property>
+ <property name="logConfig">resources/META-INF/wise-log4j.xml</property>
+ </bean>
+
+ <bean name="WSDynamicClientFactory" class="org.jboss.wise.core.jbossmc.beans.ReflectionWSDynamicClientFactory">
+ <property name="config"><inject bean="WiseClientConfiguration"></inject> </property>
+ </bean>
+
+ <bean name="WSConsumer" class="org.jboss.wise.core.consumer.impl.jbosswsnative.WSImportImpl">
+ <property name="keepSource">true</property>
+ <property name="verbose">true</property>
+ </bean>
+
+
+</deployment>
More information about the jboss-svn-commits
mailing list