[jboss-svn-commits] JBL Code SVN: r21255 - in labs/jbossesb/trunk/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
Mon Jul 28 06:54:00 EDT 2008
Author: maeste
Date: 2008-07-28 06:54:00 -0400 (Mon, 28 Jul 2008)
New Revision: 21255
Added:
labs/jbossesb/trunk/product/services/soap/lib/ext/jcip-annotations.jar
Modified:
labs/jbossesb/trunk/product/services/soap/lib/ext/Wise-core.jar
labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
Log:
JBESB-1886
Modified: labs/jbossesb/trunk/product/services/soap/lib/ext/Wise-core.jar
===================================================================
(Binary files differ)
Added: labs/jbossesb/trunk/product/services/soap/lib/ext/jcip-annotations.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/services/soap/lib/ext/jcip-annotations.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 2008-07-28 10:00:01 UTC (rev 21254)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2008-07-28 10:54:00 UTC (rev 21255)
@@ -123,17 +123,27 @@
* </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:
+ * 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>
* <property name="smooksTransform" value="/transforms/order-transform.xml" />
* </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.
+ * </p>
+ * <p>
+ * It's also possible to provide a set of custom standard JAXWS Soap Handler. The parameter accept a list of classes implementing
+ * SoapHandler interface. Classes have to provide full qualified name and be separated by semi-columns.
+ * </p>
+ *
+ * <pre>
+ * <property name="custom-handlers" value="package.Class1;package.Class2" />
+ * </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:
@@ -195,6 +205,7 @@
super.initialise();
try {
WSDynamicClientFactory.getInstace().clearCache();
+
} catch (Exception e) {
throw new ActionLifecycleException("Error durinfg wise client cache cleaning", e);
}
@@ -207,8 +218,9 @@
}
public Message process( final Message message ) throws ActionProcessingException {
- Map params;
+ Object params;
WSDynamicClient client = null;
+ // get client from cache
try {
client = WSDynamicClientFactory.getInstace().getClient(wsdl, serviceName, username, password);
} catch (Exception e) {
@@ -217,14 +229,14 @@
}
try {
- params = (Map)payloadProxy.getPayload(message);
+ params = payloadProxy.getPayload(message);
} catch (MessageDeliverException e) {
throw new ActionProcessingException("Could not locate SOAP message parameters from payload", e);
}
- if (params.isEmpty()) {
- logger.warn("Params Map found in message, but the map is empty.");
- }
+ // 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) {
@@ -235,7 +247,11 @@
for (String config : smooksHandler) {
logger.info("adding smooks handler:" + config);
- endpoint.addHandler(new SmooksHandler(config, params));
+ if (params instanceof Map) {
+ endpoint.addHandler(new SmooksHandler(config, (Map)params));
+ } else {
+ endpoint.addHandler(new SmooksHandler(config, null));
+ }
}
for (String config : customHandlers) {
@@ -265,20 +281,15 @@
} 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());
WiseMapper mapper = null;
if (this.smooksResponseMapperURL != null) {
mapper = new SmooksMapper(this.smooksResponseMapperURL, "smook/report/report.html");
}
- result.setMapper(mapper);
-
// And process the response into the message...
try {
- System.out.println("#4:" + (result.getMappedResult()).toString());
- payloadProxy.setPayload(message, result.getMappedResult());
+ payloadProxy.setPayload(message, result.getMappedResult(mapper));
} catch (Exception e) {
throw new ActionProcessingException("Could not set payload to SOAP message", e);
}
More information about the jboss-svn-commits
mailing list