You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2011/09/08 23:08:39 UTC

svn commit: r1166905 - in /incubator/airavata/trunk/modules/xbaya-gui: ./ src/main/java/org/apache/airavata/xbaya/component/registry/ src/main/java/org/apache/airavata/xbaya/component/ws/ src/main/java/org/apache/airavata/xbaya/file/gui/ src/main/java/...

Author: lahiru
Date: Thu Sep  8 21:08:38 2011
New Revision: 1166905

URL: http://svn.apache.org/viewvc?rev=1166905&view=rev
Log:
using some of the components added in to common.util package.

Added:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java
      - copied, changed from r1166820, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/WSDLUtil.java
Modified:
    incubator/airavata/trunk/modules/xbaya-gui/pom.xml
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponent.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponentFactory.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WorkflowComponent.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/gui/ODEScriptFiler.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/DSCUtil.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/GPELClient.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/script/WorkflowWSDL.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/ws/gui/WSNodeWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADWorkflowInvoker.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/gui/MonitorEventHandler.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvoker.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvokerWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEWSDLTransformer.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/streaming/StreamTransformer.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/LEADWorkflowInvokerTestCase.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/WSDLUtil.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XMLUtil.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/pom.xml?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/pom.xml (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/pom.xml Thu Sep  8 21:08:38 2011
@@ -79,25 +79,9 @@
 		</profile>
 	</profiles>
 	
-	<properties>
-		<axis2.version>1.5.1</axis2.version>
-        	<airavata.version>0.0.1-SNAPSHOT</airavata.version>
-	</properties>
 
-	<!--
-		The rest of the documents is for developers and are not user
-		configurations.
-	-->
-	<repositories>
-		<repository>
-			<name>ogce.m2.all</name>
-			<id>ogce.m2.all</id>
-			<url>http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all</url>
-			<snapshots>
-				<updatePolicy>daily</updatePolicy>
-			</snapshots>
-		</repository>
-	</repositories>
+
+
 	<build>
 		<plugins>
 			<plugin>
@@ -308,7 +292,6 @@
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
-			<version>4.7</version>
 		</dependency>
 		<dependency>
 			<groupId>xsul</groupId>
@@ -407,6 +390,11 @@
             <artifactId>airavata-workflowtracking</artifactId>
             <version>${airavata.version}</version>
         </dependency>
+        <dependency>
+            <groupId>airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${airavata.version}</version>
+        </dependency>
         
         <!-- JCR Support -->
         <!-- TODO need clean up -->

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentRegistry.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentRegistry.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentRegistry.java Thu Sep  8 21:08:38 2011
@@ -24,11 +24,11 @@ package org.apache.airavata.xbaya.compon
 import java.net.URI;
 import java.util.List;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.component.gui.ComponentTreeNode;
 import org.apache.airavata.xbaya.component.ws.WSComponent;
 import org.apache.airavata.xbaya.component.ws.WSComponentFactory;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 
 import xsul.wsdl.WsdlDefinitions;
 import xsul.wsdl.WsdlResolver;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentRegistry.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentRegistry.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentRegistry.java Thu Sep  8 21:08:38 2011
@@ -27,13 +27,13 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.component.Component;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.component.SubWorkflowComponent;
 import org.apache.airavata.xbaya.component.gui.ComponentTreeNode;
 import org.apache.airavata.xbaya.component.ws.WSComponent;
 import org.apache.airavata.xbaya.component.ws.WSComponentFactory;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 
 import xsul.wsdl.WsdlDefinitions;
 import xsul.wsdl.WsdlException;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponent.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponent.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponent.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponent.java Thu Sep  8 21:08:38 2011
@@ -27,6 +27,8 @@ import java.util.List;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.component.Component;
 import org.apache.airavata.xbaya.component.ComponentControlPort;
 import org.apache.airavata.xbaya.component.ComponentException;
@@ -35,7 +37,6 @@ import org.apache.airavata.xbaya.graph.G
 import org.apache.airavata.xbaya.graph.Node;
 import org.apache.airavata.xbaya.graph.ws.WSNode;
 import org.apache.airavata.xbaya.util.WSConstants;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.xmlpull.infoset.XmlCharacters;
 import org.xmlpull.infoset.XmlElement;
@@ -114,20 +115,24 @@ public class WSComponent extends Compone
         this.inputs = new ArrayList<WSComponentPort>();
         this.outputs = new ArrayList<WSComponentPort>();
 
-        this.wsdl = wsdl;
-        if (portTypeQName == null) {
-            portTypeQName = WSDLUtil.getFirstPortTypeQName(wsdl);
-        }
-        this.portTypeQName = portTypeQName;
-        if (operationName == null) {
-            operationName = WSDLUtil.getFirstOperationName(wsdl, this.portTypeQName);
-        }
-        this.operationName = operationName;
-        this.description = ""; // To prevent to show null
+        try {
+            this.wsdl = wsdl;
+            if (portTypeQName == null) {
+                portTypeQName = WSDLUtil.getFirstPortTypeQName(wsdl);
+            }
+            this.portTypeQName = portTypeQName;
+            if (operationName == null) {
+                operationName = WSDLUtil.getFirstOperationName(wsdl, this.portTypeQName);
+            }
+            this.operationName = operationName;
+            this.description = ""; // To prevent to show null
 
-        setName(this.portTypeQName.getLocalPart() + ":" + this.operationName);
+            setName(this.portTypeQName.getLocalPart() + ":" + this.operationName);
 
-        parse();
+            parse();
+        } catch (UtilsException e) {
+            e.printStackTrace();
+        }
 
         this.controlInPort = new ComponentControlPort();
         this.controlOutPorts.add(new ComponentControlPort());
@@ -449,7 +454,12 @@ public class WSComponent extends Compone
                 // Check if the type is defined in types
                 QName paramType = componentPort.getType();
                 if (!(WSConstants.XSD_NS_URI.equalsIgnoreCase(paramType.getNamespaceURI()))) {
-                    XmlElement typeDefinition = WSDLUtil.getTypeDefinition(this.wsdl, paramType);
+                    XmlElement typeDefinition = null;
+                    try {
+                        typeDefinition = WSDLUtil.getTypeDefinition(this.wsdl, paramType);
+                    } catch (UtilsException e) {
+                        e.printStackTrace();
+                    }
                     if (typeDefinition == null) {
                         throw new ComponentException("could not find definition for type " + paramType + " in "
                                 + this.wsdlQName);

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponentFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponentFactory.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponentFactory.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WSComponentFactory.java Thu Sep  8 21:08:38 2011
@@ -26,9 +26,10 @@ import java.util.List;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.gui.ErrorMessages;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.xmlpull.infoset.XmlElement;
 
@@ -72,6 +73,7 @@ public class WSComponentFactory {
      * @throws ComponentException
      */
     public static List<WSComponent> createComponents(WsdlDefinitions wsdl) throws ComponentException {
+        try{
         QName portTypeQName = WSDLUtil.getFirstPortTypeQName(wsdl);
         WsdlPortType portType = wsdl.getPortType(portTypeQName.getLocalPart());
         List<WSComponent> components = new ArrayList<WSComponent>();
@@ -79,8 +81,12 @@ public class WSComponentFactory {
             String operationName = operation.getOperationName();
             WSComponent component = createComponent(wsdl, portTypeQName, operationName);
             components.add(component);
+            return components;
         }
-        return components;
+        }catch (Exception e){
+            throw new ComponentException(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
+        }
+        return null;
     }
 
     /**
@@ -135,6 +141,8 @@ public class WSComponentFactory {
             return component;
         } catch (RuntimeException e) {
             throw new ComponentException(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
+        } catch (UtilsException e) {
+            throw new ComponentException(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
         }
     }
 }
\ No newline at end of file

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WorkflowComponent.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WorkflowComponent.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WorkflowComponent.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/ws/WorkflowComponent.java Thu Sep  8 21:08:38 2011
@@ -26,11 +26,12 @@ import java.net.URISyntaxException;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.graph.Graph;
 import org.apache.airavata.xbaya.graph.GraphException;
 import org.apache.airavata.xbaya.graph.ws.WorkflowNode;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.apache.airavata.xbaya.workflow.WorkflowClient;
 import org.apache.airavata.xbaya.workflow.WorkflowEngineException;
@@ -166,6 +167,8 @@ public class WorkflowComponent extends W
             }
         } catch (URISyntaxException e) {
             throw new ComponentException(e);
+        } catch (UtilsException e) {
+            throw new ComponentException(e);
         }
     }
 }
\ No newline at end of file

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/gui/ODEScriptFiler.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/gui/ODEScriptFiler.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/gui/ODEScriptFiler.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/gui/ODEScriptFiler.java Thu Sep  8 21:08:38 2011
@@ -31,6 +31,7 @@ import javax.swing.JFileChooser;
 import javax.swing.filechooser.FileFilter;
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.component.ComponentException;
@@ -38,7 +39,6 @@ import org.apache.airavata.xbaya.file.XB
 import org.apache.airavata.xbaya.graph.GraphException;
 import org.apache.airavata.xbaya.gui.ErrorMessages;
 import org.apache.airavata.xbaya.ode.gui.ODEDeploymentWindow;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.gpel.model.GpelProcess;
 import org.xmlpull.infoset.XmlElement;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/DSCUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/DSCUtil.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/DSCUtil.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/DSCUtil.java Thu Sep  8 21:08:38 2011
@@ -32,12 +32,13 @@ import java.util.Map;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
 import org.apache.airavata.xbaya.gpel.script.BPELScript;
 import org.apache.airavata.xbaya.graph.Graph;
 import org.apache.airavata.xbaya.graph.util.GraphUtil;
 import org.apache.airavata.xbaya.graph.ws.WSNode;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 
 import xsul5.wsdl.WsdlDefinitions;
@@ -82,7 +83,11 @@ public class DSCUtil {
             String partnerLinkName = BPELScript.createPartnerLinkName(node.getID());
             WsdlDefinitions wsdl = node.getComponent().getWSDL();
             if (WSDLUtil.isAWSDL(wsdl)) {
-                wsdl = convertToCWSDL(WSDLUtil.deepClone(wsdl), dscURL);
+                try {
+                    wsdl = convertToCWSDL(WSDLUtil.deepClone(wsdl), dscURL);
+                } catch (UtilsException e) {
+                    e.printStackTrace();
+                }
             }
             WSDLMap.put(partnerLinkName, wsdl);
         }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/GPELClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/GPELClient.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/GPELClient.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/GPELClient.java Thu Sep  8 21:08:38 2011
@@ -33,6 +33,8 @@ import java.util.Map;
 
 import javax.imageio.ImageIO;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
@@ -49,7 +51,6 @@ import org.apache.airavata.xbaya.graph.w
 import org.apache.airavata.xbaya.gui.ErrorMessages;
 import org.apache.airavata.xbaya.security.UserX509Credential;
 import org.apache.airavata.xbaya.security.XBayaSecurity;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.apache.airavata.xbaya.workflow.WorkflowClient;
 import org.apache.airavata.xbaya.workflow.WorkflowEngineException;
@@ -514,7 +515,7 @@ public class GPELClient extends Workflow
                 instance.store();
             }
             return instance;
-        } catch (RuntimeException e) {
+        } catch (UtilsException e) {
             String message = "Error while creating a workflow instance. template ID: " + templateID + ", instanceID: "
                     + instanceID;
             throw new WorkflowEngineException(message, e);

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/script/WorkflowWSDL.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/script/WorkflowWSDL.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/script/WorkflowWSDL.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gpel/script/WorkflowWSDL.java Thu Sep  8 21:08:38 2011
@@ -27,6 +27,8 @@ import java.util.Map;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
 import org.apache.airavata.xbaya.XBayaVersion;
@@ -42,7 +44,6 @@ import org.apache.airavata.xbaya.graph.s
 import org.apache.airavata.xbaya.graph.util.GraphUtil;
 import org.apache.airavata.xbaya.graph.ws.WSGraph;
 import org.apache.airavata.xbaya.util.WSConstants;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.xmlpull.infoset.XmlComment;
@@ -462,7 +463,9 @@ public class WorkflowWSDL {
         }
 
         // check if this type already exists in the workflow WSDL.
-        XmlElement typeDefinition = WSDLUtil.getTypeDefinition(this.definitions, paramType);
+        XmlElement typeDefinition = null;
+        try {
+            typeDefinition = WSDLUtil.getTypeDefinition(this.definitions, paramType);
 
         if (typeDefinition == null) {
 
@@ -496,6 +499,10 @@ public class WorkflowWSDL {
             XmlNamespace namespace = this.definitions.xml().lookupNamespaceByName(paramType.getNamespaceURI());
             return new QName(paramType.getNamespaceURI(), paramType.getLocalPart(), namespace.getPrefix());
         }
+        } catch (UtilsException e) {
+            e.printStackTrace();
+        }
+        return null;
     }
 
     private void addImportIfNecessary(XmlElement importEle) {

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/ws/gui/WSNodeWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/ws/gui/WSNodeWindow.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/ws/gui/WSNodeWindow.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/ws/gui/WSNodeWindow.java Thu Sep  8 21:08:38 2011
@@ -27,6 +27,7 @@ import javax.swing.AbstractAction;
 import javax.swing.JButton;
 import javax.swing.JPanel;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.graph.ws.WSNode;
 import org.apache.airavata.xbaya.gui.GridPanel;
@@ -34,7 +35,7 @@ import org.apache.airavata.xbaya.gui.XBa
 import org.apache.airavata.xbaya.gui.XBayaLabel;
 import org.apache.airavata.xbaya.gui.XBayaTextArea;
 import org.apache.airavata.xbaya.gui.XBayaTextField;
-import org.apache.airavata.xbaya.util.WSDLUtil;
+import org.apache.airavata.xbaya.util.XBayaUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 
 import xsul5.wsdl.WsdlDefinitions;
@@ -69,10 +70,7 @@ public class WSNodeWindow {
     }
 
     /**
-     * Shows the notification.
-     * 
-     * @param event
-     *            The notification to show
+     *
      */
     public void show() {
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java Thu Sep  8 21:08:38 2011
@@ -99,7 +99,8 @@ import org.apache.airavata.xbaya.ode.ODE
 import org.apache.airavata.xbaya.security.SecurityUtil;
 import org.apache.airavata.xbaya.security.XBayaSecurity;
 import org.apache.airavata.xbaya.util.AmazonUtil;
-import org.apache.airavata.xbaya.util.WSDLUtil;
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.xbaya.util.XBayaUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.ietf.jgss.GSSCredential;
 import org.xmlpull.infoset.XmlElement;
@@ -555,11 +556,11 @@ public class WorkflowInterpreter {
                     LeadContextHeader leadCtxHeader = null;
                     try {
                         if (this.mode == GUI_MODE) {
-                            leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
+                            leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.workflow, this.configuration,
                                     new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true,
                                             this.configuration.getMessageBoxURL()), wsNode.getID(), null);
                         } else {
-                            leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
+                            leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.workflow, this.configuration,
                                     new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true,
                                             this.configuration.getMessageBoxURL()), wsNode.getID(), null);
                         }
@@ -931,11 +932,11 @@ public class WorkflowInterpreter {
                     LeadContextHeader leadCtxHeader = null;
                     try {
                         if (this.mode == GUI_MODE) {
-                            leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
+                            leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.workflow, this.configuration,
                                     new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true,
                                             this.configuration.getMessageBoxURL()), foreachWSNode.getID(), null);
                         } else {
-                            leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
+                            leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.workflow, this.configuration,
                                     new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true,
                                             this.configuration.getMessageBoxURL()), foreachWSNode.getID(), null);
                         }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java Thu Sep  8 21:08:38 2011
@@ -23,12 +23,12 @@ package org.apache.airavata.xbaya.invoke
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.invoker.AsynchronousInvoker;
 import org.apache.airavata.xbaya.invoker.GFacInvoker;
 import org.apache.airavata.xbaya.invoker.Invoker;
 import org.apache.airavata.xbaya.invoker.SimpleInvoker;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 
 import xsul.lead.LeadContextHeader;
 import xsul.wsdl.WsdlDefinitions;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADWorkflowInvoker.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADWorkflowInvoker.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADWorkflowInvoker.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADWorkflowInvoker.java Thu Sep  8 21:08:38 2011
@@ -27,12 +27,12 @@ import java.util.regex.Pattern;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.component.ws.WSComponent;
 import org.apache.airavata.xbaya.component.ws.WSComponentFactory;
 import org.apache.airavata.xbaya.component.ws.WSComponentPort;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.xmlpull.v1.builder.XmlElement;
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java Thu Sep  8 21:08:38 2011
@@ -23,11 +23,11 @@ package org.apache.airavata.xbaya.lead;
 
 import java.net.URI;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
 import org.apache.airavata.xbaya.XBayaConfiguration;
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 
 import org.apache.axis2.addressing.EndpointReference;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java Thu Sep  8 21:08:38 2011
@@ -29,6 +29,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.component.system.InputComponent;
@@ -48,7 +50,6 @@ import org.apache.airavata.xbaya.monitor
 import org.apache.airavata.xbaya.monitor.MonitorUtil;
 import org.apache.airavata.xbaya.monitor.MonitorUtil.EventType;
 import org.apache.airavata.xbaya.monitor.gui.MonitorEventHandler.NodeState;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.xmlpull.infoset.XmlElement;
 
@@ -212,7 +213,7 @@ public class WorkflowModifier {
             WsdlPortTypeOperation wsdlPortTypeOperation;
             try {
                 wsdlPortTypeOperation = WSDLUtil.getFirstOperation(this.modifiedWorkflow.getWorkflowWSDL());
-            } catch (ComponentException e) {
+            } catch (UtilsException e) {
                 throw new MonitorException(e);
             }
             XmlElement part = soapBody.element(wsdlPortTypeOperation.getName());

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/gui/MonitorEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/gui/MonitorEventHandler.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/gui/MonitorEventHandler.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/gui/MonitorEventHandler.java Thu Sep  8 21:08:38 2011
@@ -34,6 +34,7 @@ import java.util.Map;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.graph.ControlPort;
@@ -55,7 +56,6 @@ import org.apache.airavata.xbaya.monitor
 import org.apache.airavata.xbaya.monitor.MonitorEventData;
 import org.apache.airavata.xbaya.monitor.MonitorUtil;
 import org.apache.airavata.xbaya.monitor.MonitorUtil.EventType;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.apache.airavata.xbaya.workflow.WorkflowClient;
 import org.apache.airavata.xbaya.workflow.WorkflowClient.WorkflowType;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvoker.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvoker.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvoker.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvoker.java Thu Sep  8 21:08:38 2011
@@ -38,7 +38,7 @@ import org.apache.airavata.xbaya.monitor
 import org.apache.airavata.xbaya.myproxy.MyProxyClient;
 import org.apache.airavata.xbaya.security.XBayaSecurity;
 import org.apache.airavata.xbaya.util.StringUtil;
-import org.apache.airavata.xbaya.util.WSDLUtil;
+import org.apache.airavata.xbaya.util.XBayaUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 
 import xsul.XmlConstants;
@@ -114,7 +114,7 @@ public class ODEInvoker implements Cance
 
             WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(configuration.getDSCURL(), configuration.getODEURL());
 
-            LeadContextHeader leadContext = WSDLUtil.buildLeadContextHeader(this.engine, monitorConfiguration,
+            LeadContextHeader leadContext = XBayaUtil.buildLeadContextHeader(this.engine, monitorConfiguration,
                     StringUtil.convertToJavaIdentifier(engine.getWorkflow().getName()), resourceMapping);
             // /////////////////////////////////////
             leadContext.setExperimentId(monitorConfiguration.getTopic());

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvokerWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvokerWindow.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvokerWindow.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEInvokerWindow.java Thu Sep  8 21:08:38 2011
@@ -45,7 +45,6 @@ import org.apache.airavata.xbaya.compone
 import org.apache.airavata.xbaya.gpel.script.BPELScript;
 import org.apache.airavata.xbaya.gpel.script.BPELScriptType;
 import org.apache.airavata.xbaya.graph.GraphException;
-import org.apache.airavata.xbaya.graph.gui.GraphCanvas;
 import org.apache.airavata.xbaya.gui.ErrorMessages;
 import org.apache.airavata.xbaya.gui.GridPanel;
 import org.apache.airavata.xbaya.gui.XBayaDialog;
@@ -60,7 +59,6 @@ import org.apache.airavata.xbaya.myproxy
 import org.apache.airavata.xbaya.security.UserX509Credential;
 import org.apache.airavata.xbaya.security.XBayaSecurity;
 import org.apache.airavata.xbaya.util.StringUtil;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.apache.airavata.xbaya.workflow.WorkflowClient;
@@ -69,17 +67,7 @@ import org.ietf.jgss.GSSCredential;
 import org.xmlpull.infoset.XmlElement;
 
 import xsul.lead.LeadResourceMapping;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.wsif.WSIFService;
-import xsul.wsif.WSIFServiceFactory;
 import xsul.wsif.spi.WSIFProviderManager;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul5.wsdl.WsdlDefinitions;
-import xsul5.wsdl.WsdlException;
-import xsul5.wsdl.WsdlResolver;
 
 public class ODEInvokerWindow {
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEWSDLTransformer.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEWSDLTransformer.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEWSDLTransformer.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEWSDLTransformer.java Thu Sep  8 21:08:38 2011
@@ -30,11 +30,11 @@ import java.util.Set;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
 import org.apache.airavata.xbaya.gpel.DSCUtil;
 import org.apache.airavata.xbaya.util.StringUtil;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.xmlpull.infoset.XmlBuilderException;
 import org.xmlpull.infoset.XmlInfosetBuilder;
 import org.xmlpull.infoset.XmlNamespace;
@@ -338,8 +338,8 @@ public class ODEWSDLTransformer {
     }
 
     /**
-     * @param types
-     * @param schemaNs
+     *
+     * @param wsdl
      */
     private void addCrosscutImportsIfNecessary(WsdlDefinitions wsdl) {
         org.xmlpull.infoset.XmlElement types = wsdl.getTypes();
@@ -354,7 +354,7 @@ public class ODEWSDLTransformer {
                 for (org.xmlpull.infoset.XmlElement importElement : imports) {
                     found = found
                             || WSDLUtil.attributeExist(importElement, "namespace",
-                                    "http://lead.extreme.indiana.edu/namespaces/2006/lead-crosscut-parameters/");
+                            "http://lead.extreme.indiana.edu/namespaces/2006/lead-crosscut-parameters/");
                 }
                 if (!found) {
                     org.xmlpull.infoset.XmlElement crosscutImport = BUILDER.newFragment(schemaNs, "import");
@@ -372,7 +372,7 @@ public class ODEWSDLTransformer {
                 for (org.xmlpull.infoset.XmlElement importElement : imports) {
                     found = found
                             || WSDLUtil.attributeExist(importElement, "namespace",
-                                    "http://www.extreme.indiana.edu/lead/xsd");
+                            "http://www.extreme.indiana.edu/lead/xsd");
                 }
                 if (!found) {
                     org.xmlpull.infoset.XmlElement crosscutImport = BUILDER.newFragment(schemaNs, "import");

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/streaming/StreamTransformer.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/streaming/StreamTransformer.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/streaming/StreamTransformer.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/streaming/StreamTransformer.java Thu Sep  8 21:08:38 2011
@@ -26,12 +26,12 @@ import java.util.List;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBaya;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.graph.GraphException;
 import org.apache.airavata.xbaya.graph.Node;
 import org.apache.airavata.xbaya.graph.ws.WSNode;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.gpel.model.GpelProcess;
 import org.gpel.model.GpelVariable;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java Thu Sep  8 21:08:38 2011
@@ -28,6 +28,7 @@ import java.net.URI;
 
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.component.registry.ComponentRegistryException;
@@ -40,7 +41,6 @@ import org.apache.airavata.xbaya.jython.
 import org.apache.airavata.xbaya.jython.script.JythonScript;
 import org.apache.airavata.xbaya.test.util.WorkflowCreator;
 import org.apache.airavata.xbaya.util.IOUtil;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/LEADWorkflowInvokerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/LEADWorkflowInvokerTestCase.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/LEADWorkflowInvokerTestCase.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/LEADWorkflowInvokerTestCase.java Thu Sep  8 21:08:38 2011
@@ -30,6 +30,7 @@ import java.util.List;
 
 import junit.framework.TestSuite;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.component.ws.WSComponentPort;
@@ -39,7 +40,6 @@ import org.apache.airavata.xbaya.lead.LE
 import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
 import org.apache.airavata.xbaya.test.service.adder.Adder;
 import org.apache.airavata.xbaya.test.service.adder.AdderService;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.globus.gsi.CertUtil;
 import org.ietf.jgss.GSSCredential;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java Thu Sep  8 21:08:38 2011
@@ -23,12 +23,12 @@ package org.apache.airavata.xbaya.test;
 
 import java.net.URI;
 
-import org.apache.airavata.xbaya.util.WSDLUtil;
+import org.apache.airavata.common.utils.WSDLUtil;
 
 public class WSDLUtilTestCase extends XBayaTestCase {
 
     /**
-     * Test method for {@link org.apache.airavata.xbaya.util.WSDLUtil#appendWSDLQuary(java.net.URI)}.
+     *
      */
     public void testAppendWSDLQuary() {
         URI uri0 = URI.create("http://localhost:8080");

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java Thu Sep  8 21:08:38 2011
@@ -29,6 +29,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.workflow.tracking.client.Callback;
 import org.apache.airavata.workflow.tracking.client.NotificationType;
 import org.apache.airavata.workflow.tracking.common.InvocationContext;
@@ -62,7 +64,6 @@ import org.apache.airavata.xbaya.monitor
 import org.apache.airavata.xbaya.test.service.adder.Adder;
 import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
 import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.apache.airavata.xbaya.workflow.WorkflowClient;
@@ -184,8 +185,13 @@ public class WorkflowModificationTestCas
         inputMap.put("b", "3");
         inputMap.put("c", "4");
         inputMap.put("d", "5");
-        sendNotification(workflowWSDL, null, WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null,
-                notifier);
+
+        try {
+            sendNotification(workflowWSDL, null, WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null,
+                    notifier);
+        } catch (UtilsException e) {
+            e.printStackTrace();
+        }
 
         WsdlDefinitions adderWSDL = WsdlResolver.getInstance().loadWsdl(
                 new File(XBayaPathConstants.WSDL_DIRECTORY + File.separator + Adder.WSDL_PATH).toURI());
@@ -353,8 +359,12 @@ public class WorkflowModificationTestCas
         }
 
         /**
-         * @see edu.indiana.extreme.lead.workflow_tracking.client.Callback#deliverMessage(java.lang.String,
-         *      edu.indiana.extreme.lead.workflow_tracking.client.NotificationType, org.apache.xmlbeans.XmlObject)
+         *
+         * @param topic
+         *            the topic to which this message was sent. This can also be retrieved from the messageObj XMlObject
+         *            directly after typecasting.
+         * @param type
+         * @param message
          */
         public void deliverMessage(String topic, NotificationType type, XmlObject message) {
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java Thu Sep  8 21:08:38 2011
@@ -25,7 +25,7 @@ import java.net.URI;
 
 import junit.framework.TestSuite;
 
-import org.apache.airavata.xbaya.util.WSDLUtil;
+import org.apache.airavata.common.utils.WSDLUtil;
 
 import xsul.wsdl.WsdlResolver;
 import xsul5.MLogger;

Copied: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java (from r1166820, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/WSDLUtil.java)
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java?p2=incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java&p1=incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/WSDLUtil.java&r1=1166820&r2=1166905&rev=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/WSDLUtil.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java Thu Sep  8 21:08:38 2011
@@ -21,457 +21,23 @@
 
 package org.apache.airavata.xbaya.util;
 
-import java.io.IOException;
-import java.io.StringReader;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
 
 import org.apache.airavata.xbaya.XBayaConfiguration;
 import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.XBayaRuntimeException;
-import org.apache.airavata.xbaya.component.ComponentException;
 import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
 import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
 import org.apache.airavata.xbaya.wf.Workflow;
-import org.xmlpull.infoset.XmlAttribute;
-import org.xmlpull.infoset.XmlBuilderException;
-import org.xmlpull.infoset.XmlElement;
-import org.xmlpull.infoset.XmlNamespace;
 
-import xsul.XmlConstants;
 import xsul.lead.LeadContextHeader;
 import xsul.lead.LeadResourceMapping;
 import xsul5.MLogger;
-import xsul5.wsdl.WsdlBinding;
-import xsul5.wsdl.WsdlDefinitions;
-import xsul5.wsdl.WsdlPortType;
-import xsul5.wsdl.WsdlPortTypeOperation;
-import xsul5.wsdl.WsdlUtil;
 
-public class WSDLUtil {
+public class XBayaUtil {
 
     private static final MLogger logger = MLogger.getLogger();
 
-    /**
-     * @param wsdlString
-     * @return The WSDL
-     * @throws ComponentException
-     */
-    public static WsdlDefinitions stringToWSDL(String wsdlString) throws ComponentException {
-        try {
-            XmlElement wsdlElement = XMLUtil.stringToXmlElement(wsdlString);
-            WsdlDefinitions definitions = new WsdlDefinitions(wsdlElement);
-            return definitions;
-        } catch (RuntimeException e) {
-            throw new ComponentException(e);
-        }
-    }
-
-    /**
-     * @param definitions3
-     * @return The WsdlDefinitions (XSUL5)
-     */
-    public static xsul5.wsdl.WsdlDefinitions wsdlDefinitions3ToWsdlDefintions5(xsul.wsdl.WsdlDefinitions definitions3) {
-
-        return new xsul5.wsdl.WsdlDefinitions(XMLUtil.xmlElement3ToXmlElement5(definitions3));
-    }
-
-    /**
-     * @param definitions5
-     * @return The WsdlDefinitions (XSUL3)
-     */
-    public static xsul.wsdl.WsdlDefinitions wsdlDefinitions5ToWsdlDefintions3(xsul5.wsdl.WsdlDefinitions definitions5) {
-
-        return new xsul.wsdl.WsdlDefinitions(XMLUtil.xmlElement5ToXmlElement3(definitions5.xml()));
-    }
-
-    /**
-     * @param definitions
-     * @return The name of the WSDL.
-     */
-    public static String getWSDLName(WsdlDefinitions definitions) {
-        String wsdlName = definitions.xml().attributeValue(WSConstants.NAME_ATTRIBUTE);
-        if (wsdlName == null) {
-            // name is optional.
-            wsdlName = "";
-        }
-        return wsdlName;
-    }
-
-    /**
-     * @param definitions
-     * @return The QName of the WSDL.
-     */
-    public static QName getWSDLQName(WsdlDefinitions definitions) {
-        String targetNamespace = definitions.getTargetNamespace();
-        String wsdlName = getWSDLName(definitions);
-        return new QName(targetNamespace, wsdlName);
-    }
-
-    /**
-     * @param definitions
-     * @return The first portType
-     * @throws ComponentException
-     */
-    public static WsdlPortType getFirstPortType(WsdlDefinitions definitions) throws ComponentException {
-        for (WsdlPortType portType : definitions.portTypes()) {
-            return portType;
-        }
-        throw new ComponentException("No portType is defined in WSDL");
-    }
-
-    public static WsdlPortTypeOperation getFirstOperation(WsdlDefinitions definitions) throws ComponentException {
-        for (WsdlPortTypeOperation operation : getFirstPortType(definitions).operations()) {
-            return operation;
-        }
-        throw new ComponentException("No portType is defined in WSDL");
-    }
-
-    /**
-     * @param definitions
-     * @return The QName of the first portType.
-     * @throws ComponentException
-     */
-    public static QName getFirstPortTypeQName(WsdlDefinitions definitions) throws ComponentException {
-        String targetNamespace = definitions.getTargetNamespace();
-        for (WsdlPortType portType : definitions.portTypes()) {
-            String portTypeName = portType.getName();
-            QName portTypeQName = new QName(targetNamespace, portTypeName);
-            return portTypeQName;
-        }
-        throw new ComponentException("No portType is defined.");
-    }
-
-    /**
-     * @param definitions
-     * @param portTypeQName
-     * @return The name of the first operation in a given portType.
-     * @throws ComponentException
-     */
-    public static String getFirstOperationName(WsdlDefinitions definitions, QName portTypeQName)
-            throws ComponentException {
-        WsdlPortType portType = definitions.getPortType(portTypeQName.getLocalPart());
-        for (WsdlPortTypeOperation operation : portType.operations()) {
-            String operationName = operation.getOperationName();
-
-            // XXX Temporary solution to skip some GFac specific operations.
-            if ("Shutdown".equals(operationName)) {
-                continue;
-            } else if ("Kill".equals(operationName)) {
-                continue;
-            } else if ("Ping".equals(operationName)) {
-                continue;
-            }
-
-            return operationName;
-        }
-        throw new ComponentException("No operation is defined");
-    }
-
-    /**
-     * @param definitions
-     * @return The cloned WsdlDefinitions
-     */
-    public static WsdlDefinitions deepClone(WsdlDefinitions definitions) {
-        return new WsdlDefinitions(XMLUtil.deepClone(definitions.xml()));
-    }
-
-    /**
-     * @param definitions
-     * @param paramType
-     * @return The schema that includes the type definition
-     */
-    public static XmlElement getSchema(WsdlDefinitions definitions, QName paramType) {
-        XmlElement types = definitions.getTypes();
-
-        Iterable<XmlElement> schemas = types.elements(WSConstants.XSD_NS, WSConstants.SCHEMA_TAG);
-        for (XmlElement schema : schemas) {
-            if (isTypeDefinedInSchema(paramType, schema)) {
-                return schema;
-            }
-        }
-
-        // ok we didnt find the type in the schema in first level
-        // now we try try to see if it exist in schema imports.
-        // we loop in two step because its better to avoid the network
-        // connection if possible
-        for (XmlElement schema : schemas) {
-            Iterable<XmlElement> imports = schema.elements(WSConstants.XSD_NS, WSConstants.IMPORT_TAG);
-            for (XmlElement importEle : imports) {
-                String schemaLocation = importEle.attributeValue(WSConstants.SCHEMA_LOCATION_ATTRIBUTE);
-                if (null != schemaLocation && !"".equals(schemaLocation)) {
-                    try {
-                        // connect using a url connection
-                        URL url = new URL(schemaLocation);
-                        URLConnection connection = url.openConnection();
-                        connection.connect();
-                        XmlElement importedSchema = xsul5.XmlConstants.BUILDER.parseFragmentFromInputStream(connection
-                                .getInputStream());
-                        if (isTypeDefinedInSchema(paramType, importedSchema)) {
-                            // still return the parent schema
-                            return schema;
-                        }
-                    } catch (MalformedURLException e) {
-                        throw new XBayaRuntimeException(e);
-                    } catch (XmlBuilderException e) {
-                        throw new XBayaRuntimeException(e);
-                    } catch (IOException e) {
-                        throw new XBayaRuntimeException(e);
-                    }
-                }
-            }
-        }
-
-        return null;
-    }
-
-    private static boolean isTypeDefinedInSchema(QName paramType, XmlElement schema) {
-        String schemaTargetNamespace = schema.attributeValue(WSConstants.TARGET_NAMESPACE_ATTRIBUTE);
-        if (schemaTargetNamespace.equals(paramType.getNamespaceURI())) {
-            for (XmlElement complexType : schema.elements(WSConstants.XSD_NS, WSConstants.COMPLEX_TYPE_TAG)) {
-                String complexTypeName = complexType.attributeValue(WSConstants.NAME_ATTRIBUTE);
-                if (complexTypeName.equals(paramType.getLocalPart())) {
-                    return true;
-                }
-            }
-            for (XmlElement simpleType : schema.elements(WSConstants.XSD_NS, WSConstants.SIMPLE_TYPE_TAG)) {
-                String simpleTypeName = simpleType.attributeValue(WSConstants.NAME_ATTRIBUTE);
-                if (simpleTypeName.equals(paramType.getLocalPart())) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * @param definitions
-     * @param paramType
-     * @return The type definition
-     */
-    public static XmlElement getTypeDefinition(WsdlDefinitions definitions, QName paramType) {
-        XmlElement types = definitions.getTypes();
-        XmlElement returnType = null;
-        types.element(null, WSConstants.SCHEMA_TAG);
-        Iterable<XmlElement> schemas = types.elements(null, WSConstants.SCHEMA_TAG);
-        for (XmlElement schema : schemas) {
-
-            returnType = findTypeInSchema(paramType, schema);
-            if (returnType != null) {
-                return returnType;
-            }
-        }
-        // ok we didnt find the type in the schemas
-        // try to find it in the schema imports.
-
-        // if not found it will return null so we would return null
-        return findTypeDefinitionInImports(definitions, paramType);
-
-    }
-
-    /**
-     * @param serviceWSDL
-     * @param paramType
-     * @return
-     */
-    public static XmlElement getImportContainingTypeDefinition(WsdlDefinitions definitions, QName paramType) {
-        XmlElement types = definitions.getTypes();
-        XmlElement returnType = null;
-        Iterable<XmlElement> schemas = types.elements(WSConstants.XSD_NS, WSConstants.SCHEMA_TAG);
-        for (XmlElement schema : schemas) {
-            Iterable<XmlElement> imports = schema.elements(WSConstants.XSD_NS, WSConstants.IMPORT_TAG);
-            for (XmlElement importEle : imports) {
-                String schemaLocation = importEle.attributeValue(WSConstants.SCHEMA_LOCATION_ATTRIBUTE);
-                if (null != schemaLocation && !"".equals(schemaLocation)) {
-                    try {
-                        // connect using a url connection
-                        URL url = new URL(schemaLocation);
-                        URLConnection connection = url.openConnection();
-                        connection.connect();
-                        XmlElement importedSchema = xsul5.XmlConstants.BUILDER.parseFragmentFromInputStream(connection
-                                .getInputStream());
-                        returnType = findTypeInSchema(paramType, importedSchema);
-                        if (returnType != null) {
-                            return importEle;
-                        }
-
-                    } catch (MalformedURLException e) {
-                        throw new XBayaRuntimeException(e);
-                    } catch (XmlBuilderException e) {
-                        throw new XBayaRuntimeException(e);
-                    } catch (IOException e) {
-                        throw new XBayaRuntimeException(e);
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * @param serviceWSDL
-     * @param paramType
-     */
-    public static XmlElement findTypeDefinitionInImports(WsdlDefinitions definitions, QName paramType) {
-        XmlElement types = definitions.getTypes();
-        XmlElement returnType = null;
-        Iterable<XmlElement> schemas = types.elements(null, WSConstants.SCHEMA_TAG);
-        for (XmlElement schema : schemas) {
-            Iterable<XmlElement> imports = schema.elements(WSConstants.XSD_NS, WSConstants.IMPORT_TAG);
-            for (XmlElement importEle : imports) {
-                String schemaLocation = importEle.attributeValue(WSConstants.SCHEMA_LOCATION_ATTRIBUTE);
-                if (null != schemaLocation && !"".equals(schemaLocation)) {
-                    try {
-                        // connect using a url connection
-                        URL url = new URL(schemaLocation);
-                        URLConnection connection = url.openConnection();
-                        connection.connect();
-                        XmlElement importedSchema = xsul5.XmlConstants.BUILDER.parseFragmentFromInputStream(connection
-                                .getInputStream());
-                        returnType = findTypeInSchema(paramType, importedSchema);
-                        if (returnType != null) {
-                            return returnType;
-                        }
-
-                    } catch (MalformedURLException e) {
-                        throw new XBayaRuntimeException(e);
-                    } catch (XmlBuilderException e) {
-                        throw new XBayaRuntimeException(e);
-                    } catch (IOException e) {
-                        throw new XBayaRuntimeException(e);
-                    }
-                }
-            }
-        }
-        return null;
-
-    }
-
-    private static XmlElement findTypeInSchema(QName paramType, XmlElement schema) {
-        String schemaTargetNamespace = schema.attributeValue(WSConstants.TARGET_NAMESPACE_ATTRIBUTE);
-        if (null != schemaTargetNamespace && schemaTargetNamespace.equals(paramType.getNamespaceURI())) {
-            for (XmlElement complexType : schema.elements(WSConstants.XSD_NS, WSConstants.COMPLEX_TYPE_TAG)) {
-                String complexTypeName = complexType.attributeValue(WSConstants.NAME_ATTRIBUTE);
-                if (complexTypeName.equals(paramType.getLocalPart())) {
-                    return complexType;
-
-                }
-            }
-            for (XmlElement simpleType : schema.elements(WSConstants.XSD_NS, WSConstants.SIMPLE_TYPE_TAG)) {
-                String simpleTypeName = simpleType.attributeValue(WSConstants.NAME_ATTRIBUTE);
-                if (simpleTypeName.equals(paramType.getLocalPart())) {
-                    return simpleType;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * @param wsdl
-     * @return true if the WSDL is AWSDL; false otherwise.
-     */
-    public static boolean isAWSDL(WsdlDefinitions wsdl) {
-        if (wsdl.services().iterator().hasNext()) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @param definitions
-     * @return true if the service supports asynchronous invocation; false otherwise;
-     */
-    public static boolean isAsynchronousSupported(WsdlDefinitions definitions) {
-        for (WsdlBinding binding : definitions.bindings()) {
-            XmlElement element = binding.xml().element(WSConstants.USING_ADDRESSING_TAG);
-            if (element != null) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Converts a specified AWSDL to CWSDL using DSC URI.
-     * 
-     * @param definitions
-     *            The specified AWSDL. This will be modified.
-     * @param url
-     *            The URL of the service
-     * @return The CWSDL converted.
-     */
-    public static WsdlDefinitions convertToCWSDL(WsdlDefinitions definitions, URI url) {
-        for (WsdlPortType portType : definitions.portTypes()) {
-            WsdlUtil.createCWSDL(definitions, portType, url);
-        }
-        return definitions;
-    }
-
-    /**
-     * @param uri
-     * @return The URI with "?wsdl" at the end.
-     */
-    public static String appendWSDLQuary(String uri) {
-        URI wsdlURI = appendWSDLQuary(URI.create(uri));
-        return wsdlURI.toString();
-    }
-
-    public static List<XmlNamespace> getNamespaces(XmlElement element) {
-        LinkedList<XmlNamespace> namespaces = new LinkedList<XmlNamespace>();
-        namespaces.add(element.getNamespace());
-        Iterable<XmlAttribute> attributes = element.attributes();
-        for (XmlAttribute xmlAttribute : attributes) {
-            if (xmlAttribute.getNamespace() != null && !namespaces.contains(xmlAttribute.getNamespace())) {
-                namespaces.add(xmlAttribute.getNamespace());
-            }
-            int index = xmlAttribute.getValue().indexOf(':');
-            if (-1 != index) {
-                String prefix = xmlAttribute.getValue().substring(0, index);
-                if (element.lookupNamespaceByPrefix(prefix) != null) {
-                    namespaces.add(element.lookupNamespaceByPrefix(prefix));
-                }
-            }
-        }
-        Iterable children = element.children();
-        for (Object object : children) {
-            if (object instanceof XmlElement) {
-                List<XmlNamespace> newNSs = getNamespaces((XmlElement) object);
-                for (XmlNamespace xmlNamespace : newNSs) {
-                    if (!namespaces.contains(xmlNamespace)) {
-                        namespaces.add(xmlNamespace);
-                    }
-                }
-            }
-        }
-        return namespaces;
-    }
-
-    /**
-     * @param uri
-     * @return The URI with "?wsdl" at the end.
-     */
-    public static URI appendWSDLQuary(URI uri) {
-        if (uri.toString().endsWith("?wsdl")) {
-            logger.warning("URL already has ?wsdl at the end: " + uri.toString());
-            // Don't throw exception to be more error tolerant.
-            return uri;
-        }
-        String path = uri.getPath();
-        if (path == null || path.length() == 0) {
-            uri = uri.resolve("/");
-        }
-        uri = URI.create(uri.toString() + "?wsdl");
-        return uri;
-    }
-
     public static LeadContextHeader buildLeadContextHeader(final XBayaEngine engine,
             MonitorConfiguration monitorConfiguration, String nodeId, LeadResourceMapping resourceMapping)
             throws URISyntaxException {
@@ -487,12 +53,12 @@ public class WSDLUtil {
     }
 
     /**
-     * @param engine
+     *
+     * @param workflow
+     * @param configuration
      * @param monitorConfiguration
      * @param nodeId
      * @param resourceMapping
-     * @param configuration
-     * @param workflow
      * @return
      * @throws URISyntaxException
      */
@@ -520,80 +86,5 @@ public class WSDLUtil {
         return leadContext;
     }
 
-    /**
-     * @param valueElement
-     * @return
-     */
-    public static org.xmlpull.v1.builder.XmlElement xmlElement5ToXmlElementv1(XmlElement valueElement) {
-
-        return XmlConstants.BUILDER.parseFragmentFromReader(new StringReader(xsul5.XmlConstants.BUILDER
-                .serializeToStringPretty(valueElement)));
-    }
-
-    /**
-     * @param values
-     */
-    public static <T extends Object> T getfirst(Iterable<T> vals) {
-        for (T class1 : vals) {
-            return class1;
-        }
-        throw new RuntimeException("Iterator empty");
-
-    }
-
-    /**
-     * @param serviceSchema
-     */
-    public static void print(XmlElement serviceSchema) {
-        System.out.println(xsul5.XmlConstants.BUILDER.serializeToStringPretty(serviceSchema));
-    }
-
-    /**
-     * @param workflowID
-     * @return
-     */
-    public static String findWorkflowName(URI workflowID) {
-        String[] splits = workflowID.toString().split("/");
-        return splits[splits.length - 1];
-
-    }
-
-    /**
-     * 
-     * @param element
-     * @param name
-     * @param oldValue
-     * @param newValue
-     */
-    public static void replaceAttributeValue(XmlElement element, String name, String oldValue, String newValue) {
-        XmlAttribute attribute = element.attribute(name);
-        if (null != attribute && oldValue.equals(attribute.getValue())) {
-            element.removeAttribute(attribute);
-            element.setAttributeValue(name, newValue);
-        }
-        Iterable iterator = element.children();
-        for (Object object : iterator) {
-            if (object instanceof XmlElement) {
-                replaceAttributeValue((XmlElement) object, name, oldValue, newValue);
-            }
-        }
-
-    }
-
-    public static boolean attributeExist(XmlElement element, String name, String value) {
-        XmlAttribute attribute = element.attribute(name);
-        if (null != attribute && value.equals(attribute.getValue())) {
-            return true;
-        }
-        Iterable iterator = element.children();
-        boolean ret = false;
-        for (Object object : iterator) {
-            if (object instanceof XmlElement) {
-                ret = ret || attributeExist((XmlElement) object, name, value);
-            }
-        }
-        return ret;
-
-    }
 
 }
\ No newline at end of file

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XMLUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XMLUtil.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XMLUtil.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XMLUtil.java Thu Sep  8 21:08:38 2011
@@ -36,6 +36,7 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.airavata.common.utils.WSDLUtil;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
 import org.apache.xmlbeans.XmlError;
 import org.apache.xmlbeans.XmlObject;

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java?rev=1166905&r1=1166904&r2=1166905&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java Thu Sep  8 21:08:38 2011
@@ -39,6 +39,7 @@ import java.util.Set;
 import javax.imageio.ImageIO;
 import javax.xml.namespace.QName;
 
+import org.apache.airavata.common.exception.UtilsException;
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.XBayaExecutionState;
@@ -70,7 +71,6 @@ import org.apache.airavata.xbaya.ode.WSD
 import org.apache.airavata.xbaya.streaming.StreamReceiveNode;
 import org.apache.airavata.xbaya.streaming.StreamTransformer;
 import org.apache.airavata.xbaya.util.StringUtil;
-import org.apache.airavata.xbaya.util.WSDLUtil;
 import org.apache.airavata.xbaya.util.XMLUtil;
 import org.apache.commons.codec.binary.Base64;
 import org.gpel.GpelConstants;
@@ -78,6 +78,8 @@ import org.gpel.model.GpelProcess;
 import org.xmlpull.infoset.XmlElement;
 import org.xmlpull.infoset.XmlInfosetBuilder;
 import org.xmlpull.infoset.XmlNamespace;
+import org.apache.airavata.common.utils.WSDLUtil;
+
 
 import xsul5.MLogger;
 import xsul5.XmlConstants;
@@ -223,9 +225,8 @@ public class Workflow {
 
     /**
      * Constructs a Workflow.
-     * 
-     * @param workflowString
-     *            Workflow XML in String.
+     *
+     * @param workflowString Workflow XML in String.
      * @throws GraphException
      * @throws ComponentException
      */
@@ -242,7 +243,7 @@ public class Workflow {
 
     /**
      * Constructs a Workflow.
-     * 
+     *
      * @param workflowElement
      * @throws GraphException
      * @throws ComponentException
@@ -260,7 +261,7 @@ public class Workflow {
 
     /**
      * This is used for ODE
-     * 
+     *
      * @return The Template ID like id
      */
     public URI getUniqueWorkflowName() {
@@ -282,7 +283,7 @@ public class Workflow {
 
     /**
      * Returns the gpelInstanceID.
-     * 
+     *
      * @return The gpelInstanceID
      */
     public URI getGPELInstanceID() {
@@ -291,9 +292,8 @@ public class Workflow {
 
     /**
      * Sets gpelInstanceID.
-     * 
-     * @param gpelInstanceID
-     *            The gpelInstanceID to set.
+     *
+     * @param gpelInstanceID The gpelInstanceID to set.
      */
     public void setGPELInstanceID(URI gpelInstanceID) {
         this.gpelInstanceID = gpelInstanceID;
@@ -301,7 +301,7 @@ public class Workflow {
 
     /**
      * Returns the name.
-     * 
+     *
      * @return The name
      */
     public String getName() {
@@ -310,9 +310,8 @@ public class Workflow {
 
     /**
      * Sets name.
-     * 
-     * @param name
-     *            The name to set.
+     *
+     * @param name The name to set.
      */
     public void setName(String name) {
         this.graph.setName(name);
@@ -320,7 +319,7 @@ public class Workflow {
 
     /**
      * Returns the description.
-     * 
+     *
      * @return The description
      */
     public String getDescription() {
@@ -329,9 +328,8 @@ public class Workflow {
 
     /**
      * Sets description.
-     * 
-     * @param description
-     *            The description to set.
+     *
+     * @param description The description to set.
      */
     public void setDescription(String description) {
         this.graph.setDescription(description);
@@ -367,7 +365,7 @@ public class Workflow {
 
     /**
      * Returns the graph.
-     * 
+     *
      * @return The graph
      */
     public WSGraph getGraph() {
@@ -376,9 +374,8 @@ public class Workflow {
 
     /**
      * Sets graph.
-     * 
-     * @param graph
-     *            The graph to set.
+     *
+     * @param graph The graph to set.
      */
     public void setGraph(WSGraph graph) {
         this.graph = graph;
@@ -386,7 +383,7 @@ public class Workflow {
 
     /**
      * Returns the image.
-     * 
+     *
      * @return The image
      */
     public BufferedImage getImage() {
@@ -395,9 +392,8 @@ public class Workflow {
 
     /**
      * Sets image.
-     * 
-     * @param image
-     *            The image to set.
+     *
+     * @param image The image to set.
      */
     public void setImage(BufferedImage image) {
         this.image = image;
@@ -405,7 +401,7 @@ public class Workflow {
 
     /**
      * Returns the gpelProcess.
-     * 
+     *
      * @return The gpelProcess
      */
     public GpelProcess getGpelProcess() {
@@ -414,9 +410,8 @@ public class Workflow {
 
     /**
      * Sets gpelProcess.
-     * 
-     * @param gpelProcess
-     *            The gpelProcess to set.
+     *
+     * @param gpelProcess The gpelProcess to set.
      */
     public void setGpelProcess(GpelProcess gpelProcess) {
         this.gpelProcess = gpelProcess;
@@ -424,7 +419,7 @@ public class Workflow {
 
     /**
      * Returns the workflowWSDL.
-     * 
+     *
      * @return The workflowWSDL
      */
     public WsdlDefinitions getWorkflowWSDL() {
@@ -433,9 +428,8 @@ public class Workflow {
 
     /**
      * Sets workflowWSDL.
-     * 
-     * @param workflowWSDL
-     *            The workflowWSDL to set.
+     *
+     * @param workflowWSDL The workflowWSDL to set.
      */
     public void setWorkflowWSDL(WsdlDefinitions workflowWSDL) {
         this.workflowWSDL = workflowWSDL;
@@ -473,7 +467,7 @@ public class Workflow {
 
     /**
      * This method is called by GPELClient during loading a workflow.
-     * 
+     *
      * @param id
      * @param wsdl
      */
@@ -484,9 +478,8 @@ public class Workflow {
 
     /**
      * Creates a node from a specified component and adds it to the graph.
-     * 
-     * @param component
-     *            The specified component
+     *
+     * @param component The specified component
      * @return The node added
      */
     public Node addNode(Component component) {
@@ -496,9 +489,8 @@ public class Workflow {
 
     /**
      * Removes a specified node from the graph.
-     * 
-     * @param node
-     *            The specified node
+     *
+     * @param node The specified node
      * @throws GraphException
      */
     public void removeNode(Node node) throws GraphException {
@@ -507,9 +499,8 @@ public class Workflow {
 
     /**
      * Imports a specified workflow to the current workflow.
-     * 
-     * @param workflow
-     *            The specified workflow to import
+     *
+     * @param workflow The specified workflow to import
      * @throws GraphException
      */
     public void importWorkflow(Workflow workflow) throws GraphException {
@@ -518,7 +509,7 @@ public class Workflow {
 
     /**
      * Returns the inputs of the workflow.
-     * 
+     *
      * @return The inputs of the workflow.
      * @throws ComponentException
      */
@@ -532,7 +523,7 @@ public class Workflow {
 
     /**
      * Returns the outputs of the workflow.
-     * 
+     *
      * @return The outputs of the workflow.
      * @throws ComponentException
      */
@@ -546,7 +537,7 @@ public class Workflow {
 
     /**
      * Returns the XML Text of the workflow.
-     * 
+     *
      * @return The XML Text of the workflow
      */
     @Deprecated
@@ -556,7 +547,7 @@ public class Workflow {
 
     /**
      * Returns the XmlElement of the workflow.
-     * 
+     *
      * @return The XmlElement of the workflow
      */
     public XmlElement toXML() {
@@ -619,7 +610,7 @@ public class Workflow {
 
     /**
      * Binds WSNodes to components
-     * 
+     *
      * @throws ComponentException
      * @throws GraphException
      */
@@ -648,7 +639,7 @@ public class Workflow {
             if (wsdl == null) {
                 continue;
             }
-
+            try{
             QName portType = node.getPortTypeQName();
             if (portType == null) {
                 // XXX This happens while parsing xwf created by the version
@@ -671,6 +662,9 @@ public class Workflow {
                 components.put(key, component);
             }
             node.setComponent(component);
+            }catch (UtilsException e){
+                logger.throwing(e);
+            }
         }
 
         this.graph.fixParameterNodes();
@@ -718,11 +712,15 @@ public class Workflow {
         // Graph
         XmlElement graphElement = workflowElement.element(GraphSchema.GRAPH_TAG);
         this.graph = WSGraphFactory.createGraph(graphElement);
-
+        WsdlDefinitions wsdl = null;
         XmlElement wsdlsElement = workflowElement.element(WSDLS_TAG);
         for (XmlElement wsdlElement : wsdlsElement.elements(null, WSDL_TAG)) {
             String wsdlText = wsdlElement.requiredText();
-            WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(wsdlText);
+            try {
+                wsdl = WSDLUtil.stringToWSDL(wsdlText);
+            } catch (UtilsException e) {
+                logger.throwing(e);
+            }
             String id = wsdlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
             if (id == null || id.length() == 0) {
                 // xwf up to 2.2.6_2 doesn't have ID.
@@ -785,7 +783,7 @@ public class Workflow {
 
     /**
      * Returns the odeWorkflowWSDL.
-     * 
+     *
      * @return The odeWorkflowWSDL
      * @throws GraphException
      * @throws ComponentException
@@ -800,7 +798,7 @@ public class Workflow {
 
     /**
      * Returns the odeProcess.
-     * 
+     *
      * @return The odeProcess
      * @throws ComponentException
      * @throws GraphException
@@ -814,7 +812,7 @@ public class Workflow {
 
     /**
      * Returns the odeWsdlMap.
-     * 
+     *
      * @return The odeWsdlMap
      * @throws ComponentException
      * @throws GraphException
@@ -830,7 +828,7 @@ public class Workflow {
 
     /**
      * Returns the odeWorkflowWSDL.
-     * 
+     *
      * @return The odeWorkflowWSDL
      * @throws ComponentException
      * @throws GraphException
@@ -886,29 +884,32 @@ public class Workflow {
 
         WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL().getWsdlDefinitions();
         this.odeWorkflowWSDL = abstractWorkflowWsdl;
-        this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString());
-        wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl);
-        wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL);
-
-        this.odeWsdlMap = new HashMap<String, WsdlDefinitions>();
-        Collection<XmlElement> itr = script.getWSDLs();
-        for (XmlElement xmlElement : itr) {
-            WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement));
-            String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
-            if (id == null || id.length() == 0) {
-                // xwf up to 2.2.6_2 doesn't have ID.
-                id = WSDLUtil.getWSDLQName(wsdl).toString();
-                if (null == id || "".equals(id) || (id.startsWith("{") && id.endsWith("}"))) {
-                    QName wsdlQname = new QName(NS_XWF.getName(), WSDLUtil.getFirstOperationName(wsdl,
-                            WSDLUtil.getFirstPortTypeQName(wsdl)));
-                    id = wsdlQname.toString();
-                    wsdl.xml().setAttributeValue("name", wsdlQname.getLocalPart());
+        try {
+            this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString());
+            wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl);
+            wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL);
+
+            this.odeWsdlMap = new HashMap<String, WsdlDefinitions>();
+            Collection<XmlElement> itr = script.getWSDLs();
+            for (XmlElement xmlElement : itr) {
+                WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement));
+                String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
+                if (id == null || id.length() == 0) {
+                    // xwf up to 2.2.6_2 doesn't have ID.
+                    id = WSDLUtil.getWSDLQName(wsdl).toString();
+                    if (null == id || "".equals(id) || (id.startsWith("{") && id.endsWith("}"))) {
+                        QName wsdlQname = new QName(NS_XWF.getName(), WSDLUtil.getFirstOperationName(wsdl,
+                                WSDLUtil.getFirstPortTypeQName(wsdl)));
+                        id = wsdlQname.toString();
+                        wsdl.xml().setAttributeValue("name", wsdlQname.getLocalPart());
+                    }
                 }
+                WSDLCleaner.cleanWSDL(wsdl);
+                this.odeWsdlMap.put(id, wsdl);
             }
-            WSDLCleaner.cleanWSDL(wsdl);
-            this.odeWsdlMap.put(id, wsdl);
+        } catch (Exception e) {
+            logger.throwing(e);
         }
-
         new ODEBPELTransformer()
                 .generateODEBPEL(this.odeProcess, this.getName(), this.odeWorkflowWSDL, this.odeWsdlMap);
 
@@ -963,7 +964,6 @@ public class Workflow {
     }
 
     /**
-     * 
      * @return
      */
     public URI getGPELTemplateID() {
@@ -982,7 +982,7 @@ public class Workflow {
     }
 
     /**
-     * @param running
+     * @param state
      */
     public synchronized void setExecutionState(XBayaExecutionState state) {
         this.executionState = state;