Commit 5b866b98 authored by mouadh's avatar mouadh

fix response structure with return

parent fbb5e97b
......@@ -58,6 +58,7 @@ class XmlaDiscoverTools():
def discover_datasources_response():
xml = xmlwitch.Builder()
with xml['return']:
with xml.root(discover_datasources_xsd, xmlns="urn:schemas-microsoft-com:xml-analysis:rowset",
**{'xmlns:EX': 'urn:schemas-microsoft-com:xml-analysis:exception',
'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
......@@ -76,11 +77,13 @@ class XmlaDiscoverTools():
xml.ProviderType('MDP')
xml.AuthenticationMode('Unauthenticated')
return """
<return>
{0}
</return>
""".format(str(xml))
return xml
# return """
# <return>
# {0}
# </return>
# """.format(str(xml))
# return etree.fromstring("""
# <return>
......@@ -129,6 +132,7 @@ class XmlaDiscoverTools():
# </return>
# """.format(xsd, rows))
with xml['return']:
with xml.root(str(xsd), xmlns="urn:schemas-microsoft-com:xml-analysis:rowset",
**{'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'}):
......@@ -168,8 +172,7 @@ class XmlaDiscoverTools():
'3',
'15']
with xml['return']:
with xml.root(str(xsd), xmlns="urn:schemas-microsoft-com:xml-analysis:rowset",
**{'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'}):
......@@ -242,13 +245,12 @@ class XmlaDiscoverTools():
html_parser = HTMLParser.HTMLParser()
xml = html_parser.unescape(str(xml))
# return xml
return """
<return>
{0}
</return>
""".format(xml)
return xml
# return """
# <return>
# {0}
# </return>
# """.format(xml)
if request.Restrictions.RestrictionList.PropertyName == 'Catalog':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment