|
3 | 3 |
|
4 | 4 | import pytest |
5 | 5 | from lxml.etree import QName |
6 | | - |
| 6 | +from lxml import etree |
7 | 7 | from tests.utils import load_xml |
8 | 8 | from zeep import ns, wsse |
9 | 9 | from zeep.exceptions import SignatureVerificationFailed |
|
30 | 30 | def test_sign_timestamp_if_present(): |
31 | 31 | envelope = load_xml( |
32 | 32 | """ |
33 | | - <soapenv:Envelope |
34 | | - xmlns:tns="http://tests.python-zeep.org/" |
35 | | - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" |
36 | | - xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" |
| 33 | + <soap-env:Envelope |
| 34 | + xmlns:ns0="http://example.com/stockquote.xsd" |
37 | 35 | xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" |
38 | | - xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility"> |
39 | | - <soapenv:Header> |
40 | | - <wsu:Timestamp> |
41 | | - <wsu:Created>2018-11-18T15:44:27Z</wsu:Created> |
42 | | - <wsu:Expires>2018-11-18T15:54:27Z</wsu:Expires> |
43 | | - </wsu:Timestamp> |
44 | | - </soapenv:Header> |
45 | | - <soapenv:Body> |
46 | | - <tns:Function> |
47 | | - <tns:Argument>OK</tns:Argument> |
48 | | - </tns:Function> |
49 | | - </soapenv:Body> |
50 | | - </soapenv:Envelope> |
| 36 | + xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" |
| 37 | + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" |
| 38 | + xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility" |
| 39 | + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| 40 | + <soap-env:Header xmlns:ns0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
| 41 | + <ns0:Security> |
| 42 | + <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> |
| 43 | + <wsu:Created>2018-11-18T15:44:27Z</wsu:Created> |
| 44 | + <wsu:Expires>2018-11-18T15:54:27Z</wsu:Expires> |
| 45 | + </wsu:Timestamp> |
| 46 | + </ns0:Security> |
| 47 | + </soap-env:Header> |
| 48 | + <soap-env:Body> |
| 49 | + <ns0:TradePriceRequest> |
| 50 | + <tickerSymbol>foobar</tickerSymbol> |
| 51 | + <ns0:country/> |
| 52 | + </ns0:TradePriceRequest> |
| 53 | + </soap-env:Body> |
| 54 | + </soap-env:Envelope> |
51 | 55 | """ |
52 | 56 | ) |
53 | 57 |
|
|
0 commit comments