How to use the zeep.client.Client function in zeep

To help you get started, we’ve selected a few zeep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mvantellingen / python-zeep / tests / test_client.py View on Github external
def test_bind():
    client_obj = client.Client("tests/wsdl_files/soap.wsdl")
    service = client_obj.bind()
    assert service
github mvantellingen / python-zeep / tests / test_client.py View on Github external
def test_load_wsdl_with_file_prefix():
    cwd = os.path.dirname(__file__)
    client.Client("file://" + os.path.join(cwd, "wsdl_files/soap.wsdl"))
github mvantellingen / python-zeep / tests / test_client.py View on Github external
def test_open_from_file_object():
    with open("tests/wsdl_files/soap_transport_err.wsdl", "rb") as fh:
        client_obj = client.Client(fh)
        service = client_obj.bind()
        assert service
github mvantellingen / python-zeep / tests / test_client.py View on Github external
def test_create_service():
    client_obj = client.Client("tests/wsdl_files/soap.wsdl")
    service = client_obj.create_service(
        "{http://example.com/stockquote.wsdl}StockQuoteBinding",
        "http://test.python-zeep.org/x",
    )

    response = """
    
    
       
       
          
             120.123
          
github mvantellingen / python-zeep / tests / test_client.py View on Github external
def test_force_https():
    with open("tests/wsdl_files/soap.wsdl") as fh:
        response = fh.read()

    with requests_mock.mock() as m:
        url = "https://tests.python-zeep.org/wsdl"
        m.get(url, text=response, status_code=200)
        client_obj = client.Client(url)
        binding_options = client_obj.service._binding_options
        assert binding_options["address"].startswith("https")

        expected_url = "https://example.com/stockquote"
        assert binding_options["address"] == expected_url
github mvantellingen / python-zeep / tests / test_wsse_username.py View on Github external
def test_integration():
    client_obj = client.Client(
        "tests/wsdl_files/soap.wsdl", wsse=UsernameToken("username", "password")
    )

    response = """
    
    
       
       
          
             120.123
          
       
    
    """.strip()
github dimagi / commcare-hq / custom / rch / utils.py View on Github external
def _initiate_client():
    return Client(RCH_WSDL_URL)
github mvantellingen / python-zeep / src / zeep / __main__.py View on Github external
cache = SqliteCache() if args.cache else None
    session = requests.Session()

    if args.no_verify:
        session.verify = False

    result = urlparse(args.wsdl_file)
    if result.username or result.password:
        session.auth = (result.username, result.password)

    transport = Transport(cache=cache, session=session)
    st = time.time()

    settings = Settings(strict=not args.no_strict)
    client = Client(args.wsdl_file, transport=transport, settings=settings)
    logger.debug("Loading WSDL took %sms", (time.time() - st) * 1000)

    if args.profile:
        profile.disable()
        profile.dump_stats(args.profile)
    client.wsdl.dump()
github evtatarintsev / advcash-api-client / advcash_api_client / client.py View on Github external
def __init__(self, api_name: str, api_secret: str, account_email: str):
        self.api_name = api_name
        self.api_secret = api_secret
        self.account_email = account_email
        self.client = Client(self.wsdl)