# 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


""" Global variable. If you want use your own wsdl file """
wsdl_path = None

def webservice(*params,**kwparams):
	""" Decorator method for web services operators """
	def method(f):
		_input = None
		_output = None
		_inputArray = False
		_outputArray = False
		_args = None
		if len(kwparams):
			_params = kwparams['_params']
			if inspect.isclass(_params) and issubclass(_params,complextypes.ComplexType):
				_args = inspect.getargspec(f).args[1:]
				_input = _params
			elif isinstance(_params,list):
				_args = inspect.getargspec(f).args[1:]
				_input = {}
				i = 0
				for arg in _args:
					_input[arg] = _params[i]
					i+=1
			else:
				_args = inspect.getargspec(f).args[1:]
				_input = {}
				for arg in _args:
					_input[arg] = _params

# 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



""" Global variable. If you want use your own wsdl file """
wsdl_path = None

def webservice(*params,**kwparams):
	""" Decorator method for web services operators """
	def method(f):
		_input = None
		_output = None
		_inputArray = False
		_outputArray = False
		_args = None
		if len(kwparams):
			_params = kwparams['_params']
			if inspect.isclass(_params) and issubclass(_params,complextypes.ComplexType):
				_args = inspect.getargspec(f).args[1:]
				_input = _params
			elif isinstance(_params,list):
				_args = inspect.getargspec(f).args[1:]
				_input = {}
				i = 0
				for arg in _args:
					_input[arg] = _params[i]
					i+=1
			else:
				_args = inspect.getargspec(f).args[1:]
				_input = {}
				for arg in _args:
					_input[arg] = _params

				if isinstance(_params,xmltypes.Array):