# Path: webui/server/tornadows/soap.py
# class SoapMessage:
# 	def __init__(self):
# 	def getSoap(self):
# 	def getHeader(self):
# 	def getBody(self):
# 	def setHeader(self, header):
# 	def setBody(self,body):
# 	def removeHeader(self):
# 	def removeBody(self):
# 
# 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
# class Wsdl:
# 	def __init__(self,nameservice=None,targetNamespace=None,methods=None,location=None):
# 	def createWsdl(self):
# 	def _createTypes(self, name, elements):
# 	def _createComplexTypes(self, name, arguments, elements):


import tornado.httpserver
import tornado.web
import xml.dom.minidom
import inspect
from tornado.options import options
from webui.server.tornadows import soap
from webui.server.tornadows import xmltypes
from webui.server.tornadows import complextypes
from webui.server.tornadows import wsdl
		return list_of_elements

	def _parseXML(self,elements):
		""" Private method parse and digest the xml.dom.minidom.Element 
		    finding the childs of Header and Body from soap message. 
		    Return a list object with all of child Elements.
		"""
		elem_list = []
		if len(elements) <= 0:
			return elem_list
		if elements[0].childNodes.length <= 0:
			return elem_list
		for element in elements[0].childNodes:
			if element.nodeType == element.ELEMENT_NODE:
				prefix = element.prefix
				namespace = element.namespaceURI
				if prefix != None and namespace != None:
					element.setAttribute('xmlns:'+prefix,namespace)
				else:
					element.setAttribute('xmlns:xsd',"http://www.w3.org/2001/XMLSchema")
					element.setAttribute('xmlns:xsi',"http://www.w3.org/2001/XMLSchema-instance")
				elem_list.append(xml.dom.minidom.parseString(element.toxml()))
		return elem_list

	def _parseComplexType(self,complex,xmld,method=''):
		""" Private method for generate an instance of class nameclass. """
		xsdd  = '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
		xsdd += complex.toXSD(method=method,ltype=[])
		xsdd += '</xsd:schema>'
		xsd = xml.dom.minidom.parseString(xsdd)

# Path: webui/server/tornadows/soap.py
# class SoapMessage:
# 	def __init__(self):
# 	def getSoap(self):
# 	def getHeader(self):
# 	def getBody(self):
# 	def setHeader(self, header):
# 	def setBody(self,body):
# 	def removeHeader(self):
# 	def removeBody(self):
# 
# 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
# class Wsdl:
# 	def __init__(self,nameservice=None,targetNamespace=None,methods=None,location=None):
# 	def createWsdl(self):
# 	def _createTypes(self, name, elements):
# 	def _createComplexTypes(self, name, arguments, elements):


# Path: webui/server/tornadows/soaphandler.py
import tornado.httpserver
import tornado.web
import xml.dom.minidom
import inspect
from tornado.options import options
from webui.server.tornadows import soap
from webui.server.tornadows import xmltypes
from webui.server.tornadows import complextypes
from webui.server.tornadows import wsdl

		return list_of_elements

	def _parseXML(self,elements):
		""" Private method parse and digest the xml.dom.minidom.Element 
		    finding the childs of Header and Body from soap message. 
		    Return a list object with all of child Elements.
		"""
		elem_list = []
		if len(elements) <= 0:
			return elem_list
		if elements[0].childNodes.length <= 0:
			return elem_list
		for element in elements[0].childNodes:
			if element.nodeType == element.ELEMENT_NODE:
				prefix = element.prefix
				namespace = element.namespaceURI
				if prefix != None and namespace != None:
					element.setAttribute('xmlns:'+prefix,namespace)
				else:
					element.setAttribute('xmlns:xsd',"http://www.w3.org/2001/XMLSchema")
					element.setAttribute('xmlns:xsi',"http://www.w3.org/2001/XMLSchema-instance")
				elem_list.append(xml.dom.minidom.parseString(element.toxml()))
		return elem_list

	def _parseComplexType(self,complex,xmld,method=''):
		""" Private method for generate an instance of class nameclass. """
		xsdd  = '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
		xsdd += complex.toXSD(method=method,ltype=[])
		xsdd += '</xsd:schema>'
		xsd = xml.dom.minidom.parseString(xsdd)

		obj = complextypes.xml2object(xmld.toxml(),xsd,complex,method=method)