[jboss-svn-commits] JBL Code SVN: r22692 - in labs/jbossesb/workspace/maeste/product/services/soap: src/main/java/org/jboss/soa/esb/actions/soap/wise and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Sep 11 17:20:52 EDT 2008


Author: maeste
Date: 2008-09-11 17:20:51 -0400 (Thu, 11 Sep 2008)
New Revision: 22692

Modified:
   labs/jbossesb/workspace/maeste/product/services/soap/lib/ext/Wise-core.jar
   labs/jbossesb/workspace/maeste/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
Log:
fixes for JBESB-2019 JBESB-2020 JBESB-2021 JBESB-2022 JBESB-2023

Modified: labs/jbossesb/workspace/maeste/product/services/soap/lib/ext/Wise-core.jar
===================================================================
(Binary files differ)

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-09-11 21:01:48 UTC (rev 22691)
+++ labs/jbossesb/workspace/maeste/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java	2008-09-11 21:20:51 UTC (rev 22692)
@@ -32,11 +32,12 @@
 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 java.util.logging.Logger;
 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;
@@ -48,10 +49,8 @@
 
 /**
  * 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:
+ * 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>
  * 	&lt;action name=&quot;soap-wise-client-action&quot; class=&quot;org.jboss.soa.esb.actions.soap.wise.SOAPClient&quot;&gt;
@@ -89,48 +88,45 @@
  * 
  * <pre>
  * 	&lt;property name=&quot;userName&quot; value=&quot;&quot;/&gt;
- * 	&lt;property name=&quot;password&quot; value=&quot;&quot;/&gt;	
+ * 	&lt;property name=&quot;password&quot; value=&quot;&quot;/&gt;
  * </pre>
  * 
- * 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:
+ * 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>
+ * 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(&lt;String, Object&gt;), 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 2</b>: With a set of String based key-value pairs(&lt;String, Object&gt;), 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:
+ * <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:
  * <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:
  * <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(&lt;String, Object&gt;), 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 2</b>: With a set of String based key-value pairs(&lt;String, Object&gt;), 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. <p/> Transformation
- * of the SOAP request (before sending) is supported by configuring the SOAPClient action with a Smooks transformation
- * configuration property as follows:
+ * <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:
  * 
  * <pre>
  *     &lt;property name=&quot;smooksTransform&quot; value=&quot;/transforms/order-transform.xml&quot; /&gt;
  * </pre>
- * 
  * <p>
  * 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.
@@ -144,9 +140,8 @@
  *     &lt;property name=&quot;custom-handlers&quot; value=&quot;package.Class1;package.Class2&quot; /&gt;
  * </pre>
  * 
- * <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:
+ * <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:
  * 
  * <pre>
  *     &lt;property name=&quot;LoggingMessages&quot; value=&quot;true&quot; /&gt;
@@ -156,7 +151,7 @@
  */
 public class SOAPClient extends AbstractActionPipelineProcessor {
 
-    private final Logger logger = Logger.getLogger(SOAPClient.class);
+    private final Logger logger = Logger.getLogger("SOAPClient");
     private final String wsdl;
     private final String soapAction;
     private final String endPointName;
@@ -170,6 +165,8 @@
     private final List<String> customHandlers = new ArrayList<String>();
     private final MessagePayloadProxy payloadProxy;
     private boolean loggingEnabled = false;
+    private String smooksRequestReport = null;
+    private String smooksResponseReport = null;
 
     public SOAPClient( ConfigTree config ) throws ConfigurationException {
         wsdl = config.getRequiredAttribute("wsdl");
@@ -181,9 +178,9 @@
         serviceName = serviceName != null ? serviceName : wsdl.substring(wsdl.lastIndexOf("/"), wsdl.lastIndexOf("?"));
         username = config.getAttribute("username");
         password = config.getAttribute("password");
-        logger.info(config.getAttribute("LoggingMessages"));
+        smooksRequestReport = config.getAttribute("smooksRequestReport");
+        smooksResponseReport = config.getAttribute("smooksResponseReport");
         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"));
@@ -204,8 +201,9 @@
     public void initialise() throws ActionLifecycleException {
         super.initialise();
         try {
-            WSDynamicClientFactory.getInstace().clearCache();
-
+            WSDynamicClientFactory.getInstace().removeFromCache(serviceName);
+            SmooksCache.getInstance().remove(smooksRequestMapperURL);
+            SmooksCache.getInstance().remove(smooksResponseMapperURL);
         } catch (Exception e) {
             throw new ActionLifecycleException("Error durinfg wise client cache cleaning", e);
         }
@@ -275,7 +273,7 @@
         try {
             WiseMapper mapper = null;
             if (this.smooksRequestMapperURL != null) {
-                mapper = new SmooksMapper(this.smooksRequestMapperURL, "smook/report/report.html");
+                mapper = new SmooksMapper(this.smooksRequestMapperURL, this.smooksRequestReport);
             }
             result = wsmethodsMap.get(this.soapAction).invoke(params, mapper);
         } catch (WiseException e) {
@@ -284,12 +282,13 @@
 
         WiseMapper mapper = null;
         if (this.smooksResponseMapperURL != null) {
-            mapper = new SmooksMapper(this.smooksResponseMapperURL, "smook/report/report.html");
+            mapper = new SmooksMapper(this.smooksResponseMapperURL, this.smooksResponseReport);
         }
         // And process the response into the message...
 
         try {
-            payloadProxy.setPayload(message, result.getMappedResult(mapper));
+            Map map = result.getMappedResult(mapper, (Map)params);
+            payloadProxy.setPayload(message, map);
         } catch (Exception e) {
             throw new ActionProcessingException("Could not set payload to SOAP message", e);
         }




More information about the jboss-svn-commits mailing list