[jboss-svn-commits] JBL Code SVN: r14481 - in labs/jbossesb/trunk/product: samples/quickstarts/transform_XML2POJO and 23 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Aug 23 10:40:12 EDT 2007


Author: tfennelly
Date: 2007-08-23 10:40:12 -0400 (Thu, 23 Aug 2007)
New Revision: 14481

Added:
   labs/jbossesb/trunk/product/services/smooks/lib/ext/freemarker-2.3.1.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-commons-0.9.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-edisax-0.2.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-core-0.9.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-csv-0.2.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-edi-0.2.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-javabean-0.3.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-templating-0.3.jar
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WsdlTransformer.java
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/soap/
   labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/soap/wsdltrans.xml
Removed:
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-commons-0.9-SNAPSHOT.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-edisax-0.2-SNAPSHOT.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-core-0.9-SNAPSHOT.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-csv-0.1.1.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-edi-0.2-SNAPSHOT.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-javabean-0.3-SNAPSHOT.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-templating-0.2.1.jar
Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/smooks-res.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/smooks-res.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/smooks-res.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/smooks-res.xml
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/war/resources/WEB-INF/web.xml
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-misc-0.2.1.jar
   labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-scripting-0.1.jar
   labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksInstanceManager.java
   labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java
   labs/jbossesb/trunk/product/services/smooks/src/main/resources/smooks-base-configs/creators.xml
   labs/jbossesb/trunk/product/services/soap/base-project-build.xml
   labs/jbossesb/trunk/product/services/soap/build.xml
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java
   labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java
   labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-in.wsdl
   labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl
   labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
   labs/jbossesb/trunk/product/services/soapui-client/src/main/resources/META-INF/smooks-creators.xml
   labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/sendNotificationTransform.xml
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp
   labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java
   labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java
Log:
Some fixes for some issues discovered while working on JBESB-731. JBESB-731 still open.

Modified: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -3,7 +3,7 @@
 
     <!-- Populate the OrderHeader -->
 	<resource-config selector="order">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
         <param name="beanId">orderHeader</param>
 		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderHeader</param>
         <param name="bindings">
@@ -18,7 +18,7 @@
 
     <!-- Populate the Customer -->
     <resource-config selector="order customer">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
 		<param name="beanId">customer</param>
 		<param name="beanClass">org.jboss.soa.esb.dvdstore.Customer</param>
         <param name="bindings">
@@ -31,7 +31,7 @@
 
     <!-- Populate the OrderItem list -->
 	<resource-config selector="order orderlines orderline">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
 		<param name="beanId">orderItem</param>
 		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderItem</param>
 		<param name="addToList">true</param>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/smooks-res.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO/smooks-res.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -3,7 +3,7 @@
 
     <!-- Populate the OrderHeader -->
 	<resource-config selector="order">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
         <param name="beanId">orderHeader</param>
 		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderHeader</param>
         <param name="bindings">
@@ -18,7 +18,7 @@
 
     <!-- Populate the Customer -->
     <resource-config selector="order customer">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
 		<param name="beanId">customer</param>
 		<param name="beanClass">org.jboss.soa.esb.dvdstore.Customer</param>
         <param name="bindings">
@@ -31,7 +31,7 @@
 
     <!-- Populate the OrderItem list -->
 	<resource-config selector="order orderlines orderline">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
 		<param name="beanId">orderItem</param>
 		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderItem</param>
 		<param name="addToList">true</param>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/smooks-res.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/smooks-res.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -6,7 +6,7 @@
 		used later in the XSLT to refer to this bean.
 	-->
 	<resource-config selector="Order">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
 		<param name="beanId">orderDate</param>
 		<param name="beanClass">org.jboss.soa.esb.samples.quickstart.transformxml2xmldatemanipulation.test.OrderDate</param>
         <param name="bindings">
@@ -31,6 +31,7 @@
                <month><smooks-bean:select ognl="orderDate.month"/></month>
                <year><smooks-bean:select ognl="orderDate.year"/></year>
             </OrderDate>]]></resource>
+        <param name="is-xslt-templatelet">true</param>
 		<param name="action">insertbefore</param>
 	</resource-config>
 	

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/smooks-res.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/smooks-res.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -9,6 +9,7 @@
                 <quantity><xsl:value-of select="@quantity" /></quantity>
             </line-item>]]>
         </resource>
