Commit 99df860a authored by Jérome Perrin's avatar Jérome Perrin

interfaces: python3 compatibility (SOAP)

parent 70067796
...@@ -31,6 +31,9 @@ from Products.ERP5Type import PropertySheet ...@@ -31,6 +31,9 @@ from Products.ERP5Type import PropertySheet
from Products.ERP5Type.Permissions import AccessContentsInformation from Products.ERP5Type.Permissions import AccessContentsInformation
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
import six import six
import zope.component
import zope.interface
from ZPublisher.interfaces import IXmlrpcChecker
try: try:
from spyne import MethodContext from spyne import MethodContext
except ImportError: except ImportError:
...@@ -42,6 +45,20 @@ else: ...@@ -42,6 +45,20 @@ else:
from spyne.server.http import HttpBase from spyne.server.http import HttpBase
_default_xmrpc_checker = zope.component.queryUtility(IXmlrpcChecker)
@zope.interface.implementer(IXmlrpcChecker)
def soap_xmlrpc_checker(request):
if request.getHeader('SOAPACTION'):
return False
return _default_xmrpc_checker is None or _default_xmrpc_checker(request)
zope.component.getGlobalSiteManager().registerUtility(
soap_xmlrpc_checker, IXmlrpcChecker)
class SOAPBinding(Base): class SOAPBinding(Base):
meta_type = 'ERP5 SOAP Binding' meta_type = 'ERP5 SOAP Binding'
...@@ -103,7 +120,7 @@ class SOAPBinding(Base): ...@@ -103,7 +120,7 @@ class SOAPBinding(Base):
server.get_in_object(ctx) server.get_in_object(ctx)
server.get_out_object(ctx) server.get_out_object(ctx)
server.get_out_string(ctx) server.get_out_string(ctx)
return ''.join(ctx.out_string) return b''.join(ctx.out_string)
try: try:
from spyne.service import ServiceBase from spyne.service import ServiceBase
......
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