Projet

Général

Profil

0001-utils-soap-look-for-custom-transport-class-in-ressou.patch

Frédéric Péters, 21 mars 2019 10:02

Télécharger (1,45 ko)

Voir les différences:

Subject: [PATCH] utils/soap: look for custom transport class in ressource
 (#31612)

 passerelle/utils/__init__.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
passerelle/utils/__init__.py
294 294

  
295 295
    disable basic_authentication hosts unrelated to wsdl's endpoints
296 296
    """
297
    def __init__(self, wsdl_url, **kwargs):
297
    def __init__(self, resource, wsdl_url, **kwargs):
298
        self.resource = resource
298 299
        self.wsdl_host = urlparse.urlparse(wsdl_url).netloc
299 300
        super(SOAPTransport, self).__init__(**kwargs)
300 301

  
......
313 314
    """
314 315
    def __init__(self, resource, **kwargs):
315 316
        wsdl_url = kwargs.pop('wsdl_url', None) or resource.wsdl_url
316
        transport = SOAPTransport(wsdl_url, session=resource.requests, cache=InMemoryCache())
317
        transport_class = getattr(resource, 'soap_transport_class', SOAPTransport)
318
        transport = transport_class(resource, wsdl_url, session=resource.requests, cache=InMemoryCache())
317 319
        super(SOAPClient, self).__init__(wsdl_url, transport=transport, **kwargs)
318 320

  
319 321

  
320
-