From 81e73ce6d1df15337d351e84651578c8a6650d72 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Sun, 5 Jul 2009 00:44:14 +0000 Subject: [PATCH] Changes: - Replace soapenc:array -> xsd:list - Once instance of http://http --> http:// --- wsdl/globals.py | 3 ++- wsdl/gw2wsdl.py | 30 ++++++++++-------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/wsdl/globals.py b/wsdl/globals.py index 2d7d7c41..33f2d78f 100644 --- a/wsdl/globals.py +++ b/wsdl/globals.py @@ -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" diff --git a/wsdl/gw2wsdl.py b/wsdl/gw2wsdl.py index 15aa6734..e87babef 100755 --- a/wsdl/gw2wsdl.py +++ b/wsdl/gw2wsdl.py @@ -2,8 +2,6 @@ # # Sapan Bhatia # -# 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 = """ @@ -263,16 +253,16 @@ def get_wsdl_definitions_and_types(): wsdl_text_header = """ - + """ % (globals.plc_ns, globals.plc_ns, globals.plc_ns, globals.plc_ns) wsdl = xml.dom.minidom.parseString(wsdl_text_header) -- 2.47.0