I got this same error and in my case the server I was sending the request to was replying with a 504 Gateway Time-out error. I didn't realize this until I went to the URL in a browser that was being requested by the SOAP request:
eg.
https://soap-request-domain-here.com/path/to/file.wsdl