import pdb
import xml.dom.minidom
import xml.dom.ext
-import globals
import apistub
+import inspect
+
+import globals
+
from types import *
from sfa.trust.auth import Auth
types_section = types.getElementsByTagName("xsd:schema")[0]
+ #pdb.set_trace()
if (isinstance(arg, Mixed)):
inner_types = reduce(fold_complex_type, arg)
inner_names = reduce(fold_complex_type_names, arg)
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):
+ elif type(arg) == DictType or arg == DictType or (inspect.isclass(arg) and issubclass(arg, dict)):
num_types=num_types+1
type_name = "Type%d"%num_types
complex_type = types_section.appendChild(types.createElement("xsd:complexType"))
element.setAttribute("type",inner_type)
return "xsdl:%s"%type_name
-
else:
return (name_simple_type(arg))
def name_simple_type(arg_type):
+ # A Parameter is reported as an instance, even though it is serialized as a type <>
+ if type(arg_type) == InstanceType:
+ return (name_simple_type(arg_type.type))
if arg_type == None:
return "none"
if arg_type == DictType:
def add_wsdl_ports_and_bindings (wsdl):
for method in apistub.methods:
+ print "Processing method %s"%method
+
# Skip system. methods
if "system." in method:
continue