Commit ac0b0f63 authored by Mouadh Kaabachi's avatar Mouadh Kaabachi Committed by GitHub

Merge pull request #4 from bkocherov/master

support OPTIONS request, that is needed for https
parents e6ecac5d 3cab42e0
......@@ -7,9 +7,11 @@ from datetime import datetime
from os.path import expanduser
from lxml import etree
from spyne import AnyXml, Application, ServiceBase, rpc
from spyne import AnyXml, Application, ServiceBase, rpc, Fault
from spyne.const.http import HTTP_200
from spyne.error import InvalidCredentialsError
from spyne.protocol.soap import Soap11
from spyne.server.http import HttpTransportContext
from spyne.server.wsgi import WsgiApplication
from ..mdx.tools.config_file_parser import ConfigParser
......@@ -20,6 +22,17 @@ from .xmla_execute_tools import XmlaExecuteTools
from .xmla_execute_xsds import execute_xsd
class XmlaSoap11(Soap11):
def create_in_document(self, ctx, charset=None):
if isinstance(ctx.transport, HttpTransportContext):
http_verb = ctx.transport.get_request_method()
if http_verb == "OPTIONS":
ctx.transport.resp_headers['allow'] = "POST, OPTIONS"
ctx.transport.respond(HTTP_200)
raise Fault("")
return Soap11.create_in_document(self, ctx, charset)
class XmlaProviderService(ServiceBase):
"""
The main class to active soap services between xmla clients and olapy.
......@@ -214,8 +227,8 @@ class XmlaProviderService(ServiceBase):
application = Application(
[XmlaProviderService],
'urn:schemas-microsoft-com:xml-analysis',
in_protocol=Soap11(validator='soft'),
out_protocol=Soap11(validator='soft'))
in_protocol=XmlaSoap11(validator='soft'),
out_protocol=XmlaSoap11(validator='soft'))
# validator='soft' or nothing, this is important because spyne doesn't support encodingStyle until now !!!!
......
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