#
# 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
acc = [python_is_braindead,name]
return acc
-
def fold_complex_type(acc, arg):
global complex_types
name = 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)):
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):
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/"/>
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)