Changes:
authorSapan Bhatia <sapanb@cs.princeton.edu>
Sun, 5 Jul 2009 00:44:14 +0000 (00:44 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Sun, 5 Jul 2009 00:44:14 +0000 (00:44 +0000)
- Replace soapenc:array -> xsd:list
- Once instance of http://http --> http://

wsdl/globals.py
wsdl/gw2wsdl.py

index 2d7d7c4..33f2d78 100644 (file)
@@ -1,3 +1,4 @@
 #!/usr/bin/python
 
-plc_ns="http://www.planet-lab.org/geniwrapper.wsdl"
+plc_ns="http://www.planet-lab.org/geniwrapper"
+version="2009/07"
index 15aa673..e87babe 100755 (executable)
@@ -2,8 +2,6 @@
 #
 # Sapan Bhatia <sapanb@cs.princeton.edu>
 #
-# This code is under preliminary development. I am going to clean it up
-# once it is tested to work.
 # Generates a WSDL for geniwrapper
 
 
@@ -44,7 +42,6 @@ def fold_complex_type_names(acc, arg):
         acc = [python_is_braindead,name]
     return acc
 
-
 def fold_complex_type(acc, arg):
     global complex_types
     name = name_complex_type(arg)
@@ -60,9 +57,6 @@ def name_complex_type(arg):
     global num_types
     global types
 
-    #if (complex_types.has_key(arg)):
-    #    return complex_types[arg]
-
     types_section = types.getElementsByTagName("xsd:schema")[0]
 
     if (isinstance(arg, Mixed)):
@@ -92,14 +86,10 @@ def name_complex_type(arg):
         inner_type = name_complex_type(arg[0]) 
         num_types=num_types+1
         type_name = "Type%d"%num_types
-        complex_type = types_section.appendChild(types.createElement("xsd:complexType"))
+        complex_type = types_section.appendChild(types.createElement("xsd:simpleType"))
         complex_type.setAttribute("name", type_name)
-        complex_content = complex_type.appendChild(types.createElement("xsd:complexContent"))
-        restriction = complex_content.appendChild(types.createElement("restriction"))
-        restriction.setAttribute("base","soapenc:Array")
-        attribute = restriction.appendChild(types.createElement("attribute"))
-        attribute.setAttribute("ref","soapenc:arrayType")
-        attribute.setAttribute("wsdl:arrayType",inner_type+"[]")
+        complex_content = complex_type.appendChild(types.createElement("xsd:list"))
+        complex_content.setAttribute("itemType",inner_type)
         return "xsdl:%s"%type_name
         
     elif type(arg) == DictType or arg == DictType or issubclass(arg, dict):
@@ -245,11 +235,11 @@ def get_wsdl_definitions():
     wsdl_text_header = """
         <wsdl:definitions
         name="geniwrapper_autogenerated"
-        targetNamespace="%s/2009/06/sfa.wsdl"
+        targetNamespace="%s/2009/07/sfa.wsdl"
         xmlns="http://schemas.xmlsoap.org/wsdl/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-        xmlns:xsdl="http://%s/2009/06/schema"
-        xmlns:tns="%s/2009/06/sfa.wsdl"
+        xmlns:xsdl="%s/2009/07/schema"
+        xmlns:tns="%s/2009/07/sfa.wsdl"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:soapenc="http://schemas.xmlsoap.org/wsdl/soap/encoding"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
@@ -263,16 +253,16 @@ def get_wsdl_definitions_and_types():
     wsdl_text_header = """
     <wsdl:definitions
         name="geniwrapper_autogenerated"
-        targetNamespace="%s/2009/06/sfa.wsdl"
+        targetNamespace="%s/2009/07/sfa.wsdl"
         xmlns="http://schemas.xmlsoap.org/wsdl/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-        xmlns:xsdl="http://%s/2009/06/schema"
-        xmlns:tns="%s/2009/06/sfa.wsdl"
+        xmlns:xsdl="%s/2009/07/schema"
+        xmlns:tns="%s/2009/07/sfa.wsdl"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:soapenc="http://schemas.xmlsoap.org/wsdl/soap/encoding"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
         <types>
-            <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="%s/2009/06/schema"/>
+            <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="%s/2009/07/schema"/>
         </types>
     </wsdl:definitions> """ % (globals.plc_ns, globals.plc_ns, globals.plc_ns, globals.plc_ns)
     wsdl = xml.dom.minidom.parseString(wsdl_text_header)