+        <param name="is-xslt-templatelet">true</param>
 	</resource-config>
 
 </smooks-resource-list>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/smooks-res.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_bpel/smooks-res.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -18,7 +18,7 @@
     Suck the order number out of the CSV record and into the SalesOrderNotification bean.
     -->
 	<resource-config selector="csv-record orderNum">
-        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <resource>org.milyn.javabean.BeanPopulator</resource>
         <param name="beanId">salesOrderNotification</param>
         <param name="beanClass">com.activebpel.ordermanagement.SalesOrderNotification</param>
         <param name="bindings">

Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/war/resources/WEB-INF/web.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_producer/war/resources/WEB-INF/web.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -7,7 +7,7 @@
 
     <servlet>
         <servlet-name>GoodbyeWorldWS</servlet-name>
-        <servlet-class>org.jboss.soa.esb.samples.quickstart.webserviceproducer.webservice.GoodbyeWorldWS</servlet-class>
+        <servlet-class>org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice.GoodbyeWorldWS</servlet-class>
     </servlet>
 
     <servlet-mapping>

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/freemarker-2.3.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/freemarker-2.3.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-commons-0.9-SNAPSHOT.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-commons-0.9.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-commons-0.9.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-edisax-0.2-SNAPSHOT.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-edisax-0.2.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-edisax-0.2.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-core-0.9-SNAPSHOT.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-core-0.9.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-core-0.9.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-csv-0.1.1.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-csv-0.2.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-csv-0.2.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-edi-0.2-SNAPSHOT.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-edi-0.2.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-edi-0.2.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-javabean-0.3-SNAPSHOT.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-javabean-0.3.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-javabean-0.3.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-misc-0.2.1.jar
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-scripting-0.1.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-templating-0.2.1.jar
===================================================================
(Binary files differ)

Added: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-templating-0.3.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/services/smooks/lib/ext/milyn-smooks-templating-0.3.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksInstanceManager.java
===================================================================
--- labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksInstanceManager.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksInstanceManager.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -76,29 +76,12 @@
     }
 
     private Smooks createSmooksInstance() throws SmooksException{
-        InputStream configListStream;
-
         try {
-            configListStream = (new URIResourceLocator()).getResource(configurationSourceURI);
-        } catch (IOException e) {
-            throw new SmooksException("Failed to locate Smooks resource [" + configurationSourceURI + "].", e);
-        }
-        if(configListStream == null) {
-            throw new SmooksException("Failed to locate Smooks resource [" + configurationSourceURI + "].");
-        }
-
-        try {
-            return new Smooks(configListStream);
+            return new Smooks(configurationSourceURI);
         } catch (SAXException e) {
             throw new SmooksException("Invalid Smooks resource config '" + configurationSourceURI + "'.", e);
         } catch (IOException e) {
             throw new SmooksException("Error reading Smooks resource config '" + configurationSourceURI + "'.", e);
-        } finally {
-            try {
-                configListStream.close();
-            } catch (IOException e) {
-                logger.warn("Error closing Smooks resource config stream for resource '" + configurationSourceURI + "'.", e);
-            }
         }
     }
 

