airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject svn commit: r1195628 - in /incubator/airavata/trunk/modules/commons/gfac-schema/src: main/java/org/apache/airavata/commons/gfac/wsdl/ test/java/org/ test/java/org/apache/ test/java/org/apache/airavata/ test/java/org/apache/airavata/commons/ test/java/o...
Date Mon, 31 Oct 2011 19:25:19 GMT
Author: smarru
Date: Mon Oct 31 19:25:19 2011
New Revision: 1195628

URL: http://svn.apache.org/viewvc?rev=1195628&view=rev
Log:
Couple of methods to write test cases for generate wsdl

Added:
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/
    incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/TestWSDLGeneration.java
Modified:
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLConstants.java

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLConstants.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLConstants.java?rev=1195628&r1=1195627&r2=1195628&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLConstants.java
(original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLConstants.java
Mon Oct 31 19:25:19 2011
@@ -36,6 +36,8 @@ public interface WSDLConstants {
     public final static String XMLNS = "xmlns";
 
     public final static String TARGET_NAMESPACE = "targetNamespace";
+    
+    public static final String TRANSPORT_LEVEL = "TransportLevel";
 
     public final static String SCHEMA = "schema";
 

Added: incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/TestWSDLGeneration.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/TestWSDLGeneration.java?rev=1195628&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/TestWSDLGeneration.java
(added)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/TestWSDLGeneration.java
Mon Oct 31 19:25:19 2011
@@ -0,0 +1,46 @@
+package org.apache.airavata.commons.gfac.wsdl;
+
+import java.util.Hashtable;
+
+import org.apache.airavata.schemas.gfac.ServiceDescriptionDocument;
+import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
+import org.apache.xmlbeans.XmlException;
+
+public class TestWSDLGeneration {
+
+    public static String createAwsdl4ServiceMap(String serviceDescAsStr) throws GFacWSDLException
{
+        try {
+            ServiceDescriptionType serviceDesc = ServiceDescriptionDocument.Factory.parse(serviceDescAsStr)
+                    .getServiceDescription();
+            WSDLGenerator wsdlGenerator = new WSDLGenerator();
+            Hashtable serviceTable = wsdlGenerator.generateWSDL(null, null, null, serviceDesc,
true);
+            String wsdl = (String) serviceTable.get(WSDLConstants.AWSDL);
+            System.out.println("The generated AWSDL is " + wsdl);
+            return wsdl;
+        } catch (XmlException e) {
+            throw new GFacWSDLException(e);
+        }
+    }
+
+    public static String createCwsdl4ServiceMap(String serviceDescAsStr) throws GFacWSDLException
{
+        try {
+            ServiceDescriptionType serviceDesc = ServiceDescriptionDocument.Factory.parse(serviceDescAsStr)
+                    .getServiceDescription();
+            WSDLGenerator wsdlGenerator = new WSDLGenerator();
+            String security = WSDLConstants.TRANSPORT_LEVEL;
+            String serviceLocation = "http://localhost:8080/axis2/services/test?wsdl";
+            
+            Hashtable serviceTable = wsdlGenerator.generateWSDL(serviceLocation, null, security,
+                    serviceDesc, false);
+            
+            String wsdl = (String) serviceTable.get(WSDLConstants.WSDL);
+            
+            System.out.println("The generated CWSDL is " + wsdl);
+            return wsdl;
+
+        } catch (XmlException e) {
+            throw new GFacWSDLException(e);
+        }
+    }
+    
+}



Mime
View raw message