|
1 |
| ---TEST-- |
2 |
| -SOAP CLIENT WSS: SOAP 1.2 / WSS 1.1 SHA256 with timestamp and random id echo |
3 |
| ---EXTENSIONS-- |
4 |
| -soap |
5 |
| ---INI-- |
6 |
| -soap.wsdl_cache_enabled=0 |
7 |
| ---FILE-- |
8 |
| -<?php |
9 |
| -include __DIR__.DIRECTORY_SEPARATOR."wss-test.inc"; |
10 |
| - |
11 |
| -$client = new LocalSoapClient(__DIR__.DIRECTORY_SEPARATOR."wss-test.wsdl",array( |
12 |
| - "soap_version" => SOAP_1_2 |
13 |
| -)); |
14 |
| - |
15 |
| -$client->__setWSS(array( |
16 |
| - "add_timestamp" => true, |
17 |
| - "timestamp_expires" => 300, |
18 |
| - "digest_method" => SOAP_WSS_DIGEST_METHOD_SHA256, |
19 |
| - "wss_version" => SOAP_WSS_VERSION_1_1, |
20 |
| - "x509_binsectoken" => "TEST CERTIFICATE", |
21 |
| - "signfunc" => function($data) { |
22 |
| - return "TEST SIGNATURE"; |
23 |
| - } |
24 |
| -)); |
25 |
| - |
26 |
| -$client->testFunction(array( |
27 |
| - "Param1" => "foo", |
28 |
| - "Param2" => "bar" |
29 |
| -)); |
30 |
| -?> |
31 |
| ---EXPECTF-- |
32 |
| -<?xml version="1.0" encoding="UTF-8"?> |
33 |
| -<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://localhost/" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> |
34 |
| -%w<env:Header> |
35 |
| -%w<wsse11:Security env:mustUnderstand="true"> |
36 |
| -%w<wsu:Timestamp wsu:Id="TimestampID-%d"> |
37 |
| -%w<wsu:Created>%r([0-9]{4})%r-%r([0-9]{2})%r-%r([0-9]{2})%rT%r([0-9]{2})%r:%r([0-9]{2})%r:%r([0-9]{2})%rZ</wsu:Created> |
38 |
| -%w<wsu:Expires>%r([0-9]{4})%r-%r([0-9]{2})%r-%r([0-9]{2})%rT%r([0-9]{2})%r:%r([0-9]{2})%r:%r([0-9]{2})%rZ</wsu:Expires> |
39 |
| -%w</wsu:Timestamp> |
40 |
| -%w<wsse11:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="TokenID-%d">%s</wsse11:BinarySecurityToken> |
41 |
| -%w<ds:Signature> |
42 |
| -%w<ds:SignedInfo> |
43 |
| -%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> |
44 |
| -%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> |
45 |
| -%w<ds:Reference URI="#TimestampID-%d"> |
46 |
| -%w<ds:Transforms> |
47 |
| -%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> |
48 |
| -%w</ds:Transforms> |
49 |
| -%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> |
50 |
| -%w<ds:DigestValue>%s</ds:DigestValue> |
51 |
| -%w</ds:Reference> |
52 |
| -%w<ds:Reference URI="#BodyID-%d"> |
53 |
| -%w<ds:Transforms> |
54 |
| -%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> |
55 |
| -%w</ds:Transforms> |
56 |
| -%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> |
57 |
| -%w<ds:DigestValue>%s</ds:DigestValue> |
58 |
| -%w</ds:Reference> |
59 |
| -%w</ds:SignedInfo> |
60 |
| -%w<ds:SignatureValue>%s</ds:SignatureValue> |
61 |
| -%w<ds:KeyInfo> |
62 |
| -%w<wsse11:SecurityTokenReference> |
63 |
| -%w<wsse11:Reference URI="#TokenID-%d" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/> |
64 |
| -%w</wsse11:SecurityTokenReference> |
65 |
| -%w</ds:KeyInfo> |
66 |
| -%w</ds:Signature> |
67 |
| -%w</wsse11:Security> |
68 |
| -%w</env:Header> |
69 |
| -%w<env:Body wsu:Id="BodyID-%d"> |
70 |
| -%w<ns1:testFunctionIn> |
71 |
| -%w<ns1:Param1>foo</ns1:Param1> |
72 |
| -%w<ns1:Param2>bar</ns1:Param2> |
73 |
| -%w</ns1:testFunctionIn> |
74 |
| -%w</env:Body> |
75 |
| -</env:Envelope> |
| 1 | +--TEST-- |
| 2 | +SOAP CLIENT WSS: SOAP 1.2 / WSS 1.1 SHA256 with timestamp and random id echo |
| 3 | +--EXTENSIONS-- |
| 4 | +soap |
| 5 | +--INI-- |
| 6 | +soap.wsdl_cache_enabled=0 |
| 7 | +--FILE-- |
| 8 | +<?php |
| 9 | +include __DIR__.DIRECTORY_SEPARATOR."wss-test.inc"; |
| 10 | + |
| 11 | +$client = new LocalSoapClient(__DIR__.DIRECTORY_SEPARATOR."wss-test.wsdl",array( |
| 12 | + "soap_version" => SOAP_1_2 |
| 13 | +)); |
| 14 | + |
| 15 | +$client->__setWSS(array( |
| 16 | + "add_timestamp" => true, |
| 17 | + "timestamp_expires" => 300, |
| 18 | + "digest_method" => SOAP_WSS_DIGEST_METHOD_SHA256, |
| 19 | + "wss_version" => SOAP_WSS_VERSION_1_1, |
| 20 | + "x509_binsectoken" => "TEST CERTIFICATE", |
| 21 | + "signfunc" => function($data) { |
| 22 | + return "TEST SIGNATURE"; |
| 23 | + } |
| 24 | +)); |
| 25 | + |
| 26 | +$client->testFunction(array( |
| 27 | + "Param1" => "foo", |
| 28 | + "Param2" => "bar" |
| 29 | +)); |
| 30 | +?> |
| 31 | +--EXPECTF-- |
| 32 | +<?xml version="1.0" encoding="UTF-8"?> |
| 33 | +<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://localhost/" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> |
| 34 | +%w<env:Header> |
| 35 | +%w<wsse11:Security env:mustUnderstand="true"> |
| 36 | +%w<wsu:Timestamp wsu:Id="TimestampID-%d"> |
| 37 | +%w<wsu:Created>%r([0-9]{4})%r-%r([0-9]{2})%r-%r([0-9]{2})%rT%r([0-9]{2})%r:%r([0-9]{2})%r:%r([0-9]{2})%rZ</wsu:Created> |
| 38 | +%w<wsu:Expires>%r([0-9]{4})%r-%r([0-9]{2})%r-%r([0-9]{2})%rT%r([0-9]{2})%r:%r([0-9]{2})%r:%r([0-9]{2})%rZ</wsu:Expires> |
| 39 | +%w</wsu:Timestamp> |
| 40 | +%w<wsse11:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="TokenID-%d">%s</wsse11:BinarySecurityToken> |
| 41 | +%w<ds:Signature> |
| 42 | +%w<ds:SignedInfo> |
| 43 | +%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> |
| 44 | +%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> |
| 45 | +%w<ds:Reference URI="#TimestampID-%d"> |
| 46 | +%w<ds:Transforms> |
| 47 | +%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> |
| 48 | +%w</ds:Transforms> |
| 49 | +%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> |
| 50 | +%w<ds:DigestValue>%s</ds:DigestValue> |
| 51 | +%w</ds:Reference> |
| 52 | +%w<ds:Reference URI="#BodyID-%d"> |
| 53 | +%w<ds:Transforms> |
| 54 | +%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> |
| 55 | +%w</ds:Transforms> |
| 56 | +%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> |
| 57 | +%w<ds:DigestValue>%s</ds:DigestValue> |
| 58 | +%w</ds:Reference> |
| 59 | +%w</ds:SignedInfo> |
| 60 | +%w<ds:SignatureValue>%s</ds:SignatureValue> |
| 61 | +%w<ds:KeyInfo> |
| 62 | +%w<wsse11:SecurityTokenReference> |
| 63 | +%w<wsse11:Reference URI="#TokenID-%d" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/> |
| 64 | +%w</wsse11:SecurityTokenReference> |
| 65 | +%w</ds:KeyInfo> |
| 66 | +%w</ds:Signature> |
| 67 | +%w</wsse11:Security> |
| 68 | +%w</env:Header> |
| 69 | +%w<env:Body wsu:Id="BodyID-%d"> |
| 70 | +%w<ns1:testFunctionIn> |
| 71 | +%w<ns1:Param1>foo</ns1:Param1> |
| 72 | +%w<ns1:Param2>bar</ns1:Param2> |
| 73 | +%w</ns1:testFunctionIn> |
| 74 | +%w</env:Body> |
| 75 | +</env:Envelope> |
0 commit comments