Modified: labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java
===================================================================
--- labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -242,7 +242,7 @@
         }
         for(String resource : resources) {
             try {
-                SmooksUtil.registerResources(resource, ClassUtil.getResourceAsStream("/smooks-base-configs/" + resource.trim(), getClass()), smooks);
+                smooks.addConfigurations("/smooks-base-configs/", ClassUtil.getResourceAsStream("/smooks-base-configs/" + resource.trim(), getClass()));
             } catch(Throwable t) {
                 // ignore
             }

Modified: labs/jbossesb/trunk/product/services/smooks/src/main/resources/smooks-base-configs/creators.xml
===================================================================
--- labs/jbossesb/trunk/product/services/smooks/src/main/resources/smooks-base-configs/creators.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/smooks/src/main/resources/smooks-base-configs/creators.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -20,6 +20,15 @@
     </resource-config>
 
     <!--
+        All "ftl" resource types will be treated as FreeMarker templates and
+        will be handled by the FreeMarkerContentDeliveryUnitCreator.
+    -->
+    <resource-config>
+        <resource type="class">org.milyn.templating.freemarker.FreeMarkerContentDeliveryUnitCreator</resource>
+        <param name="restype">ftl</param>
+    </resource-config>
+
+    <!--
         Groovy Scripting Support.
     -->
     <resource-config>

Modified: labs/jbossesb/trunk/product/services/soap/base-project-build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/base-project-build.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soap/base-project-build.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -23,6 +23,10 @@
     </target>
 
     <path id="classpath">
+        <path refid="base-classpath" />
+    </path>
+
+    <path id="base-classpath">
         <pathelement location="build/${ant.project.name}.esb"/>
         <pathelement location="build/classes"/>
         <pathelement location="build/test/classes"/>

Modified: labs/jbossesb/trunk/product/services/soap/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/build.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soap/build.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -5,4 +5,11 @@
 	
 	<target name="test" depends="base.test"/>
 
+    <path id="classpath">
+        <path refid="base-classpath" />
+
+        <!-- Adding the Smooks jars... -->
+        <fileset dir="../smooks/lib/ext" includes="*.jar"/>
+    </path>
+
 </project>

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -19,9 +19,7 @@
  */
 package org.jboss.soa.esb.actions.soap;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.URI;
 import java.util.List;
 import java.lang.reflect.InvocationHandler;
@@ -29,6 +27,7 @@
 import java.lang.reflect.Proxy;
 
 import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
 import javax.servlet.http.HttpServletRequest;
 
 import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
@@ -37,15 +36,14 @@
 import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionDocument;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.PropertyDocument;
 import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.dom.YADOMUtil;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.invocation.InvocationContext;
 import org.jboss.wsf.spi.invocation.RequestHandler;
 import org.jboss.ws.core.server.ServletRequestContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 import org.apache.log4j.Logger;
+import org.milyn.Smooks;
+import org.milyn.container.standalone.StandaloneExecutionContext;
 
 /**
  * Contract publisher for a Webservice endpoint.
@@ -55,6 +53,7 @@
 
     private static Logger logger = Logger.getLogger(WebserviceContractPublisher.class);    
     private String endpointName;
+    private Smooks transformer;
 
     /**
      * Set the {@link SOAPProcessor} action configuration.
@@ -74,6 +73,8 @@
         if(endpointName == null) {
             throw new ConfigurationException("Property '" + SOAPProcessor.JBOSSWS_ENDPOINT + "' not specified.");
         }
+
+        initializeTransform();
     }
 
     /**
@@ -86,22 +87,30 @@
      * @return WSDL Contract.
      */
     public ContractInfo getContractInfo(EPR epr) {
-        Endpoint endpoint = SOAPProcessor.getServiceEndpoint(endpointName);
-        RequestHandler requestHandler = endpoint.getRequestHandler();
-        ByteArrayOutputStream wsdlStream =  new ByteArrayOutputStream();
         HttpServletRequest httpServletRequestProxy;
-        InvocationContext invocationContext;
 
         httpServletRequestProxy = (HttpServletRequest) Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
                                           new Class[] { HttpServletRequest.class },
                                           new HttpServletRequestHandler());
 
-        invocationContext = new ServletRequestContext(null, httpServletRequestProxy, null);
+        return getContractInfo(epr, httpServletRequestProxy);
+    }
 
