File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def __getitem__(self, key):
3838class Client :
3939 """The zeep Client.
4040
41- :param wsdl:
41+ :param wsdl: Url/local WSDL location or preparsed WSDL Document
4242 :param wsse:
4343 :param transport: Custom transport class.
4444 :param service_name: The service name for the service binding. Defaults to
@@ -70,7 +70,10 @@ def __init__(
7070 self .transport = (
7171 transport if transport is not None else self ._default_transport ()
7272 )
73- self .wsdl = Document (wsdl , self .transport , settings = self .settings )
73+ if isinstance (wsdl , Document ):
74+ self .wsdl = wsdl
75+ else :
76+ self .wsdl = Document (wsdl , self .transport , settings = self .settings )
7477 self .wsse = wsse
7578 self .plugins = plugins if plugins is not None else []
7679
Original file line number Diff line number Diff line change 55
66from tests .utils import load_xml
77from zeep import client , xsd
8+ from zeep .wsdl import Document
9+ from zeep .transports import Transport
810from zeep .exceptions import Error
911
1012
@@ -14,6 +16,13 @@ def test_bind():
1416 assert service
1517
1618
19+ def test_bind_existing_document ():
20+ wsdl = Document ("tests/wsdl_files/soap.wsdl" , transport = Transport ())
21+ client_obj = client .Client (wsdl )
22+ service = client_obj .bind ()
23+ assert service
24+
25+
1726def test_unknown_transport ():
1827 client_obj = client .Client ("tests/wsdl_files/soap_transport_err.wsdl" )
1928 service = client_obj .bind ()
You can’t perform that action at this time.
0 commit comments