mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.88k stars 586 forks source link

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fb685c865b0>: Failed to establish a new connection: [Errno -2] Name or service not known #1247

Open StraigenDaigen opened 3 years ago

StraigenDaigen commented 3 years ago

Hi! I want to replicate a request from SOAP UI in zeep.

`

1401 24 80775779 1 ` My python code is following: ` import requests from requests import Session from requests.auth import HTTPBasicAuth # or HTTPDigestAuth, or OAuth1, etc. from zeep import Client from zeep.transports import Transport from zeep import xsd session = Session() session.cert = "XXXXXX/certificate.pem" session.auth = HTTPBasicAuth("XXXXXX", "XXXX") end_point= 'https://cifinpruebas.asobancaria.com/InformacionComercialWS/services/InformacionComercial?wsdl' soap_client = Client(end_point, transport=Transport(session=session), service_name="InformacionComercialWSService", port_name="InformacionComercial") factory = soap_client.type_factory('ns0') request = factory.ParametrosConsultaDTO(codigoInformacion="1401", motivoConsulta="24", numeroIdentificacion="80775779", tipoIdentificacion="1") print(request) try: print(soap_client.service.consultaXml(request)) except requests.exceptions.ConnectionError as e: response = "Without response" print(response) ` But it shows me an error, I think the system is not validating the certificate (.pem), When I'm using SOAP UI I don't have problems. the error is:`urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno -2] Name or service not known` Any suggestion? [https://stackoverflow.com/questions/68489667/how-to-establish-connection-with-soap-webservice-using-python-zeep-library](url)