title: ping NewConnectionError('<urllib3.connection.HTTPSConnection object at ...>: Failed to establish a new connection: [Errno 110] Connection timed out'))
body: <p>I am very new to wsdl, asmx, client, <a href="https://docs.python-zeep.org/en/master/" rel="nofollow noreferrer">zeep</a> and other topics related to SOAP APIs, and I have to fix a system of &quot;REST, SOAP APIs - service&quot;, made in Python by others.</p>
  <p>Currently I am working only on my local machine. This is the main context:</p>
  <p>In my project main folder <code>myservice</code> there are:</p>
  <ul>
  <li><p>a service made with Tornado, <code>myservice &gt; myserviceSrv.py</code>, and</p>
  </li>
  <li><p>a set of APIs whose logic is split into two scripts:</p>
  <ul>
  <li><p><code>myservice &gt; handlers &gt; myservice_api.py</code>: containing classes inerithing from <code>tornado.web.RequestHandler</code>, which contain <code>post</code>s methods calling the SOAP APIs in the <code>externalcompany_myservice_api.py</code> script.</p>
  </li>
  <li><p><code>myservice &gt; handlers &gt; externalcompany_myservice_api.py</code>: containing a single class which contains the SOAP APIs methods that will call the externalcompany service SOAP APIs.</p>
  <p>One of these methods is <code>ping</code>, and my aim is to make it work, that is, I want it to get the correct response when I launch a post with Postman.
  In particular, the POST request from Postman should trigger the <code>ping</code> method of my service that should trigger the <code>ping</code> SOAP API that should trigger the corresponding SOAP API of the externalcompany service, which should answer back and in the end give me the post response.</p>
  </li>
  </ul>
  </li>
  <li><p>A module containing some configurations <code>myservice &gt; config.py</code>, mainly the ones bound to <code>tornado.options</code>, the wsdl files path, and the APIs urls.</p>
  </li>
  </ul>
  <p>This is the problem:</p>
  <p>I start my server(/service) and then I lauch the POST with Postman to <code>http://localhost:30205/service/ping</code> (with no inputs), but this is the log and traceback that I get:</p>
  <pre><code>[I 2021-11-15 10:37:20.964 myserviceSrv:76] **************************************************
  [I 2021-11-15 10:37:20.964 myserviceSrv:77] Starting externalcompany service 2021-11-15 10:37:20 on port 30205 for destination externalcompany
  [I 2021-11-15 10:37:20.964 myserviceSrv:78] **************************************************
  [I 2021-11-15 10:33:21.354 myserver_api:154] S - post Ping Handler    
  [I 2021-11-15 10:33:21.354 myserver_api:158] Destination Ping Handler: externalcompany    
  [I 2021-11-15 10:33:21.354 externalcompany_myserver_api:23] S - initialise wsdl    
  [W 2021-11-15 10:33:22.833 soap:218] Forcing soap:address location to HTTPS    
  [W 2021-11-15 10:33:22.833 soap:218] Forcing soap:address location to HTTPS    
  [I 2021-11-15 10:33:22.834 externalcompany_myserver_api:26] Created wsdl externalcompany connection    
  [I 2021-11-15 10:33:22.834 externalcompany_myserver_api:27] E - initialise wsdl    
  [E 2021-11-15 10:35:33.348 externalcompany_myserver_api:216] Exception error ping: HTTPSConnectionPool(host='10.90.XXX.YY', port=8080): Max retries exceeded with url: /WebServices/Api/SalesApi.asmx (Caused by NewConnectionError('&lt;urllib3.connection.HTTPSConnection object at 0x7f3a5dfc4cd0&gt;: Failed to establish a new connection: [Errno 110] Connection timed out'))    
  [I 2021-11-15 10:35:33.348 web:2239] 200 POST /service/ping (::1) 131994.51ms
  </code></pre>
  <p>and here are my questions:</p>
  <ol>
  <li>I don't understand where that IP address 10.90.XXX.YY comes from. I can't find a reference to it into my entire project folder.</li>
  <li>It looks like the code manages to initialize the wsdl, but then it cannot establish a connection. But why? What am I doing wrong, and how can I fix it?</li>
  </ol>
  <p>Here is the content of:</p>
  <h2>myservice_api.py:</h2>
  <pre><code>import tornado.web
  from tornado import gen
  import json
  import logging
  import config as config
  
  class Ping(tornado.web.RequestHandler):
  
      def initialize(self, **kwargs):
          self.destination = kwargs[&quot;destination&quot;]
  
      @gen.coroutine
      def post(self):
          logging.info('S - post Ping Handler')
          response = {}
  
          # Data received
          logging.info(&quot;Destination Ping Handler: {}&quot;.format(self.destination))
  
          # Init module with correct destination - start specific method ping()
          try:
              # calls the class associated to key &quot;destination&quot; -&gt; the class (&quot;externalcompanymyserviceApi&quot;) is initialized
              # init_wsdl is passed the wsdl sales file for settings
              destination_object_init = config.destination_schema[self.destination]()
              response = yield destination_object_init.ping()
  
          except Exception as e:
              logging.error(&quot;Error Ping Handler: {}&quot;.format(e))
  
          raise gen.Return(self.write(response))
  </code></pre>
  <h2>externalcompany_myservice_api.py:</h2>
  <pre><code>import logging
  import config as config
  import json
  import os
  from tornado import gen
  from zeep import Client, Settings, helpers
  from zeep.exceptions import Fault, Error
  from utils import utilities as utils
  
  class externalcompanymyserviceApi:
      def __init__(self):
          # Init wsdl object for all methods in class externalcompany - utilities object
          self.wsdl_object_sales = self.init_wsdl(config.WSDL_SALES)
  
      # wsdl object
      @staticmethod
      def init_wsdl(type_wsdl):
          logging.info(&quot;S - initialise wsdl&quot;)
          settings = Settings(strict=False, xml_huge_tree=True)
          wsdl_externalcompany = Client(wsdl=type_wsdl, settings=settings)
          logging.info(&quot;Created wsdl externalcompany connection&quot;)
          logging.info(&quot;E - initialise wsdl&quot;)
          return wsdl_externalcompany
  </code></pre>
  <h2>config.py</h2>
  <pre><code>from tornado.options import define, parse_command_line
  import logging
  from handlers.externalcompany_myservice_api import externalcompanymyserviceApi
  
  # LOGGING
  logging.basicConfig(format='[%(levelname)1.1s %(asctime)s.%(msecs)03d %(module)s:%(lineno)d] %(message)s',
                      datefmt='%F %T')
  
  # OPTIONS
  
  # default: ip address of externalcompany (alias of externalcompany)
  define(&quot;destination&quot;, default=&quot;externalcompany&quot;, help=&quot;destination of service&quot;, type=str)
  
  # default: port of cash service intermediating with externalcompany
  define(&quot;http_port&quot;, default=30205, help=&quot;run on the given port&quot;, type=int)
  
  parse_command_line()
  
  # SERVICE SETTINGS
  DEBUG = True
  
  ######
  # WSDL
  ######
  
  # links to externalcompany test server
  WSDL_PRODUCTS = &quot;https://externalcompanyapi.vendorcompany.com/webservices/productservice_v1.asmx?WSDL&quot;
  WSDL_SALES = &quot;https://externalcompanyapi.vendorcompany.com/WebServices/Api/SalesApi.asmx?WSDL&quot;
  
  # HANDLERS
  PING = r&quot;/service/ping&quot;
  # ...
  
  destination_schema = {
      &quot;externalcompany&quot;: externalcompanymyserviceApi,
      &quot;John&quot;: &quot;init class John&quot;
  }
  </code></pre>
  <h2>myserviceSrv.py:</h2>
  <pre><code>import config as cf
  from config import PING
  import logging
  import tornado.web
  from datetime import datetime
  from tornado.log import enable_pretty_logging
  from tornado.options import options
  from tornado.ioloop import IOLoop
  from tornado import httpserver
  
  from handlers.myservice_api import Ping
  #...
  
  enable_pretty_logging()
  
  class Destination_Service_Srv:
  
      def __init__(self):
          app = self.make_app()
          self.http_server = self.make_server(app)
  
      @staticmethod
      def make_app():
          settings = {
              &quot;debug&quot;: cf.DEBUG
          }
  
          return tornado.web.Application([
              # ...
              (PING, Ping, {&quot;destination&quot;: options.destination})
          ], **settings)
  
      @staticmethod
      def make_server(app):
          http_server = httpserver.HTTPServer(app, decompress_request=True)
          http_server.listen(options.http_port)
          return http_server
  
      def start(self):
          io_loop = IOLoop.current()
          io_loop.start()
  
      def stop(self):
          io_loop = IOLoop.current()
          io_loop.stop()
  
  if __name__ == &quot;__main__&quot;:
  
      today = datetime.today().strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)
      myservice_server = Destination_Service_Srv()
  
      try:
          logging.info('**************************************************')
          logging.info('Starting myservice service {} on port {} for destination {}'.format(today, options.http_port,
                                                                                            options.destination))
          logging.info('**************************************************')
          myservice_server.start()
  
      except KeyboardInterrupt:
          myservice_server.stop()
  </code></pre>