1
1
--TEST--
2
- SOAP CLIENT WSS: WSS 1.1 SHA256 with timestamp and random id echo
2
+ SOAP CLIENT WSS: SOAP 1.2 / WSS 1.1 SHA256 with timestamp and random id echo
3
3
--EXTENSIONS--
4
4
soap
5
5
--INI--
@@ -8,7 +8,9 @@ soap.wsdl_cache_enabled=0
8
8
<?php
9
9
include __DIR__ .DIRECTORY_SEPARATOR ."wss-test.inc " ;
10
10
11
- $ client = new LocalSoapClient (__DIR__ .DIRECTORY_SEPARATOR ."wss-test.wsdl " );
11
+ $ client = new LocalSoapClient (__DIR__ .DIRECTORY_SEPARATOR ."wss-test.wsdl " ,array (
12
+ "soap_version " => SOAP_1_2
13
+ ));
12
14
13
15
$ client ->__setWSS (array (
14
16
"add_timestamp " => true ,
@@ -28,26 +30,26 @@ $client->testFunction(array(
28
30
?>
29
31
--EXPECTF--
30
32
<? xml version="1.0 " encoding="UTF -8 "?>
31
- <SOAP-ENV :Envelope xmlns:SOAP-ENV ="http://schemas.xmlsoap .org/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">
32
- %w<SOAP-ENV :Header>
33
- %w<wsse11:Security SOAP-ENV :mustUnderstand="1 ">
34
- %w<wsu:Timestamp wsu:Id="TimestampID-%i ">
35
- %w<wsu:Created>%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c </wsu:Created>
36
- %w<wsu:Expires>%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c </wsu:Expires>
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>
37
39
%w</wsu:Timestamp>
38
- %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-%i ">%s</wsse11:BinarySecurityToken>
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>
39
41
%w<ds:Signature>
40
42
%w<ds:SignedInfo>
41
43
%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
42
44
%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
43
- %w<ds:Reference URI="#TimestampID-%i ">
45
+ %w<ds:Reference URI="#TimestampID-%d ">
44
46
%w<ds:Transforms>
45
47
%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
46
48
%w</ds:Transforms>
47
49
%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
48
50
%w<ds:DigestValue>%s</ds:DigestValue>
49
51
%w</ds:Reference>
50
- %w<ds:Reference URI="#BodyID-%i ">
52
+ %w<ds:Reference URI="#BodyID-%d ">
51
53
%w<ds:Transforms>
52
54
%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
53
55
%w</ds:Transforms>
@@ -58,16 +60,16 @@ $client->testFunction(array(
58
60
%w<ds:SignatureValue>%s</ds:SignatureValue>
59
61
%w<ds:KeyInfo>
60
62
%w<wsse11:SecurityTokenReference>
61
- %w<wsse11:Reference URI="#TokenID-%i " ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
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"/>
62
64
%w</wsse11:SecurityTokenReference>
63
65
%w</ds:KeyInfo>
64
66
%w</ds:Signature>
65
67
%w</wsse11:Security>
66
- %w</SOAP-ENV :Header>
67
- %w<SOAP-ENV :Body wsu:Id="BodyID-%i ">
68
+ %w</env :Header>
69
+ %w<env :Body wsu:Id="BodyID-%d ">
68
70
%w<ns1:testFunctionIn>
69
71
%w<ns1:Param1>foo</ns1:Param1>
70
72
%w<ns1:Param2>bar</ns1:Param2>
71
73
%w</ns1:testFunctionIn>
72
- %w</SOAP-ENV :Body>
73
- </SOAP-ENV :Envelope>
74
+ %w</env :Body>
75
+ </env :Envelope>
0 commit comments