# Path: webui/server/tornadows/xmltypes.py
# def createElementXML(name,type,prefix='xsd'):
# def createArrayXML(name,type,prefix='xsd',maxoccurs=None):
# 	def __init__(self,type,maxOccurs=None):
# 	def createArray(self,name):
# 	def createType(self,name):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# class Array:
# class PrimitiveType:
# class Integer(PrimitiveType):
# class Decimal(PrimitiveType):
# class Double(PrimitiveType):
# class Float(PrimitiveType):
# class Duration(PrimitiveType):
# class Date(PrimitiveType):
# class Time(PrimitiveType):
# class DateTime(PrimitiveType):
# class String(PrimitiveType):
# class Boolean(PrimitiveType):
# 
# Path: webui/server/tornadows/complextypes.py
# class Property:
# class IntegerProperty(Property):
# class DecimalProperty(Property):
# class DoubleProperty(Property):
# class FloatProperty(Property):
# class DurationProperty(Property):
# class DateProperty(Property):
# class TimeProperty(Property):
# class DateTimeProperty(Property):
# class StringProperty(Property):
# class BooleanProperty(Property):
# class ArrayProperty(list):
# class ComplexType(object):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self, object, minOccurs = 1, maxOccurs=None, data=[]):
# 	def toXSD(self,namespace='xsd',nameelement=None):
# 	def __init__(self):
# 	def toXML(self,name=None,method=''):
# 	def toXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd',method='', ltype=[]):
# 	def _generateXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd', ltype=[]):
# 	def getName(cls):
# 	def _createAttributeType(self,element):
# def xml2object(xml,xsd,complex,method=''):
# def cls2dict(complex):
# def xsd2dict(xsd,namespace='xsd'):
# def xml2list(xmldoc,name,types,method=''):
# def generateOBJ(d,namecls,types):
# def createProperty(typ,value):
# def genattr(elems):
# def findElementFromDict(dictionary,key):
# def convert(typeelement,value):
# def createPythonType2XMLType(pyType):


import xml.dom.minidom
import inspect
from webui.server.tornadows import xmltypes
from webui.server.tornadows import complextypes
		service += '</wsdl:port>\n'
		service += '</wsdl:service>\n'

		definitions  = '<wsdl:definitions name="%s"\n'%self._nameservice
		definitions  += 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"\n'
		definitions  += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n'
		definitions  += 'xmlns:tns="%s"\n'%self._namespace
		definitions  += 'xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"\n'
		definitions  += 'xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"\n'
		definitions  += 'targetNamespace="%s">\n'%self._namespace
		definitions += types
		definitions += messages
		definitions += portType
		definitions += binding
		definitions += service
		definitions += '</wsdl:definitions>\n'
		wsdlXml = xml.dom.minidom.parseString(definitions)

		return wsdlXml

	def _createTypes(self, name, elements):
		""" Private method that creates the types for the elements of wsdl """
		elem = ''
		if isinstance(elements,list):
			elem = '<xsd:complexType name="%sParams">\n'%name
			elem += '<xsd:sequence>\n'
			elems = ''
			idx = 1
			for e in elements:
				if hasattr(e,'__name__'):

# Path: webui/server/tornadows/xmltypes.py
# def createElementXML(name,type,prefix='xsd'):
# def createArrayXML(name,type,prefix='xsd',maxoccurs=None):
# 	def __init__(self,type,maxOccurs=None):
# 	def createArray(self,name):
# 	def createType(self,name):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# 	def createElement(name,prefix='xsd'):
# 	def getType(self):
# 	def genType(self,v):
# class Array:
# class PrimitiveType:
# class Integer(PrimitiveType):
# class Decimal(PrimitiveType):
# class Double(PrimitiveType):
# class Float(PrimitiveType):
# class Duration(PrimitiveType):
# class Date(PrimitiveType):
# class Time(PrimitiveType):
# class DateTime(PrimitiveType):
# class String(PrimitiveType):
# class Boolean(PrimitiveType):
# 
# Path: webui/server/tornadows/complextypes.py
# class Property:
# class IntegerProperty(Property):
# class DecimalProperty(Property):
# class DoubleProperty(Property):
# class FloatProperty(Property):
# class DurationProperty(Property):
# class DateProperty(Property):
# class TimeProperty(Property):
# class DateTimeProperty(Property):
# class StringProperty(Property):
# class BooleanProperty(Property):
# class ArrayProperty(list):
# class ComplexType(object):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self, object, minOccurs = 1, maxOccurs=None, data=[]):
# 	def toXSD(self,namespace='xsd',nameelement=None):
# 	def __init__(self):
# 	def toXML(self,name=None,method=''):
# 	def toXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd',method='', ltype=[]):
# 	def _generateXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd', ltype=[]):
# 	def getName(cls):
# 	def _createAttributeType(self,element):
# def xml2object(xml,xsd,complex,method=''):
# def cls2dict(complex):
# def xsd2dict(xsd,namespace='xsd'):
# def xml2list(xmldoc,name,types,method=''):
# def generateOBJ(d,namecls,types):
# def createProperty(typ,value):
# def genattr(elems):
# def findElementFromDict(dictionary,key):
# def convert(typeelement,value):
# def createPythonType2XMLType(pyType):


# Path: webui/server/tornadows/wsdl.py
import xml.dom.minidom
import inspect
from webui.server.tornadows import xmltypes
from webui.server.tornadows import complextypes

		service += '</wsdl:port>\n'
		service += '</wsdl:service>\n'

		definitions  = '<wsdl:definitions name="%s"\n'%self._nameservice
		definitions  += 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"\n'
		definitions  += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n'
		definitions  += 'xmlns:tns="%s"\n'%self._namespace
		definitions  += 'xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"\n'
		definitions  += 'xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"\n'
		definitions  += 'targetNamespace="%s">\n'%self._namespace
		definitions += types
		definitions += messages
		definitions += portType
		definitions += binding
		definitions += service
		definitions += '</wsdl:definitions>\n'
		wsdlXml = xml.dom.minidom.parseString(definitions)

		return wsdlXml

	def _createTypes(self, name, elements):
		""" Private method that creates the types for the elements of wsdl """
		elem = ''
		if isinstance(elements,list):
			elem = '<xsd:complexType name="%sParams">\n'%name
			elem += '<xsd:sequence>\n'
			elems = ''
			idx = 1
			for e in elements:
				if hasattr(e,'__name__'):

					elems += '<xsd:element name="value%d" type="xsd:%s"/>\n'%(idx,complextypes.createPythonType2XMLType(e.__name__))