Skip to content

Commit f069bc4

Browse files
author
Michael Svendsen
committed
Added example for trafficvance using apikey
1 parent 2421b34 commit f069bc4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/trafficvance_apikey.py

Lines changed: 17 additions & 0 deletions
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)