You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/23 11:16:57 UTC

[16/28] incubator-taverna-common-activities git commit: Revert "temporarily empty repository"

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/main/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilder.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/main/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilder.java b/taverna-wsdl-activity/src/main/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilder.java
new file mode 100644
index 0000000..e8d7fa8
--- /dev/null
+++ b/taverna-wsdl-activity/src/main/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilder.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl.xmlsplitter;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import net.sf.taverna.wsdl.parser.ArrayTypeDescriptor;
+import net.sf.taverna.wsdl.parser.BaseTypeDescriptor;
+import net.sf.taverna.wsdl.parser.ComplexTypeDescriptor;
+import net.sf.taverna.wsdl.parser.TypeDescriptor;
+import net.sf.taverna.wsdl.xmlsplitter.XMLSplitterSerialisationHelper;
+
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.output.XMLOutputter;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+/**
+ * A helper class to facilitate in building an XMLSplitter configuration bean
+ * from the type descriptor XML, including setting up the ports.
+ *
+ * @author Stuart Owen
+ *
+ */
+public class XMLSplitterConfigurationBeanBuilder {
+
+	private static final JsonNodeFactory JSON_NODE_FACTORY = JsonNodeFactory.instance;
+
+	public static JsonNode buildBeanForInput(TypeDescriptor descriptor) throws JDOMException, IOException {
+		Element element = XMLSplitterSerialisationHelper.typeDescriptorToExtensionXML(descriptor);
+		return buildBeanForInput(element);
+	}
+
+	public static JsonNode buildBeanForOutput(TypeDescriptor descriptor) throws JDOMException, IOException {
+		Element element = XMLSplitterSerialisationHelper.typeDescriptorToExtensionXML(descriptor);
+		return buildBeanForOutput(element);
+	}
+
+	public static JsonNode buildBeanForInput(Element element) throws JDOMException, IOException {
+		ObjectNode bean = JSON_NODE_FACTORY.objectNode();
+		ArrayNode inputDefinitions = bean.arrayNode();
+		bean.put("inputPorts", inputDefinitions);
+		ArrayNode outputDefinitions = bean.arrayNode();
+		bean.put("outputPorts", outputDefinitions);
+
+		TypeDescriptor descriptor = XMLSplitterSerialisationHelper
+				.extensionXMLToTypeDescriptor(element);
+		ObjectNode outBean = outputDefinitions.addObject();
+		outBean.put("name", "output");
+		outBean.put("mimeType", "'text/xml'");
+		outBean.put("depth", 0);
+		outBean.put("granularDepth", 0);
+
+		if (descriptor instanceof ComplexTypeDescriptor) {
+			List<TypeDescriptor> elements = ((ComplexTypeDescriptor) descriptor).getElements();
+			String[] names = new String[elements.size()];
+			Class<?>[] types = new Class<?>[elements.size()];
+			TypeDescriptor.retrieveSignature(elements, names, types);
+			for (int i = 0; i < names.length; i++) {
+				ObjectNode portBean = inputDefinitions.addObject();
+				portBean.put("name", names[i]);
+				portBean.put("mimeType", TypeDescriptor.translateJavaType(types[i]));
+				portBean.put("depth", depthForDescriptor(elements.get(i)));
+			}
+
+			List<TypeDescriptor> attributes = ((ComplexTypeDescriptor) descriptor).getAttributes();
+			String[] elementNames = Arrays.copyOf(names, names.length);
+			Arrays.sort(elementNames);
+			String[] attributeNames = new String[attributes.size()];
+			Class<?>[] attributeTypes = new Class<?>[attributes.size()];
+			TypeDescriptor.retrieveSignature(attributes, attributeNames, attributeTypes);
+			for (int i = 0; i < attributeNames.length; i++) {
+				ObjectNode portBean = inputDefinitions.addObject();
+				if (Arrays.binarySearch(elementNames, attributeNames[i]) < 0) {
+					portBean.put("name", attributeNames[i]);
+				} else {
+					portBean.put("name", "1" + attributeNames[i]);
+				}
+				portBean.put("mimeType", TypeDescriptor.translateJavaType(attributeTypes[i]));
+				portBean.put("depth", depthForDescriptor(attributes.get(i)));
+			}
+			
+		} else if (descriptor instanceof ArrayTypeDescriptor) {
+			ObjectNode portBean = inputDefinitions.addObject();
+			portBean.put("name", descriptor.getName());
+
+			if (((ArrayTypeDescriptor) descriptor).getElementType() instanceof BaseTypeDescriptor) {
+				portBean.put("mimeType", "l('text/plain')");
+			} else {
+				portBean.put("mimeType", "l('text/xml')");
+			}
+			portBean.put("depth", 1);
+		}
+
+		String wrappedType = new XMLOutputter().outputString(element);
+		bean.put("wrappedType", wrappedType);
+
+		return bean;
+	}
+
+
+	private static int depthForDescriptor(TypeDescriptor desc) {
+		if (desc instanceof ArrayTypeDescriptor && (!((ArrayTypeDescriptor)desc).isWrapped() || ((ArrayTypeDescriptor)desc).getElementType() instanceof BaseTypeDescriptor)) {
+			return 1;
+		}
+		else {
+			return 0;
+		}
+	}
+
+	public static JsonNode buildBeanForOutput(Element element)
+			throws JDOMException, IOException {
+		ObjectNode bean = JSON_NODE_FACTORY.objectNode();
+		ArrayNode inputDefinitions = bean.arrayNode();
+		bean.put("inputPorts", inputDefinitions);
+		ArrayNode outputDefinitions = bean.arrayNode();
+		bean.put("outputPorts", outputDefinitions);
+
+		TypeDescriptor descriptor = XMLSplitterSerialisationHelper
+				.extensionXMLToTypeDescriptor(element);
+
+		ObjectNode inBean = inputDefinitions.addObject();
+		inBean.put("name", "input");
+		inBean.put("mimeType", "'text/xml'");
+		inBean.put("depth", 0);
+
+		if (descriptor instanceof ComplexTypeDescriptor) {
+			List<TypeDescriptor> elements = ((ComplexTypeDescriptor) descriptor).getElements();
+			String[] names = new String[elements.size()];
+			Class<?>[] types = new Class<?>[elements.size()];
+			TypeDescriptor.retrieveSignature(elements, names, types);
+			for (int i = 0; i < names.length; i++) {
+				ObjectNode portBean = outputDefinitions.addObject();
+				portBean.put("name", names[i]);
+				portBean.put("mimeType", TypeDescriptor.translateJavaType(types[i]));
+				int depth = depthForDescriptor(elements.get(i));
+				portBean.put("depth", depth);
+				portBean.put("granularDepth", depth);
+			}
+
+			List<TypeDescriptor> attributes = ((ComplexTypeDescriptor) descriptor).getAttributes();
+			String[] elementNames = Arrays.copyOf(names, names.length);
+			Arrays.sort(elementNames);
+			String[] attributeNames = new String[attributes.size()];
+			Class<?>[] attributeTypes = new Class<?>[attributes.size()];
+			TypeDescriptor.retrieveSignature(attributes, attributeNames, attributeTypes);
+			for (int i = 0; i < attributeNames.length; i++) {
+				ObjectNode portBean = outputDefinitions.addObject();
+				if (Arrays.binarySearch(elementNames, attributeNames[i]) < 0) {
+					portBean.put("name", attributeNames[i]);
+				} else {
+					portBean.put("name", "1" + attributeNames[i]);
+				}
+				portBean.put("mimeType", TypeDescriptor
+						.translateJavaType(attributeTypes[i]));
+				int depth = depthForDescriptor(attributes.get(i));
+				portBean.put("depth", depth);
+				portBean.put("granularDepth", depth);
+			}
+			
+		} else if (descriptor instanceof ArrayTypeDescriptor) {
+			ObjectNode portBean = outputDefinitions.addObject();
+			String name=descriptor.getName();
+			portBean.put("name", name);
+			portBean.put("depth", 1);
+			portBean.put("granularDepth", 1);
+			if (((ArrayTypeDescriptor) descriptor).getElementType() instanceof BaseTypeDescriptor) {
+				portBean.put("mimeType", "l('text/plain')");
+			} else {
+				portBean.put("mimeType", "l('text/xml')");
+			}
+		}
+
+
+		String wrappedType = new XMLOutputter().outputString(element);
+		bean.put("wrappedType", wrappedType);
+
+		return bean;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker b/taverna-wsdl-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
new file mode 100644
index 0000000..fb1c735
--- /dev/null
+++ b/taverna-wsdl-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
@@ -0,0 +1,4 @@
+net.sf.taverna.t2.activities.wsdl.WSDLActivityHealthChecker
+net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLOutputSplitterHealthChecker
+net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterHealthChecker
+net.sf.taverna.t2.activities.wsdl.WSDLActivityDescriptorChecker
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context-osgi.xml b/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context-osgi.xml
new file mode 100644
index 0000000..b8976d5
--- /dev/null
+++ b/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context-osgi.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="wsdlActivityHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
+	<service ref="xmlInputSplitterHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
+	<service ref="xmlOutputSplitterHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
+
+	<service ref="wsdlActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
+	<service ref="xmlInputSplitterActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
+	<service ref="xmlOutputSplitterActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
+
+	<reference id="credentialManager" interface="net.sf.taverna.t2.security.credentialmanager.CredentialManager" />
+	<reference id="edits" interface="net.sf.taverna.t2.workflowmodel.Edits" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context.xml
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context.xml b/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context.xml
new file mode 100644
index 0000000..fbbdf55
--- /dev/null
+++ b/taverna-wsdl-activity/src/main/resources/META-INF/spring/wsdl-activity-context.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="wsdlActivityHealthChecker" class="net.sf.taverna.t2.activities.wsdl.WSDLActivityHealthChecker" />
+	<bean id="xmlInputSplitterHealthChecker" class="net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterHealthChecker" />
+	<bean id="xmlOutputSplitterHealthChecker" class="net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLOutputSplitterHealthChecker" />
+
+	<bean id="wsdlActivityFactory" class="net.sf.taverna.t2.activities.wsdl.WSDLActivityFactory">
+		<property name="credentialManager" ref="credentialManager" />
+		<property name="edits" ref="edits" />
+	</bean>
+	<bean id="xmlInputSplitterActivityFactory" class="net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterActivityFactory">
+		<property name="edits" ref="edits" />
+	</bean>
+	<bean id="xmlOutputSplitterActivityFactory" class="net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLOutputSplitterActivityFactory">
+		<property name="edits" ref="edits" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/main/resources/schema.json
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/main/resources/schema.json b/taverna-wsdl-activity/src/main/resources/schema.json
new file mode 100644
index 0000000..bcafb67
--- /dev/null
+++ b/taverna-wsdl-activity/src/main/resources/schema.json
@@ -0,0 +1,39 @@
+{
+    "$schema": "http://json-schema.org/draft-03/schema#",
+    "id": "http://ns.taverna.org.uk/2010/activity/wsdl.schema.json",
+    "title": "WSDL activity configuration",
+    "type": "object",
+    "properties": {
+        "@context": {
+            "description": "JSON-LD context for interpreting the configuration as RDF",
+            "required": true,
+            "enum": ["http://ns.taverna.org.uk/2010/activity/wsdl.context.json"]
+        },
+        "operation": {
+            "title": "WSDL Operation",
+            "description": "The WSDL operation",
+            "type": "object",
+            "properties": {
+           		"wsdl": {
+            		"title": "WSDL URL",
+            		"description": "The location of the WSDL definition for the web service",
+            		"type": "string",
+		          	"required": true
+           		},
+           		"name": {
+            		"title": "Operation Name",
+            		"description": "The name of the WSDL operation",
+            		"type": "sting",
+ 		         	"required": true
+            	}
+            },
+            "required": true
+        },
+        "securityProfile": {
+            "title": "Security Profile",
+            "description": "WS-Security settings required by the web service",
+            "type": "string",
+            "required": false
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/main/resources/xml-splitter.schema.json
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/main/resources/xml-splitter.schema.json b/taverna-wsdl-activity/src/main/resources/xml-splitter.schema.json
new file mode 100644
index 0000000..3dbae7c
--- /dev/null
+++ b/taverna-wsdl-activity/src/main/resources/xml-splitter.schema.json
@@ -0,0 +1,80 @@
+{
+    "$schema": "http://json-schema.org/draft-03/schema#",
+    "id": "http://ns.taverna.org.uk/2010/activity/xml-splitter.schema.json",
+    "title": "XML splitter activity configuration",
+    "type": "object",
+    "properties": {
+        "@context": {
+            "description": "JSON-LD context for interpreting the configuration as RDF",
+            "required": true,
+            "enum": ["http://ns.taverna.org.uk/2010/activity/xml-splitter.context.json"]
+        },
+        "wrappedType": {
+            "title": "Wrapped Type XML",
+            "type": "string",
+            "required": true
+        },
+        "inputPorts": {
+            "title": "Input Ports",
+            "type": "array",
+            "required": false,
+            "items": {
+                "type": "object",
+                "properties": {
+           		    "name": {
+                		"title": "Port Name",
+            			"description": "The name of the port",
+            			"type": "string",
+		          		"required": true
+           			},
+                    "depth": {
+                 		"title": "Port Depth",
+             			"description": "The depth of the port",
+                        "type": "integer",
+                        "required": true
+           			},
+                    "mimeType": {
+                 		"title": "Mime Type",
+             			"description": "The mime type of the port",
+                        "type": "string",
+                        "required": true
+                    }
+                }
+             }
+        },
+        "outputPorts": {
+            "title": "Output Ports",
+            "type": "array",
+            "required": false,
+            "items": {
+                "type": "object",
+                "properties": {
+           		    "name": {
+                		"title": "Port Name",
+            			"description": "The name of the port",
+            			"type": "string",
+		          		"required": true
+           			},
+                    "depth": {
+                 		"title": "Port Depth",
+             			"description": "The depth of the port",
+                        "type": "integer",
+                        "required": true
+                    }
+                    "granularDepth": {
+                 		"title": "Port Granular Depth",
+             			"description": "The granular depth of the port",
+                        "type": "integer",
+                        "required": true
+           			},
+                    "mimeType": {
+                 		"title": "Mime Type",
+             			"description": "The mime type of the port",
+                        "type": "string",
+                        "required": true
+                    }
+                }
+             }
+         }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityFactoryTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityFactoryTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityFactoryTest.java
new file mode 100644
index 0000000..9b147cf
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityFactoryTest.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *    
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.net.URI;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * 
+ * @author David Withers
+ */
+public class WSDLActivityFactoryTest {
+
+	private WSDLActivityFactory factory;
+	
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+		factory = new WSDLActivityFactory();
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.activities.beanshell.BeanshellActivityFactory#createActivity()}.
+	 */
+	@Test
+	public void testCreateActivity() {
+		WSDLActivity createActivity = factory.createActivity();
+		assertNotNull(createActivity);
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.activities.beanshell.BeanshellActivityFactory#getActivityType()}.
+	 */
+	@Test
+	public void testGetActivityURI() {
+		assertEquals(URI.create(WSDLActivity.URI), factory.getActivityType());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityTest.java
new file mode 100644
index 0000000..b1868ac
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSDLActivityTest.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.activities.testutils.ActivityInvoker;
+import net.sf.taverna.t2.activities.testutils.LocationConstants;
+import net.sf.taverna.t2.workflowmodel.OutputPort;
+import net.sf.taverna.wsdl.parser.ComplexTypeDescriptor;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+public class WSDLActivityTest implements LocationConstants {
+
+	private static final JsonNodeFactory JSON_NODE_FACTORY = JsonNodeFactory.instance;
+
+	private static WSDLActivity activity;
+	private static ObjectNode configBean;
+	private static ObjectNode operationConfigBean;
+	private static String wsdlLocation = WSDL_TEST_BASE
+			+ "eutils/eutils_lite.wsdl";
+
+	//@BeforeClass
+    @Ignore("Integration test")
+	public static void setUp() throws Exception {
+		activity = new WSDLActivity(null);
+		configBean = JSON_NODE_FACTORY.objectNode();
+		operationConfigBean = configBean.objectNode();
+		configBean.put("operation", operationConfigBean);
+		operationConfigBean.put("name", "run_eInfo");
+		operationConfigBean.put("wsdl", wsdlLocation);
+		activity.configure(configBean);
+	}
+
+	@Test
+    @Ignore("Integration test")
+	public void testConfigureWSDLActivityConfigurationBean() throws Exception {
+		assertEquals("There should be 1 input ports", 1, activity
+				.getInputPorts().size());
+		assertEquals("There should be 2 output ports", 2, activity
+				.getOutputPorts().size());
+
+		assertEquals("parameters", activity.getInputPorts().iterator().next()
+				.getName());
+
+		List<String> expectedOutputNames = new ArrayList<String>();
+		expectedOutputNames.add("parameters");
+		expectedOutputNames.add("attachmentList");
+		for (OutputPort port : activity.getOutputPorts()) {
+			assertTrue("Unexpected output name:" + port.getName(),
+					expectedOutputNames.contains(port.getName()));
+			expectedOutputNames.remove(port.getName());
+		}
+		assertEquals(
+				"Not all of the expected outputs were found, those remainng are:"
+						+ expectedOutputNames.toArray(), 0, expectedOutputNames
+						.size());
+	}
+
+	@Test
+    @Ignore("Integration test")
+	public void testGetConfiguration() throws Exception {
+		assertSame(configBean, activity.getConfiguration());
+	}
+
+	@Test
+	@Ignore("Service is broken")
+	public void testExecuteAsynchMapOfStringEntityIdentifierAsynchronousActivityCallback()
+			throws Exception {
+		Map<String, Object> inputMap = new HashMap<String, Object>();
+		inputMap.put("parameters", "<parameters><db>pubmed</db></parameters>");
+
+		Map<String, Class<?>> expectedOutputs = new HashMap<String, Class<?>>();
+		expectedOutputs.put("parameters", String.class);
+
+		Map<String, Object> outputMap = ActivityInvoker.invokeAsyncActivity(
+				activity, inputMap, expectedOutputs);
+		assertNotNull("there should be an output named parameters", outputMap
+				.get("parameters"));
+		String xml;
+		if (outputMap.get("parameters") instanceof String) {
+			xml = (String) outputMap.get("parameters");
+		} else {
+			byte[] bytes = (byte[]) outputMap.get("parameters");
+			xml = new String(bytes);
+		}
+
+		assertTrue("the xml is not what was expected", xml
+				.contains("<DbName>pubmed</DbName>"));
+	}
+
+    @Ignore("Integration test")
+	@Test
+	public void testGetTypeDescriptorForOutputPort() throws Exception {
+		assertNotNull("The type for the port 'paremeters' could not be found",
+				activity.getTypeDescriptorForOutputPort("parameters"));
+		assertTrue(
+				"The type for the port 'paremeters' shoule be complex",
+				activity.getTypeDescriptorForOutputPort("parameters") instanceof ComplexTypeDescriptor);
+		assertNull("There should be no type descriptor for 'fred' port",
+				activity.getTypeDescriptorForOutputPort("fred"));
+	}
+
+    @Ignore("Integration test")
+	@Test
+	public void testGetTypeDescriptorForInputPort() throws Exception {
+		assertNotNull("The type for the port 'parameters' could not be found",
+				activity.getTypeDescriptorForInputPort("parameters"));
+		assertTrue(
+				"The type for the port 'parameters' shoule be complex",
+				activity.getTypeDescriptorForInputPort("parameters") instanceof ComplexTypeDescriptor);
+		assertNull("There should be no type descriptor for 'fred' port",
+				activity.getTypeDescriptorForInputPort("fred"));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSRFActivityTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSRFActivityTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSRFActivityTest.java
new file mode 100644
index 0000000..dd144cf
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/WSRFActivityTest.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
+
+import net.sf.taverna.wsdl.parser.WSDLParser;
+
+import org.apache.axis.client.Call;
+import org.apache.axis.message.SOAPEnvelope;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.Namespace;
+import org.jdom.input.SAXBuilder;
+import org.junit.Before;
+import org.junit.Test;
+
+public class WSRFActivityTest {
+
+	public class DummyInvoker extends T2WSDLSOAPInvoker {
+
+		public DummyInvoker(String wsrfEndpoint) {
+			super(wsdlParser, "add", Arrays.asList("attachmentList"),
+					wsrfEndpoint, null);
+		}
+
+		@Override
+		protected SOAPEnvelope invokeCall(Call call, SOAPEnvelope requestEnv) {
+			requestXML = requestEnv;
+			return null;
+		}
+	}
+
+	private static final Namespace SoapEnvelopeNS = Namespace
+			.getNamespace("http://schemas.xmlsoap.org/soap/envelope/");
+	private static final Namespace CounterNS = Namespace
+			.getNamespace("http://counter.com");
+	private static final Namespace DifficultNS = Namespace
+			.getNamespace("http://difficult.com/");
+
+	private static final Namespace DefaultNS = Namespace
+			.getNamespace("http://default/");
+
+	private URL counterServiceWSDL;
+	private WSDLParser wsdlParser;
+	protected SOAPEnvelope requestXML;
+
+	@Before
+	public void makeWSDLParser() throws Exception {
+		String path = "wsrf/counterService/CounterService_.wsdl";
+		counterServiceWSDL = getClass().getResource(path);
+		assertNotNull("Coult not find test WSDL " + path, counterServiceWSDL);
+		wsdlParser = new WSDLParser(counterServiceWSDL.toExternalForm());
+	}
+
+	public void noHeaders() throws Exception {
+
+	}
+
+	@Test
+	public void insertedEndpoint() throws Exception {
+		// From T2-677 - support wsa:EndpointReference directly as well
+		String wsrfEndpoint = "" +
+				"<wsa:EndpointReference "
+				+ "xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/03/addressing' "
+				+ "xmlns:counter='http://counter.com'>"
+				+ "  <wsa:Address>http://130.88.195.110:8080/wsrf/services/CounterService</wsa:Address>"
+				+ "   <wsa:ReferenceProperties>"
+				+ "     <counter:CounterKey>15063581</counter:CounterKey>"
+				+ "      <difficult:one xmlns:difficult='http://difficult.com/' "
+				+ "             difficult:attrib='something' attrib='else' >"
+				+ "         <difficult:fish><counter:fish /></difficult:fish> "
+				+ "      </difficult:one>" + "      <emptyNamespace>"
+				+ "          <defaultNamespace xmlns='http://default/'>"
+				+ "\n  default  \n " + "</defaultNamespace>"
+				+ "          <stillEmpty />" + "      </emptyNamespace>"
+				+ "  </wsa:ReferenceProperties>"
+				+ "  <wsa:ReferenceParameters/>" + "</wsa:EndpointReference>";
+
+		// Note: We'll subclass to avoid calling service
+		// and request attachmentList to trigger TAV-617-code and avoid
+		// parsing of the (missing) response
+		T2WSDLSOAPInvoker invoker = new DummyInvoker(wsrfEndpoint);
+		Map<String, Object> results = invoker.invoke(Collections.singletonMap(
+				"add", "10"));
+		assertEquals(1, results.size());
+		assertEquals("attachmentList", results.keySet().iterator().next());
+
+		SAXBuilder builder = new SAXBuilder();
+		Document doc = builder.build(new StringReader(requestXML.toString()));
+		Element header = doc.getRootElement()
+				.getChild("Header", SoapEnvelopeNS);
+		assertNotNull("Could not find soapenv:Header", header);
+		assertEquals("Unexpected number of children in header", 3, header
+				.getChildren().size());
+
+		// Check that everything was preserved as much as possible
+
+		Element counterChild = header.getChild("CounterKey", CounterNS);
+		assertEquals("15063581", counterChild.getText());
+		assertEquals("Did not preserve namespace", "counter", counterChild
+				.getNamespacePrefix());
+
+		Element difficultChild = header.getChild("one", DifficultNS);
+		assertNotNull("Could not find difficult:one", difficultChild);
+		assertEquals("Did not preserve namespace", "difficult", difficultChild
+				.getNamespacePrefix());
+		assertEquals("something", difficultChild.getAttribute("attrib",
+				DifficultNS).getValue());
+		assertEquals("else", difficultChild.getAttribute("attrib",
+				Namespace.NO_NAMESPACE).getValue());
+
+		Element counterFish = difficultChild.getChild("fish", DifficultNS)
+				.getChild("fish", CounterNS);
+		assertEquals("counter", counterFish.getNamespacePrefix());
+
+		Element emptyChild = header.getChild("emptyNamespace",
+				Namespace.NO_NAMESPACE);
+		Element defaultNamespace = emptyChild.getChild("defaultNamespace",
+				DefaultNS);
+		assertEquals("\n  default  \n ", defaultNamespace.getText());
+
+		Element stillEmpty = emptyChild.getChild("stillEmpty");
+		assertEquals(Namespace.NO_NAMESPACE, stillEmpty.getNamespace());
+
+	}
+
+
+	@Test
+	public void insertedEndpointWrapped() throws Exception {
+		// From T2-677 - support wsa:EndpointReference wrapped in <*> to avoid
+		// unnecessary XML splitters and to support legacy workflows
+
+		// Example from http://www.mygrid.org.uk/dev/issues/browse/TAV-23
+		String wsrfEndpoint = "" +
+				"<c:createCounterResponse xmlns:c='http://counter.com'>" +
+				"<wsa:EndpointReference "
+				+ "xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/03/addressing' "
+				+ "xmlns:counter='http://counter.com'>"
+				+ "  <wsa:Address>http://130.88.195.110:8080/wsrf/services/CounterService</wsa:Address>"
+				+ "   <wsa:ReferenceProperties>"
+				+ "     <counter:CounterKey>15063581</counter:CounterKey>"
+				+ "      <difficult:one xmlns:difficult='http://difficult.com/' "
+				+ "             difficult:attrib='something' attrib='else' >"
+				+ "         <difficult:fish><counter:fish /></difficult:fish> "
+				+ "      </difficult:one>" + "      <emptyNamespace>"
+				+ "          <defaultNamespace xmlns='http://default/'>"
+				+ "\n  default  \n " + "</defaultNamespace>"
+				+ "          <stillEmpty />" + "      </emptyNamespace>"
+				+ "  </wsa:ReferenceProperties>"
+				+ "  <wsa:ReferenceParameters/>" + "</wsa:EndpointReference>" +
+				"</c:createCounterResponse>";
+
+		// Note: We'll subclass to avoid calling service
+		// and request attachmentList to trigger TAV-617-code and avoid
+		// parsing of the (missing) response
+		T2WSDLSOAPInvoker invoker = new DummyInvoker(wsrfEndpoint);
+		Map<String, Object> results = invoker.invoke(Collections.singletonMap(
+				"add", "10"));
+		assertEquals(1, results.size());
+		assertEquals("attachmentList", results.keySet().iterator().next());
+
+		SAXBuilder builder = new SAXBuilder();
+		Document doc = builder.build(new StringReader(requestXML.toString()));
+		Element header = doc.getRootElement()
+				.getChild("Header", SoapEnvelopeNS);
+		assertNotNull("Could not find soapenv:Header", header);
+		assertEquals("Unexpected number of children in header", 3, header
+				.getChildren().size());
+
+		// Check that everything was preserved as much as possible
+
+		Element counterChild = header.getChild("CounterKey", CounterNS);
+		assertEquals("15063581", counterChild.getText());
+		assertEquals("Did not preserve namespace", "counter", counterChild
+				.getNamespacePrefix());
+
+		Element difficultChild = header.getChild("one", DifficultNS);
+		assertNotNull("Could not find difficult:one", difficultChild);
+		assertEquals("Did not preserve namespace", "difficult", difficultChild
+				.getNamespacePrefix());
+		assertEquals("something", difficultChild.getAttribute("attrib",
+				DifficultNS).getValue());
+		assertEquals("else", difficultChild.getAttribute("attrib",
+				Namespace.NO_NAMESPACE).getValue());
+
+		Element counterFish = difficultChild.getChild("fish", DifficultNS)
+				.getChild("fish", CounterNS);
+		assertEquals("counter", counterFish.getNamespacePrefix());
+
+		Element emptyChild = header.getChild("emptyNamespace",
+				Namespace.NO_NAMESPACE);
+		Element defaultNamespace = emptyChild.getChild("defaultNamespace",
+				DefaultNS);
+		assertEquals("\n  default  \n ", defaultNamespace.getText());
+
+		Element stillEmpty = emptyChild.getChild("stillEmpty");
+		assertEquals(Namespace.NO_NAMESPACE, stillEmpty.getNamespace());
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/HTTPSConnectionsTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/HTTPSConnectionsTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/HTTPSConnectionsTest.java
new file mode 100644
index 0000000..58d6dd5
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/HTTPSConnectionsTest.java
@@ -0,0 +1,50 @@
+package net.sf.taverna.t2.activities.wsdl.security;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.cert.Certificate;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLHandshakeException;
+
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class HTTPSConnectionsTest {
+
+	@Test()
+	@Ignore("https://rpc103.cs.man.ac.uk:8443/wsrf/services no available")
+	public void testHTTPSConnections(){
+
+		String serviceURL = "https://rpc103.cs.man.ac.uk:8443/wsrf/services";
+
+			URL url;
+			try {
+				url = new URL(serviceURL);
+				SSLUtilities.trustAllHttpsCertificates();
+				HttpsURLConnection httpsConnection = (HttpsURLConnection) url.openConnection();
+				httpsConnection.connect();
+				Certificate[] certificates = httpsConnection.getServerCertificates();
+				Assert.assertFalse(certificates.length == 0);
+
+				SSLUtilities.stopTrustingAllHttpsCertificates();
+				HttpsURLConnection httpsConnection2 = (HttpsURLConnection) url.openConnection();
+				httpsConnection2.connect(); // This should now throw an SSLHandshakeException which is a subclass of IOException
+
+			} catch (MalformedURLException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+
+			} catch(SSLHandshakeException e){
+				// This is what we are expecting
+				e.printStackTrace();
+			}
+			catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/SecureServicesInvokerTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/SecureServicesInvokerTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/SecureServicesInvokerTest.java
new file mode 100644
index 0000000..f0c3265
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/security/SecureServicesInvokerTest.java
@@ -0,0 +1,116 @@
+package net.sf.taverna.t2.activities.wsdl.security;
+
+import static org.junit.Assert.assertEquals;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLSession;
+import javax.xml.namespace.QName;
+
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+import org.apache.axis.configuration.XMLStringProvider;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class SecureServicesInvokerTest {
+
+	// Broken service
+	@Ignore
+	@Test
+	public void testCreteCallAndInvoke() throws Exception { 
+			
+
+			String endpoint = "http://www.mygrid.org.uk/axis/services/UsernameHelloService"; // test server
+			//endpoint = "http://rpc212.cs.man.ac.uk/taverna/";
+			
+			HostnameVerifier hv = new HostnameVerifier() {
+				public boolean verify(String hostName, SSLSession session) {
+					return true;
+				}
+			};
+			HttpsURLConnection.setDefaultHostnameVerifier(hv);
+			//endpoint = "https://rpc103.cs.man.ac.uk:8443/wsrf/services/cagrid/SecureHelloWorld?wsdl";
+			
+			// Set the system property "javax.net.ssl.Truststore" to use Taverna's truststore 
+			//System.setProperty("javax.net.ssl.trustStore", "/Users/alex/Desktop/t2truststore.jks");
+			//System.setProperty("javax.net.ssl.trustStorePassword", "raehiekooshe0eghiPhi");
+			//System.clearProperty("javax.net.ssl.trustStoreType");
+			//System.clearProperty("javax.net.ssl.trustStoreProvider");
+			
+			//String endpoint = "http://www.mygrid.org.uk/axis/services/UsernameTimestampHelloService"; // test server
+			//String endpoint = "http://www.mygrid.org.uk/axis/services/UsernameDigestHelloService"; // test server
+			//String endpoint = "http://www.mygrid.org.uk/axis/services/UsernameDigestTimestampHelloService"; // test server
+			
+			//String endpoint = "http://localhost:8080/axis/services/UsernameHelloService" ; // local server
+			//String endpoint = "http://localhost:8080/axis/services/UsernameTimestampHelloService" ; 
+			//String endpoint = "http://localhost:8080/axis/services/UsernameDigestHelloService" ; 
+			//String endpoint = "http://localhost:8080/axis/services/UsernameDigestTimestampHelloService" ; 
+			
+			//Service service = new org.apache.axis.client.Service() ; 
+			
+			//String wssEngineConfigurationString = WSSecurityProfiles.wssUTTimestampProfile;
+			//String wssEngineConfigurationString = WSSecurityProfiles.wssUTDigestProfile;
+			//String wssEngineConfigurationString = WSSecurityProfiles.wssUTDigestTimestampProfile;
+		
+			XMLStringProvider wssEngineConfiguration = new XMLStringProvider("<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" " +
+					"xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">" +
+					"<globalConfiguration>" +
+					"<requestFlow>" +
+					"<handler type=\"java:org.apache.ws.axis.security.WSDoAllSender\">" + 
+					"<parameter name=\"action\" value=\"UsernameToken\"/>" +
+					"<parameter name=\"passwordType\" value=\"PasswordDigest\"/>" +
+					"</handler>"+
+					"</requestFlow>" + 
+					"</globalConfiguration>" + 
+					"<transport name=\"http\" pivot=\"java:org.apache.axis.transport.http.HTTPSender\"/>"+
+					"</deployment>");
+			
+			Service service = new Service(wssEngineConfiguration);
+		
+			Call call = new Call(service);			
+			
+			//call.setTransport(new HTTPTransport());
+			call.setTargetEndpointAddress(endpoint) ; 
+			call.setOperationName(new QName("hello")) ;
+			
+			String username = "testuser";
+			String password = "testpasswd";
+			
+			//WSS4J WSDoAllSender's invoke() method expects username not to be empty before the agent takes over 
+			// to set it so we set it to the WSDL location here (that is used as keystore alias) and later on overwrite it 
+			call.setProperty(Call.USERNAME_PROPERTY, "testuser");
+			call.setProperty(Call.PASSWORD_PROPERTY, "testpasswd");
+					
+			
+			// Set HTTP Basic AuthN
+//			MessageContext context = call.getMessageContext();
+//			Hashtable headers = (Hashtable) context
+//					.getProperty(HTTPConstants.REQUEST_HEADERS);
+//			if (headers == null) {
+//				headers = new Hashtable();
+//				context.setProperty(HTTPConstants.REQUEST_HEADERS, headers);
+//			}
+////			String authorization = Base64.encode(("hudsonadmin" + ":"
+////					+ "ch33se").getBytes());
+//			String authorization = Base64.encode((username + ":"
+//					+ password).getBytes());
+//			headers.put("Authorization", "Basic " + authorization);
+//			System.out.println("HTTP Authorization header: "
+//					+ headers.get("Authorization"));
+//			HTTPSender http = new HTTPSender();
+//			
+//			Transport transport = call.getTransportForProtocol("https");
+//			System.out.println(transport.getClass());
+//			
+			
+			
+		
+			String nickName = "Beauty" ; 
+			System.out.println("Sent: '" + nickName + "'") ; 
+			String ret = (String) call.invoke(new Object[] {nickName}) ;
+			System.out.println("Got: '" + ret + "'") ; 
+			assertEquals(ret, "Hello Beauty!");
+	} 
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/AddXMLSplitterEditTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/AddXMLSplitterEditTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/AddXMLSplitterEditTest.java
new file mode 100644
index 0000000..4e31fcd
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/AddXMLSplitterEditTest.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl.xmlsplitter;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import net.sf.taverna.t2.activities.testutils.LocationConstants;
+import net.sf.taverna.t2.activities.wsdl.WSDLActivity;
+import net.sf.taverna.t2.workflowmodel.Edits;
+import net.sf.taverna.t2.workflowmodel.Processor;
+import net.sf.taverna.t2.workflowmodel.impl.DataflowImpl;
+import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+public class AddXMLSplitterEditTest implements LocationConstants {
+
+	private static final JsonNodeFactory JSON_NODE_FACTORY = JsonNodeFactory.instance;
+
+	private WSDLActivity activity;
+	private DataflowImpl dataflow;
+	private ObjectNode configBean;
+	private static ObjectNode operationConfigBean;
+	private String wsdlLocation = WSDL_TEST_BASE
+	+ "eutils/eutils_lite.wsdl";
+	private Edits edits;
+
+	@Ignore("Integration test")
+	@Before
+	public void setUp() throws Exception {
+		activity = new WSDLActivity(null);
+		configBean = JSON_NODE_FACTORY.objectNode();
+		operationConfigBean = configBean.objectNode();
+		configBean.put("operation", operationConfigBean);
+		operationConfigBean.put("name", "run_eInfo");
+		operationConfigBean.put("wsdl", wsdlLocation);
+		activity.configure(configBean);
+		edits = new EditsImpl();
+
+		dataflow = (DataflowImpl)edits.createDataflow();
+		Processor p=edits.createProcessor("run_eInfo");
+		edits.getDefaultDispatchStackEdit(p).doEdit();
+		edits.getAddActivityEdit(p, activity).doEdit();
+		edits.getMapProcessorPortsForActivityEdit(p).doEdit();
+		edits.getAddProcessorEdit(dataflow, p).doEdit();
+
+	}
+
+	@Ignore("Integration test")
+	@Test
+	public void testAddOutputSplitterToWSDLActivity() throws Exception {
+		AddXMLSplitterEdit edit = new AddXMLSplitterEdit(dataflow,activity,"parameters",false, new EditsImpl());
+		edit.doEdit();
+		assertEquals("The workflow should now contain 2 services",2,dataflow.getProcessors().size());
+		Processor processor=null;
+		for (Processor p : dataflow.getProcessors()) {
+			if (p.getLocalName().equals("parametersXML")) {
+				processor = p;
+				break;
+			}
+		}
+		assertNotNull("There should be a processor named parametersXML",processor);
+		assertEquals("There should be 1 activity",1,processor.getActivityList().size());
+
+		assertEquals("The processor should have 3 output ports",3,processor.getOutputPorts().size());
+		assertEquals("The processor should have 1 input port",1,processor.getInputPorts().size());
+
+		Activity<?>a = processor.getActivityList().get(0);
+		assertEquals("The activity should have 3 output ports",3,a.getOutputPorts().size());
+		assertEquals("The activity should have 1 input port",1,a.getInputPorts().size());
+
+		assertEquals("There should be 1 datalink",1,dataflow.getLinks().size());
+	}
+
+	@Ignore("Integration test")
+	@Test
+	public void testUndo() throws Exception {
+		AddXMLSplitterEdit edit = new AddXMLSplitterEdit(dataflow,activity,"parameters",false, new EditsImpl());
+		edit.doEdit();
+		edit.undo();
+		assertEquals("There should be only 1 processor",1,dataflow.getProcessors().size());
+		assertEquals("The processor should be called run_eInfo","run_eInfo",dataflow.getProcessors().get(0).getLocalName());
+		assertEquals("There should be no datalinks",0,dataflow.getLinks().size());
+	}
+
+	@Ignore("Integration test")
+	@Test
+	public void testAddInputSplitterToWSDLActivity() throws Exception {
+		AddXMLSplitterEdit edit = new AddXMLSplitterEdit(dataflow,activity,"parameters",true, new EditsImpl());
+		edit.doEdit();
+		assertEquals("The workflow should now contain 2 services",2,dataflow.getProcessors().size());
+		Processor processor=null;
+		for (Processor p : dataflow.getProcessors()) {
+			if (p.getLocalName().equals("parametersXML")) {
+				processor = p;
+				break;
+			}
+		}
+		assertNotNull("There should be a processor named parametersXML",processor);
+		assertEquals("There should be 1 activity",1,processor.getActivityList().size());
+		assertEquals("THe processor should have 3 input ports",3,processor.getInputPorts().size());
+		assertEquals("THe processor should have 1 output port",1,processor.getOutputPorts().size());
+
+		Activity<?>a = processor.getActivityList().get(0);
+
+		assertEquals("The activity should have 3 input ports",3,a.getInputPorts().size());
+		assertEquals("The activity 1 output port",1,a.getOutputPorts().size());
+
+		assertEquals("There should be 1 datalink",1,dataflow.getLinks().size());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLInputSplitterActivityTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLInputSplitterActivityTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLInputSplitterActivityTest.java
new file mode 100644
index 0000000..9a73adf
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLInputSplitterActivityTest.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl.xmlsplitter;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.StringReader;
+
+import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.wsdl.parser.BaseTypeDescriptor;
+import net.sf.taverna.wsdl.parser.ComplexTypeDescriptor;
+
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class XMLInputSplitterActivityTest {
+
+	@Test
+	public void testGetTypeDescriptorForInputPort() throws Exception {
+		String xml = "<s:extensions xmlns:s=\"http://org.embl.ebi.escience/xscufl/0.1alpha\"><s:complextype optional=\"false\" unbounded=\"false\" typename=\"personToString\" name=\"parameters\" qname=\"{http://xfire.codehaus.org/BookService}personToString\"><s:elements><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Person\" name=\"person\" qname=\"{http://xfire.codehaus.org/BookService}&gt;personToString&gt;person\"><s:elements><s:complextype optional=\"true\" unbounded=\"false\" typename=\"Address\" name=\"address\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;address\"><s:elements><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"city\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;city\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"road\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;road\" /><s:basetype optional=\"true\" unbounded=\"false\" typ
 ename=\"int\" name=\"roadNumber\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;roadNumber\" /></s:elements></s:complextype><s:basetype optional=\"true\" unbounded=\"false\" typename=\"int\" name=\"age\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;age\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"firstName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;firstName\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"lastName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;lastName\" /></s:elements></s:complextype></s:elements></s:complextype></s:extensions>";
+		Element element = new SAXBuilder().build(new StringReader(xml)).getRootElement();
+		JsonNode bean = XMLSplitterConfigurationBeanBuilder.buildBeanForInput(element);
+		XMLInputSplitterActivity a = new XMLInputSplitterActivity();
+		a.configure(bean);
+		XMLInputSplitterActivityFactory af = new XMLInputSplitterActivityFactory();
+		af.setEdits(new EditsImpl());
+
+		boolean exists = false;
+		for (ActivityInputPort p : af.getInputPorts(bean)) {
+			if (p.getName().equals("person")) {
+				exists=true;
+				break;
+			}
+		}
+
+		assertTrue("The input port named person should have been found",exists);
+
+		assertNotNull("There should be a type descriptor for person",a.getTypeDescriptorForInputPort("person"));
+		assertTrue("The descriptor should be complex",a.getTypeDescriptorForInputPort("person") instanceof ComplexTypeDescriptor);
+	}
+
+	@Test
+	public void testGetTypeDescriptorForInputPort2() throws Exception {
+		String xml = "<s:extensions xmlns:s=\"http://org.embl.ebi.escience/xscufl/0.1alpha\"><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Person\" name=\"person\" qname=\"{http://xfire.codehaus.org/BookService}&gt;personToString&gt;person\"><s:elements><s:complextype optional=\"true\" unbounded=\"false\" typename=\"Address\" name=\"address\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;address\"><s:elements><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"city\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;city\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"road\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;road\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"int\" name=\"roadNumber\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;roadNumber\" /></s:elements></s:complextype><s:basetype optional=\"true\" unb
 ounded=\"false\" typename=\"int\" name=\"age\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;age\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"firstName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;firstName\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"lastName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;lastName\" /></s:elements></s:complextype></s:extensions>";
+		Element element = new SAXBuilder().build(new StringReader(xml)).getRootElement();
+		JsonNode bean = XMLSplitterConfigurationBeanBuilder.buildBeanForInput(element);
+		XMLInputSplitterActivity a = new XMLInputSplitterActivity();
+		a.configure(bean);
+		XMLInputSplitterActivityFactory af = new XMLInputSplitterActivityFactory();
+		af.setEdits(new EditsImpl());
+
+		boolean exists = false;
+		for (ActivityInputPort p : af.getInputPorts(bean)) {
+			if (p.getName().equals("firstName")) {
+				exists=true;
+				break;
+			}
+		}
+
+		assertTrue("The input port named firstName should have been found",exists);
+
+		assertNotNull("There should be a type descriptor for person",a.getTypeDescriptorForInputPort("firstName"));
+		assertTrue("The descriptor should be base type",a.getTypeDescriptorForInputPort("firstName") instanceof BaseTypeDescriptor);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLOutputSplitterActivityTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLOutputSplitterActivityTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLOutputSplitterActivityTest.java
new file mode 100644
index 0000000..b98e243
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLOutputSplitterActivityTest.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl.xmlsplitter;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.StringReader;
+
+import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
+import net.sf.taverna.wsdl.parser.ComplexTypeDescriptor;
+
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class XMLOutputSplitterActivityTest {
+
+	@Test
+	public void testGetTypeDescriptorForOutputPort() throws Exception {
+
+		String xml = "<s:extensions xmlns:s=\"http://org.embl.ebi.escience/xscufl/0.1alpha\"><s:complextype optional=\"false\" unbounded=\"false\" typename=\"getPersonResponse\" name=\"parameters\" qname=\"{http://testing.org}getPersonResponse\"><s:elements><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Person\" name=\"getPersonReturn\" qname=\"{http://testing.org}&gt;getPersonResponse&gt;getPersonReturn\"><s:elements><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Address\" name=\"address\" qname=\"{http://testing.org}Person&gt;address\"><s:elements><s:basetype optional=\"false\" unbounded=\"false\" typename=\"string\" name=\"city\" qname=\"{http://testing.org}Address&gt;city\" /><s:basetype optional=\"false\" unbounded=\"false\" typename=\"int\" name=\"number\" qname=\"{http://testing.org}Address&gt;number\" /><s:basetype optional=\"false\" unbounded=\"false\" typename=\"string\" name=\"road\" qname=\"{http://testing.org}Address&gt;road\" /></s:element
 s></s:complextype><s:basetype optional=\"false\" unbounded=\"false\" typename=\"int\" name=\"age\" qname=\"{http://testing.org}Person&gt;age\" /><s:basetype optional=\"false\" unbounded=\"false\" typename=\"string\" name=\"name\" qname=\"{http://testing.org}Person&gt;name\" /></s:elements></s:complextype></s:elements></s:complextype></s:extensions>";
+		Element element = new SAXBuilder().build(new StringReader(xml)).getRootElement();
+		JsonNode bean = XMLSplitterConfigurationBeanBuilder.buildBeanForOutput(element);
+		XMLOutputSplitterActivity a = new XMLOutputSplitterActivity();
+		a.setEdits(new EditsImpl());
+		a.configure(bean);
+
+		assertNotNull("There should be a descriptor for the port getPersonReturn",a.getTypeDescriptorForOutputPort("getPersonReturn"));
+		assertTrue("The descriptor should be complex",a.getTypeDescriptorForOutputPort("getPersonReturn") instanceof ComplexTypeDescriptor);
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilderTest.java
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilderTest.java b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilderTest.java
new file mode 100644
index 0000000..a3d2f3b
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/java/net/sf/taverna/t2/activities/wsdl/xmlsplitter/XMLSplitterConfigurationBeanBuilderTest.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY 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 along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.wsdl.xmlsplitter;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.StringReader;
+
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class XMLSplitterConfigurationBeanBuilderTest {
+
+	@Test
+	public void testBuildBeanForInput() throws Exception  {
+		String xml = "<s:extensions xmlns:s=\"http://org.embl.ebi.escience/xscufl/0.1alpha\"><s:complextype optional=\"false\" unbounded=\"false\" typename=\"personToString\" name=\"parameters\" qname=\"{http://xfire.codehaus.org/BookService}personToString\"><s:elements><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Person\" name=\"person\" qname=\"{http://xfire.codehaus.org/BookService}&gt;personToString&gt;person\"><s:elements><s:complextype optional=\"true\" unbounded=\"false\" typename=\"Address\" name=\"address\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;address\"><s:elements><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"city\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;city\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"road\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;road\" /><s:basetype optional=\"true\" unbounded=\"false\" typ
 ename=\"int\" name=\"roadNumber\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;roadNumber\" /></s:elements></s:complextype><s:basetype optional=\"true\" unbounded=\"false\" typename=\"int\" name=\"age\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;age\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"firstName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;firstName\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"lastName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;lastName\" /></s:elements></s:complextype></s:elements></s:complextype></s:extensions>";
+		Element element = new SAXBuilder().build(new StringReader(xml)).getRootElement();
+		JsonNode bean = XMLSplitterConfigurationBeanBuilder.buildBeanForInput(element);
+		assertNotNull("The bean should not be null",bean);
+
+		assertEquals("There should be 1 input",1,bean.get("inputPorts").size());
+		assertEquals("There should be 1 output",1,bean.get("outputPorts").size());
+
+		assertEquals("The input should be named person","person",bean.get("inputPorts").get(0).get("name").textValue());
+		assertEquals("The output should be named output","output",bean.get("outputPorts").get(0).get("name").textValue());
+
+		assertEquals("The type xml definition should match",xml,bean.get("wrappedType").textValue());
+	}
+
+	@Test
+	public void testBuildBeanForInput2() throws Exception {
+		String xml = "<s:extensions xmlns:s=\"http://org.embl.ebi.escience/xscufl/0.1alpha\"><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Person\" name=\"person\" qname=\"{http://xfire.codehaus.org/BookService}&gt;personToString&gt;person\"><s:elements><s:complextype optional=\"true\" unbounded=\"false\" typename=\"Address\" name=\"address\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;address\"><s:elements><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"city\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;city\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"road\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;road\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"int\" name=\"roadNumber\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Address&gt;roadNumber\" /></s:elements></s:complextype><s:basetype optional=\"true\" unb
 ounded=\"false\" typename=\"int\" name=\"age\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;age\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"firstName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;firstName\" /><s:basetype optional=\"true\" unbounded=\"false\" typename=\"string\" name=\"lastName\" qname=\"{http://complex.pojo.axis2.menagerie.googlecode}Person&gt;lastName\" /></s:elements></s:complextype></s:extensions>";
+		Element element = new SAXBuilder().build(new StringReader(xml)).getRootElement();
+
+		JsonNode bean = XMLSplitterConfigurationBeanBuilder.buildBeanForInput(element);
+		assertNotNull("The bean should not be null",bean);
+
+		assertEquals("There should be 4 inputs",4,bean.get("inputPorts").size());
+		assertEquals("There should be 1 output",1,bean.get("outputPorts").size());
+
+		assertEquals("The first input should be named address","address",bean.get("inputPorts").get(0).get("name").textValue());
+		assertEquals("The output should be named output","output",bean.get("outputPorts").get(0).get("name").textValue());
+
+		assertEquals("The type xml definition should match",xml,bean.get("wrappedType").textValue());
+	}
+
+	@Test
+	public void testBuildBeanForOutput() throws Exception {
+		String xml = "<s:extensions xmlns:s=\"http://org.embl.ebi.escience/xscufl/0.1alpha\"><s:complextype optional=\"false\" unbounded=\"false\" typename=\"getPersonResponse\" name=\"parameters\" qname=\"{http://testing.org}getPersonResponse\"><s:elements><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Person\" name=\"getPersonReturn\" qname=\"{http://testing.org}&gt;getPersonResponse&gt;getPersonReturn\"><s:elements><s:complextype optional=\"false\" unbounded=\"false\" typename=\"Address\" name=\"address\" qname=\"{http://testing.org}Person&gt;address\"><s:elements><s:basetype optional=\"false\" unbounded=\"false\" typename=\"string\" name=\"city\" qname=\"{http://testing.org}Address&gt;city\" /><s:basetype optional=\"false\" unbounded=\"false\" typename=\"int\" name=\"number\" qname=\"{http://testing.org}Address&gt;number\" /><s:basetype optional=\"false\" unbounded=\"false\" typename=\"string\" name=\"road\" qname=\"{http://testing.org}Address&gt;road\" /></s:element
 s></s:complextype><s:basetype optional=\"false\" unbounded=\"false\" typename=\"int\" name=\"age\" qname=\"{http://testing.org}Person&gt;age\" /><s:basetype optional=\"false\" unbounded=\"false\" typename=\"string\" name=\"name\" qname=\"{http://testing.org}Person&gt;name\" /></s:elements></s:complextype></s:elements></s:complextype></s:extensions>";
+		Element element = new SAXBuilder().build(new StringReader(xml)).getRootElement();
+		JsonNode bean = XMLSplitterConfigurationBeanBuilder.buildBeanForOutput(element);
+
+		assertNotNull("The bean should not be null",bean);
+
+		assertEquals("There should be 1 input",1,bean.get("inputPorts").size());
+		assertEquals("There should be 1 output",1,bean.get("outputPorts").size());
+
+		assertEquals("The input should be named input","input",bean.get("inputPorts").get(0).get("name").textValue());
+		assertEquals("The output shouldbe named getPersonResponse","getPersonReturn",bean.get("outputPorts").get(0).get("name").textValue());
+
+		assertEquals("The type xml definition should match",xml,bean.get("wrappedType").textValue());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/resources/log4j.properties b/taverna-wsdl-activity/src/test/resources/log4j.properties
new file mode 100644
index 0000000..e8980e5
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/resources/log4j.properties
@@ -0,0 +1,8 @@
+log4j.rootLogger=WARN, CONSOLE
+
+# Default output to console
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%-5p %d{ISO8601} (%c:%L) - %m%n
+
+log4j.logger.net.sf.taverna.t2.activities.wsdl=INFO
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/CounterService_.wsdl
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/CounterService_.wsdl b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/CounterService_.wsdl
new file mode 100644
index 0000000..7e628e0
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/CounterService_.wsdl
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Counter" targetNamespace="http://counter.com/service" xmlns:binding="http://counter.com/bindings" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <wsdl:import location="counter_bindings.wsdl" namespace="http://counter.com/bindings"/>
+  <wsdl:service name="CounterService">
+    <wsdl:port binding="binding:CounterPortTypeSOAPBinding" name="CounterPortTypePort">
+      <soap:address location="http://localhost:8080/wsrf/services/CounterService"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-Addressing.xsd
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-Addressing.xsd b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-Addressing.xsd
new file mode 100644
index 0000000..008c65e
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-Addressing.xsd
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Legal Disclaimer
+
+The presentation, distribution or other dissemination of the information 
+contained in this document is not a license, either expressly or impliedly, 
+to any intellectual property owned or controlled by BEA or IBM or Microsoft
+and\or any other third party.  BEA and IBM and Microsoft and\or any other
+third party may have patents, patent applications, trademarks, copyrights, 
+or other intellectual property rights covering subject matter in this 
+document.  The furnishing of this document does not give you any license 
+to BEA's and IBM's and Microsoft's or any other third party's patents, 
+trademarks, copyrights, or other intellectual property.
+
+This document and the information contained herein is provided on an "AS IS"
+basis and to the maximum extent permitted by applicable law, BEA and IBM 
+and Microsoft provide the document AS IS AND WITH ALL FAULTS, and hereby 
+disclaims all other warranties and conditions, either express, implied or 
+statutory, including, but not limited to, any (if any) implied warranties, 
+duties or conditions of merchantability, of fitness for a particular 
+purpose, of accuracy or completeness of responses, of results, of 
+workmanlike effort, of lack of viruses, and of lack of negligence, all with
+regard to the document. ALSO, THERE IS NO WARRANTY OR CONDITION OF 
+TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 
+NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE 
+DOCUMENT.
+
+IN NO EVENT WILL BEA or IBM or MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE
+COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, 
+LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL 
+DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY 
+WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR 
+NOT SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Copyright Notice
+
+Copyright 2003,2004 BEA Systems Inc. and IBM Corporation and Microsoft Corporation. All rights reserved.--><xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/03/addressing" elementFormDefault="qualified" blockDefault="#all" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+  <!--//////////////////// WS-Addressing ////////////////////-->
+  <!--Endpoint reference-->
+  <xs:element name="EndpointReference" type="wsa:EndpointReferenceType"/>
+  <xs:complexType name="EndpointReferenceType">
+    <xs:sequence>
+      <xs:element name="Address" type="wsa:AttributedURI"/>
+      <xs:element name="ReferenceProperties" type="wsa:ReferencePropertiesType" minOccurs="0"/>
+      <xs:element name="PortType" type="wsa:AttributedQName" minOccurs="0"/>
+      <xs:element name="ServiceName" type="wsa:ServiceNameType" minOccurs="0"/>
+      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
+        <xs:annotation>
+          <xs:documentation>If "Policy" elements from namespace "http://schemas.xmlsoap.org/ws/2002/12/policy#policy" are used, they must appear first (before any extensibility elements).</xs:documentation>
+        </xs:annotation>
+      </xs:any>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+  <xs:complexType name="ReferencePropertiesType">
+    <xs:sequence>
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="ServiceNameType">
+    <xs:simpleContent>
+      <xs:extension base="xs:QName">
+        <xs:attribute name="PortName" type="xs:NCName"/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <!--Message information header blocks-->
+  <xs:element name="MessageID" type="wsa:AttributedURI"/>
+  <xs:element name="RelatesTo" type="wsa:Relationship"/>
+  <xs:element name="To" type="wsa:AttributedURI"/>
+  <xs:element name="Action" type="wsa:AttributedURI"/>
+  <xs:element name="From" type="wsa:EndpointReferenceType"/>
+  <xs:element name="ReplyTo" type="wsa:EndpointReferenceType"/>
+  <xs:element name="FaultTo" type="wsa:EndpointReferenceType"/>
+  <xs:complexType name="Relationship">
+    <xs:simpleContent>
+      <xs:extension base="xs:anyURI">
+        <xs:attribute name="RelationshipType" type="xs:QName" use="optional"/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <xs:simpleType name="RelationshipTypeValues">
+    <xs:restriction base="xs:QName">
+      <xs:enumeration value="wsa:Reply"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:element name="ReplyAfter"/>
+  <xs:complexType name="ReplyAfterType">
+    <xs:simpleContent>
+      <xs:extension base="xs:nonNegativeInteger">
+        <xs:anyAttribute namespace="##other"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <xs:simpleType name="FaultSubcodeValues">
+    <xs:restriction base="xs:QName">
+      <xs:enumeration value="wsa:InvalidMessageInformationHeader"/>
+      <xs:enumeration value="wsa:MessageInformationHeaderRequired"/>
+      <xs:enumeration value="wsa:DestinationUnreachable"/>
+      <xs:enumeration value="wsa:ActionNotSupported"/>
+      <xs:enumeration value="wsa:EndpointUnavailable"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:attribute name="Action" type="xs:anyURI"/>
+  <!--Common declarations and definitions-->
+  <xs:complexType name="AttributedQName">
+    <xs:simpleContent>
+      <xs:extension base="xs:QName">
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <xs:complexType name="AttributedURI">
+    <xs:simpleContent>
+      <xs:extension base="xs:anyURI">
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/390c286b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-BaseFaults.xsd
----------------------------------------------------------------------
diff --git a/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-BaseFaults.xsd b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-BaseFaults.xsd
new file mode 100644
index 0000000..87d3798
--- /dev/null
+++ b/taverna-wsdl-activity/src/test/resources/net/sf/taverna/t2/activities/wsdl/wsrf/counterService/WS-BaseFaults.xsd
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director. 
+
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director. 
+
+Copyright (C) OASIS Open (2004). All Rights Reserved. 
+
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English. 
+
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns. 
+
+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.--><xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd">
+  <xsd:import namespace="http://schemas.xmlsoap.org/ws/2004/03/addressing" schemaLocation="WS-Addressing.xsd"/>
+  <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd">
+    <xsd:annotation>
+      <xsd:documentation>Get access to the xml: attribute groups for xml:lang as declared on 'schema'
+        and 'documentation' below</xsd:documentation>
+    </xsd:annotation>
+  </xsd:import>
+  <!--====================== BaseFault Types =======================-->
+  <xsd:element name="BaseFault" type="wsbf:BaseFaultType"/>
+  <xsd:complexType name="BaseFaultType">
+    <xsd:sequence>
+      <xsd:element name="Timestamp" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
+      <xsd:element name="Originator" type="wsa:EndpointReferenceType" minOccurs="0" maxOccurs="1"/>
+      <xsd:element name="ErrorCode" minOccurs="0" maxOccurs="1">
+        <xsd:complexType>
+          <xsd:complexContent mixed="true">
+            <xsd:extension base="xsd:anyType">
+              <xsd:attribute name="dialect" type="xsd:anyURI" use="required"/>
+            </xsd:extension>
+          </xsd:complexContent>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element name="Description" minOccurs="0" maxOccurs="unbounded">
+        <xsd:complexType>
+          <xsd:simpleContent>
+            <xsd:extension base="xsd:string">
+              <xsd:attribute ref="xml:lang" use="optional"/>
+            </xsd:extension>
+          </xsd:simpleContent>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element name="FaultCause" type="wsbf:BaseFaultType" minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+</xsd:schema>
\ No newline at end of file