Skip to content

Commit 1b519e2

Browse files
Merge pull request mvantellingen#667 from MichaelSvendsen/trafficvance-example
Added example for trafficvance using apikey
2 parents 2f61894 + f069bc4 commit 1b519e2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/trafficvance_apikey.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from zeep import Client, xsd
2+
3+
API_KEY_TEST = 'YOUR_OWN_API_KEY'
4+
WSDL_TEST = 'https://apitest.trafficvance.com/?v3=system.wsdl'
5+
6+
client = Client(WSDL)
7+
header = xsd.Element(
8+
'{WSDL_TEST}AuthenticateRequest',
9+
xsd.ComplexType([
10+
xsd.Element(
11+
'{WSDL_TEST}apiKey', xsd.String()
12+
)
13+
])
14+
)
15+
header_value = header(apiKey=API_KEY_TEST)
16+
17+
res = client.service.getServerTime(_soapheaders=[header_value])

0 commit comments

Comments
 (0)