+    public ContractInfo getContractInfo(EPR epr, HttpServletRequest servletRequest) {
+        Endpoint endpoint = SOAPProcessor.getServiceEndpoint(endpointName);
+        String targetServiceCat = servletRequest.getParameter("serviceCat");
+        String targetServiceName = servletRequest.getParameter("serviceName");
+        String targetProtocol = servletRequest.getParameter("protocol");
+        RequestHandler requestHandler = endpoint.getRequestHandler();
+        ByteArrayOutputStream wsdlStream =  new ByteArrayOutputStream();
+        InvocationContext invocationContext;
+
+        invocationContext = new ServletRequestContext(null, servletRequest, null);
+
         try {
             // Generate the WSDL...
             requestHandler.handleWSDLRequest(endpoint, wsdlStream, invocationContext);
-            String wsdl = updateWsdl(new String(wsdlStream.toByteArray()), epr);
+            String wsdl = updateWsdl(new String(wsdlStream.toByteArray()), epr, targetServiceCat, targetServiceName, targetProtocol);
 
             return new ContractInfo("text/xml", wsdl);
         } catch (Exception e) {
@@ -116,24 +125,32 @@
      *
      * @param wsdl WSDL input.
      * @param epr The SOAP endpoint from the ESB perspective.
-     * @return The updated WSDL.
+     * @param targetServiceCat
+     *@param targetServiceName
+     * @param targetProtocol @return The updated WSDL.
      */
-    protected String updateWsdl(String wsdl, EPR epr) throws SAXException, IOException, ConfigurationException {
+    protected String updateWsdl(String wsdl, EPR epr, String targetServiceCat, String targetServiceName, String targetProtocol) throws SAXException, IOException, ConfigurationException {
         URI endpointURI = URI.create(epr.getAddr().getAddress());
-        ByteArrayOutputStream wsdlStream =  new ByteArrayOutputStream();
+        StringWriter writer = new StringWriter();
+        StandaloneExecutionContext execContext = transformer.createExecutionContext();
 
-        // Now, fudge it to fix up the binding transport and endpoint addressing info...
-        Document wsdlDoc = YADOMUtil.parseStream(new ByteArrayInputStream(wsdl.getBytes("UTF-8")), false, false);
-        Attr transport = (Attr) YADOMUtil.getNode(wsdlDoc, "/definitions/binding/binding/@transport");
-        Attr address = (Attr) YADOMUtil.getNode(wsdlDoc, "/definitions/service/port/address/@location");
+        execContext.setAttribute(WsdlTransformer.ENDPOINT_URI, endpointURI);
+        execContext.setAttribute(WsdlTransformer.TARGET_CAT, targetServiceCat);
+        execContext.setAttribute(WsdlTransformer.TARGET_NAME, targetServiceName);
+        execContext.setAttribute(WsdlTransformer.TARGET_PROTOCOL, targetProtocol);
+        transformer.filter(new StreamSource(new StringReader(wsdl)), new StreamResult(writer), execContext);
 
-        // TODO: Doubt this is the correct thing to do!!
-        transport.setNodeValue("http://schemas.xmlsoap.org/soap/" + endpointURI.getScheme());
-        address.setNodeValue(endpointURI.toString());
+        return writer.toString();
+    }
 
-        YADOMUtil.serialize(wsdlDoc, new StreamResult(wsdlStream), true);
-
-        return new String(wsdlStream.toByteArray()).trim();
+    protected void initializeTransform() throws ConfigurationException {
+        try {
+            transformer = new Smooks("/org/jboss/soa/esb/actions/soap/wsdltrans.xml");
+        } catch (IOException e) {
+            throw new ConfigurationException("Failed to read the Smooks Transformation config for WSDL.", e);
+        } catch (SAXException e) {
+            throw new ConfigurationException("Failed to read the Smooks Transformation config for WSDL.", e);
+        }
     }
 
     private class HttpServletRequestHandler implements InvocationHandler {

Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WsdlTransformer.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WsdlTransformer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WsdlTransformer.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -0,0 +1,101 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.soap;
+
+import org.milyn.delivery.dom.DOMElementVisitor;
+import org.milyn.container.ExecutionContext;
+import org.milyn.SmooksException;
+import org.milyn.xml.DomUtils;
+import org.milyn.cdr.SmooksResourceConfiguration;
+import org.milyn.cdr.SmooksConfigurationException;
+import org.w3c.dom.Element;
+import org.apache.log4j.Logger;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * Smooks transformer for transforming the WSDL for ESB endpoints.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class WsdlTransformer implements DOMElementVisitor {
+
+    private static Logger logger = Logger.getLogger(WsdlTransformer.class);
+
+    public static final String ENDPOINT_URI = "endpointURI";
+    public static final String TARGET_CAT = "targetServiceCat";
+    public static final String TARGET_NAME = "targetServiceName";
+    public static final String TARGET_PROTOCOL = "targetProtocol";
+
+    public void setConfiguration(SmooksResourceConfiguration smooksResourceConfiguration) throws SmooksConfigurationException {
+    }
+
+    public void visitBefore(Element element, ExecutionContext executionContext) throws SmooksException {
+    }
+
+    public void visitAfter(Element element, ExecutionContext executionContext) throws SmooksException {
+        String elementName = DomUtils.getName(element);
+
+        if(elementName.equals("import")) {
+            transformImport(element, executionContext);
+        } else if(elementName.equals("binding")) {
+            transformBinding(element, executionContext);
+        } else if(elementName.equals("address")) {
+            transformAddress(element, executionContext);
+        }
+    }
+
+    private void transformImport(Element element, ExecutionContext executionContext) {
+        String location = DomUtils.getAttributeValue(element, "location");
+
+        if(location != null) {
+            try {
+                URI locationURI = new URI(location);
+                String targetServiceCat = (String) executionContext.getAttribute(WsdlTransformer.TARGET_CAT);
+                String targetServiceName = (String) executionContext.getAttribute(WsdlTransformer.TARGET_NAME);
+                String targetProtocol = (String) executionContext.getAttribute(WsdlTransformer.TARGET_PROTOCOL);
+                String addParams = "serviceCat=" + targetServiceCat + "&serviceName=" + targetServiceName + "&protocol=" + targetProtocol;
+
+                if(locationURI.getQuery() != null) {
+                    element.setAttribute("location", (locationURI.toString() + "&" + addParams).replace("&", "&amp;"));
+                } else {
+                    element.setAttribute("location", (locationURI.toString() + "?" + addParams).replace("&", "&amp;"));
+                }
+            } catch (URISyntaxException e) {
+                logger.info("Not processing WSDL import '" + location + "'.  Invalid URI.");
+            }
+        }
+    }
+
+    private void transformBinding(Element element, ExecutionContext executionContext) {
+        URI endpointURI = (URI) executionContext.getAttribute(ENDPOINT_URI);
+        if(endpointURI != null) {
+            element.setAttribute("transport", "http://schemas.xmlsoap.org/soap/" + endpointURI.getScheme());
+        }
+    }
+
+    private void transformAddress(Element element, ExecutionContext executionContext) {
+        URI endpointURI = (URI) executionContext.getAttribute(ENDPOINT_URI);
+        if(endpointURI != null) {
+            element.setAttribute("location", endpointURI.toString());
+        }
+    }
+}


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WsdlTransformer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/soap/wsdltrans.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/soap/wsdltrans.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/soap/wsdltrans.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+    <resource-config selector="import">
+        <resource>org.jboss.soa.esb.actions.soap.WsdlTransformer</resource>
+    </resource-config>
+
+    <resource-config selector="port address" selector-namespace="http://schemas.xmlsoap.org/wsdl/soap/">
+        <resource>org.jboss.soa.esb.actions.soap.WsdlTransformer</resource>
+    </resource-config>
+
+    <resource-config selector="binding" selector-namespace="http://schemas.xmlsoap.org/wsdl/soap/">
+        <resource>org.jboss.soa.esb.actions.soap.WsdlTransformer</resource>
+    </resource-config>
+
+    <!--
+        We explicitly want to close empty elements.  They're left open by default.
+    -->
+    <resource-config selector="*">
+        <resource>org.milyn.delivery.dom.serialize.DefaultSerializationUnit</resource>
+        <param name="closeEmptyElements">true</param>
+    </resource-config>
+
+</smooks-resource-list>
\ No newline at end of file


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/resources/org/jboss/soa/esb/actions/soap/wsdltrans.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -43,8 +43,9 @@
         String wsdlOutExpected = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-out-expected.wsdl")));
         EPR epr = new EPR(URI.create("socket://x.y.x:8989/"));
 
-        String wsdlOut = publisher.updateWsdl(wsdlIn, epr);
+        publisher.initializeTransform();
+        String wsdlOut = publisher.updateWsdl(wsdlIn, epr, "myServiceCat", "myServiceName", "socket");
         log.debug(wsdlOut);
-        assertTrue("WSDL Update failed.", StringUtils.equalsIgnoreLinebreaks(wsdlOutExpected, wsdlOut, false));
+        assertTrue("WSDL Update failed.  \n\n*** Expected:\n\n" + wsdlOutExpected + "\n\n*** Got:\n\n" + wsdlOut, StringUtils.equalsIgnoreLinebreaks(wsdlOutExpected, wsdlOut, false));
     }
 }

Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-in.wsdl
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-in.wsdl	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-in.wsdl	2007-08-23 14:40:12 UTC (rev 14481)
@@ -1,55 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice_war1/goodbyeworld" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="GoodbyeWorldWSService" targetNamespace="http://webservice_war1/goodbyeworld">
- <types/>
- <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponse">
-  <part name="String_1" type="xsd:string"/>
+    <import location="http://127.0.0.1:8080/contract/contract.jsp?wsdl&amp;resource=MTOMEndpoint_PortType61314.wsdl" namespace="http://org.jboss.ws/xop/doclit"/>
+    <types/>
+    <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponse">
+        <part name="String_1" type="xsd:string"/>
 
- </message>
- <message name="GoodbyeWorldWS_sayGoodbye">
-  <part name="String_1" type="xsd:string"/>
- </message>
- <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
- <message name="GoodbyeWorldWS_sayGoodbyeResponse">
-  <part name="result" type="xsd:string"/>
- </message>
- <portType name="GoodbyeWorldWS">
+    </message>
+    <message name="GoodbyeWorldWS_sayGoodbye">
+        <part name="String_1" type="xsd:string"/>
+    </message>
+    <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
+    <message name="GoodbyeWorldWS_sayGoodbyeResponse">
+        <part name="result" type="xsd:string"/>
+    </message>
+    <portType name="GoodbyeWorldWS">
 
-  <operation name="sayGoodbye" parameterOrder="String_1">
-   <input message="tns:GoodbyeWorldWS_sayGoodbye"/>
-   <output message="tns:GoodbyeWorldWS_sayGoodbyeResponse"/>
-  </operation>
-  <operation name="sayGoodbyeWithoutResponse" parameterOrder="String_1">
-   <input message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponse"/>
-   <output message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
-  </operation>
- </portType>
+        <operation name="sayGoodbye" parameterOrder="String_1">
+            <input message="tns:GoodbyeWorldWS_sayGoodbye"/>
+            <output message="tns:GoodbyeWorldWS_sayGoodbyeResponse"/>
+        </operation>
+        <operation name="sayGoodbyeWithoutResponse" parameterOrder="String_1">
+            <input message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponse"/>
+            <output message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
+        </operation>
+    </portType>
 
- <binding name="GoodbyeWorldWSBinding" type="tns:GoodbyeWorldWS">
-  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-  <operation name="sayGoodbye">
-   <soap:operation soapAction=""/>
-   <input>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
-   </input>
-   <output>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+    <binding name="GoodbyeWorldWSBinding" type="tns:GoodbyeWorldWS">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <operation name="sayGoodbye">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
 
-   </output>
-  </operation>
-  <operation name="sayGoodbyeWithoutResponse">
-   <soap:operation soapAction=""/>
-   <input>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
-   </input>
-   <output>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </output>
+        </operation>
+        <operation name="sayGoodbyeWithoutResponse">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
 
-   </output>
-  </operation>
- </binding>
- <service name="GoodbyeWorldWSService">
-  <port binding="tns:GoodbyeWorldWSBinding" name="GoodbyeWorldWSPort">
-   <soap:address location="http://tfennelly:8080/Quickstart_webservice_jbossws_adapter_01/GoodbyeWorldWS"/>
-  </port>
- </service>
+            </output>
+        </operation>
+    </binding>
+    <service name="GoodbyeWorldWSService">
+        <port binding="tns:GoodbyeWorldWSBinding" name="GoodbyeWorldWSPort">
+            <soap:address location="http://tfennelly:8080/Quickstart_webservice_jbossws_adapter_01/GoodbyeWorldWS"/>
+        </port>
+    </service>
 </definitions>
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected.wsdl	2007-08-23 14:40:12 UTC (rev 14481)
@@ -1,54 +1,55 @@
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice_war1/goodbyeworld" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="GoodbyeWorldWSService" targetNamespace="http://webservice_war1/goodbyeworld">
- <types/>
- <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponse">
-  <part name="String_1" type="xsd:string"/>
+<definitions name="GoodbyeWorldWSService" targetNamespace="http://webservice_war1/goodbyeworld" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice_war1/goodbyeworld" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <import location="http://127.0.0.1:8080/contract/contract.jsp?wsdl&amp;resource=MTOMEndpoint_PortType61314.wsdl&amp;serviceCat=myServiceCat&amp;serviceName=myServiceName&amp;protocol=socket" namespace="http://org.jboss.ws/xop/doclit"/>
+    <types/>
+    <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponse">
+        <part name="String_1" type="xsd:string"/>
 
- </message>
- <message name="GoodbyeWorldWS_sayGoodbye">
-  <part name="String_1" type="xsd:string"/>
- </message>
- <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
- <message name="GoodbyeWorldWS_sayGoodbyeResponse">
-  <part name="result" type="xsd:string"/>
- </message>
- <portType name="GoodbyeWorldWS">
+    </message>
+    <message name="GoodbyeWorldWS_sayGoodbye">
+        <part name="String_1" type="xsd:string"/>
+    </message>
+    <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
+    <message name="GoodbyeWorldWS_sayGoodbyeResponse">
+        <part name="result" type="xsd:string"/>
+    </message>
+    <portType name="GoodbyeWorldWS">
 
-  <operation name="sayGoodbye" parameterOrder="String_1">
-   <input message="tns:GoodbyeWorldWS_sayGoodbye"/>
-   <output message="tns:GoodbyeWorldWS_sayGoodbyeResponse"/>
-  </operation>
-  <operation name="sayGoodbyeWithoutResponse" parameterOrder="String_1">
-   <input message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponse"/>
-   <output message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
-  </operation>
- </portType>
+        <operation name="sayGoodbye" parameterOrder="String_1">
+            <input message="tns:GoodbyeWorldWS_sayGoodbye"/>
+            <output message="tns:GoodbyeWorldWS_sayGoodbyeResponse"/>
+        </operation>
+        <operation name="sayGoodbyeWithoutResponse" parameterOrder="String_1">
+            <input message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponse"/>
+            <output message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
+        </operation>
+    </portType>
 
- <binding name="GoodbyeWorldWSBinding" type="tns:GoodbyeWorldWS">
-  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/socket"/>
-  <operation name="sayGoodbye">
-   <soap:operation soapAction=""/>
-   <input>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
-   </input>
-   <output>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+    <binding name="GoodbyeWorldWSBinding" type="tns:GoodbyeWorldWS">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/socket"/>
+        <operation name="sayGoodbye">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
 
-   </output>
-  </operation>
-  <operation name="sayGoodbyeWithoutResponse">
-   <soap:operation soapAction=""/>
-   <input>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
-   </input>
-   <output>
-    <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </output>
+        </operation>
+        <operation name="sayGoodbyeWithoutResponse">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
 
-   </output>
-  </operation>
- </binding>
- <service name="GoodbyeWorldWSService">
-  <port binding="tns:GoodbyeWorldWSBinding" name="GoodbyeWorldWSPort">
-   <soap:address location="socket://x.y.x:8989/"/>
-  </port>
- </service>
+            </output>
+        </operation>
+    </binding>
+    <service name="GoodbyeWorldWSService">
+        <port binding="tns:GoodbyeWorldWSBinding" name="GoodbyeWorldWSPort">
+            <soap:address location="socket://x.y.x:8989/"/>
+        </port>
+    </service>
 </definitions>
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -173,8 +173,9 @@
             Smooks smooks = smooksCache.get(smooksResource);
 
             if(smooks == null) {
-                smooks = new Smooks(new ByteArrayInputStream(smooksResource.getBytes("UTF-8")));
-                SmooksUtil.registerResources("cdu-creators", new URIResourceLocator().getResource("/META-INF/smooks-creators.xml"), smooks);
+                smooks = new Smooks();
+                smooks.addConfigurations("smooks-resource", new ByteArrayInputStream(smooksResource.getBytes("UTF-8")));
+                smooks.addConfigurations("cdu-creators", new URIResourceLocator().getResource("/META-INF/smooks-creators.xml"));
                 smooksCache.put(smooksResource, smooks);
             }
 

Modified: labs/jbossesb/trunk/product/services/soapui-client/src/main/resources/META-INF/smooks-creators.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/main/resources/META-INF/smooks-creators.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/main/resources/META-INF/smooks-creators.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -20,6 +20,15 @@
     </resource-config>
 
     <!--
+        All "ftl" resource types will be treated as FreeMarker templates and
+        will be handled by the FreeMarkerContentDeliveryUnitCreator.
+    -->
+    <resource-config>
+        <resource type="class">org.milyn.templating.freemarker.FreeMarkerContentDeliveryUnitCreator</resource>
+        <param name="restype">ftl</param>
+    </resource-config>
+    
+    <!--
         Groovy Scripting Support.
     -->
     <resource-config>

Modified: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/sendNotificationTransform.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/sendNotificationTransform.xml	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/sendNotificationTransform.xml	2007-08-23 14:40:12 UTC (rev 14481)
@@ -7,6 +7,7 @@
             <something addedto="header" />
             -->
         </resource>
+        <param name="is-xslt-templatelet">true</param>
         <param name="action">addto</param>
     </resource-config>
     

Modified: labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp	2007-08-23 14:40:12 UTC (rev 14481)
@@ -7,6 +7,8 @@
 <%@ page import="org.jboss.soa.esb.addressing.EPR" %>
 <%@ page import="java.net.URI" %>
 <%@ page import="org.jboss.internal.soa.esb.publish.ContractInfo" %>
+<%@ page import="org.jboss.soa.esb.actions.soap.WebserviceContractPublisher" %>
+<%@ page import="org.jboss.internal.soa.esb.publish.ContractPublisher" %>
 <%
     List publishers = ServicePublisher.getServicePublishers();
     Registry registry = RegistryFactory.getRegistry();
@@ -22,7 +24,7 @@
         String serviceName = publisher.getServiceName();
         List eprs;
 
-        if(publisher.getContractPublisher() == null) {
+        if (publisher.getContractPublisher() == null) {
             continue;
         } else if (!serviceCategory.equalsIgnoreCase(targetServiceCat) ||
                 !serviceName.equalsIgnoreCase(targetServiceName)) {
@@ -42,12 +44,18 @@
             String protocol = eprURI.getScheme();
 
             if (protocol.equalsIgnoreCase(targetProtocol)) {
-                contractInfo = publisher.getContractPublisher().getContractInfo(epr);
+                ContractPublisher contractPublisher = publisher.getContractPublisher();
+
+                if(contractPublisher instanceof WebserviceContractPublisher) {
+                    contractInfo = ((WebserviceContractPublisher)contractPublisher).getContractInfo(epr, request);
+                } else {
+                    contractInfo = contractPublisher.getContractInfo(epr);
+                }
                 break;
             }
         }
 
-        if(contractInfo != null) {
+        if (contractInfo != null) {
             contractData = contractInfo.getData();
             response.setContentType(contractInfo.getMimeType());
         } else {

Modified: labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp	2007-08-23 14:40:12 UTC (rev 14481)
@@ -30,7 +30,7 @@
 
             try {
                 eprs = (List) registry.findEPRs(serviceCategory, serviceName);
-            } catch (RegistryException e) {
+            } catch (Exception e) {
                 // ignore for now - just return an empty list
                 eprs = new ArrayList();
             }

Modified: labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/TestTransformation.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -91,7 +91,7 @@
         MessageExchange exchange = SelectMessageExchangeAction.getMessageExchange();
         
         try {
-        	SmooksUtil.registerResources("Console Resources", config, smooks);
+        	smooks.addConfigurations("ConsoleResources", config);
 		} catch (Throwable t) {
 			logger.error("Error loading transformation resources.", t);
 			testView.setOutput("Error Loading Transformation Resources...\n\n" + t.getClass().getName() + ": " + t.getMessage() + "\n\nCheck Java console.");

Modified: labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java	2007-08-23 14:35:47 UTC (rev 14480)
+++ labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/transform/importexport/ResourceImportExport.java	2007-08-23 14:40:12 UTC (rev 14481)
@@ -29,6 +29,7 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
+import java.net.URISyntaxException;
 
 import javax.persistence.EntityManager;
 
@@ -119,13 +120,17 @@
 	}
 
 	private void loadConfigurations(InputStream resStream) throws SAXException, IOException {
-		SmooksResourceConfigurationList resList = XMLConfigDigester.digestConfig("import-list", resStream);
+        SmooksResourceConfigurationList resList = null;
+        try {
+            resList = XMLConfigDigester.digestConfig(resStream, "import-list");
+            for(int i = 0; i < resList.size(); i++) {
+                TransformationResource transResource = toTransformationResource(resList.get(i));
 
-		for(int i = 0; i < resList.size(); i++) {
-			TransformationResource transResource = toTransformationResource(resList.get(i));
-			
-			NewResource.persistNewResource(transResource, entityManager);
-		}
+                NewResource.persistNewResource(transResource, entityManager);
+            }
+        } catch (URISyntaxException e) {
+            throw new IOException("Unexpected URISyntaxException: " + e.getMessage());
+        }
 	}
 
 	private TransformationResource toTransformationResource(SmooksResourceConfiguration configuration) {




More information about the jboss-svn-commits mailing list