Commit 5b866b98 authored by mouadh's avatar mouadh

fix response structure with return

parent fbb5e97b
...@@ -58,6 +58,7 @@ class XmlaDiscoverTools(): ...@@ -58,6 +58,7 @@ class XmlaDiscoverTools():
def discover_datasources_response(): def discover_datasources_response():
xml = xmlwitch.Builder() xml = xmlwitch.Builder()
with xml['return']:
with xml.root(discover_datasources_xsd, xmlns="urn:schemas-microsoft-com:xml-analysis:rowset", with xml.root(discover_datasources_xsd, xmlns="urn:schemas-microsoft-com:xml-analysis:rowset",
**{'xmlns:EX': 'urn:schemas-microsoft-com:xml-analysis:exception', **{'xmlns:EX': 'urn:schemas-microsoft-com:xml-analysis:exception',
'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema', 'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
...@@ -76,11 +77,13 @@ class XmlaDiscoverTools(): ...@@ -76,11 +77,13 @@ class XmlaDiscoverTools():
xml.ProviderType('MDP') xml.ProviderType('MDP')
xml.AuthenticationMode('Unauthenticated') xml.AuthenticationMode('Unauthenticated')
return """ return xml
<return>
{0} # return """
</return> # <return>
""".format(str(xml)) # {0}
# </return>
# """.format(str(xml))
# return etree.fromstring(""" # return etree.fromstring("""
# <return> # <return>
...@@ -129,6 +132,7 @@ class XmlaDiscoverTools(): ...@@ -129,6 +132,7 @@ class XmlaDiscoverTools():
# </return> # </return>
# """.format(xsd, rows)) # """.format(xsd, rows))
with xml['return']:
with xml.root(str(xsd), xmlns="urn:schemas-microsoft-com:xml-analysis:rowset", with xml.root(str(xsd), xmlns="urn:schemas-microsoft-com:xml-analysis:rowset",
**{'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema', **{'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'}): 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'}):
...@@ -168,8 +172,7 @@ class XmlaDiscoverTools(): ...@@ -168,8 +172,7 @@ class XmlaDiscoverTools():
'3', '3',
'15'] '15']
with xml['return']:
with xml.root(str(xsd), xmlns="urn:schemas-microsoft-com:xml-analysis:rowset", with xml.root(str(xsd), xmlns="urn:schemas-microsoft-com:xml-analysis:rowset",
**{'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema', **{'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'}): 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance'}):
...@@ -242,13 +245,12 @@ class XmlaDiscoverTools(): ...@@ -242,13 +245,12 @@ class XmlaDiscoverTools():
html_parser = HTMLParser.HTMLParser() html_parser = HTMLParser.HTMLParser()
xml = html_parser.unescape(str(xml)) xml = html_parser.unescape(str(xml))
return xml
# return xml # return """
return """ # <return>
<return> # {0}
{0} # </return>
</return> # """.format(xml)
""".format(xml)
if request.Restrictions.RestrictionList.PropertyName == 'Catalog': 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