Invoking a SOAP service

  • Use Dashboard to create an outgoing connection to a SOAP server.
  • Note that the client object is based on Suds and offers everything Suds does.
  • In the usage example below, we take the WSDL from here to find details of a bank by its code


Python code

# -*- coding: utf-8 -*-

# Zato
from zato.server.service import Service

class MyService(Service):
   """ Obtains BLZ bank details for input bank code.
   More about BLZ on Wikipedia -
   def handle(self):

         with self.outgoing.soap.get('BLZ').conn.client() as client:

            # Prepare input data
            bank_code = '12070000'

            # Only pure-Python objects are used to invoke a remote service
            output = client.service.getBank(bank_code)

            # Log response received
  'BIC `%s`', output.bic)
  'Name `%s`', output.bezeichnung)

In server.log:

INFO - Name `Deutsche Bank Ld Brandenburg`