Skip to content

Commit 5db3bf2

Browse files
committed
CRLF -> LF
1 parent 1180fdd commit 5db3bf2

File tree

3 files changed

+161
-161
lines changed

3 files changed

+161
-161
lines changed

ext/soap/tests/wss/T04.phpt

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
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>

ext/soap/tests/wss/T05.phpt

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
--TEST--
2-
SOAP CLIENT WSS: SOAP 1.1 / WSS 1.1 SHA512 with additional header 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");
12-
13-
$client->__setWSS(array(
14-
"random_id" => false,
15-
"digest_method" => SOAP_WSS_DIGEST_METHOD_SHA512,
16-
"wss_version" => SOAP_WSS_VERSION_1_1,
17-
"x509_binsectoken" => "TEST CERTIFICATE",
18-
"signfunc" => function($data) {
19-
return "TEST SIGNATURE";
20-
}
21-
));
22-
23-
$client->__setSoapHeaders(array(
24-
new SoapHeader(
25-
'http://localhost/header/',
26-
'TestHeader1',
27-
'Hello'
28-
),
29-
new SoapHeader(
30-
'http://localhost/header/',
31-
'TestHeader2',
32-
'World'
33-
),
34-
));
35-
36-
$client->testFunction(array(
37-
"Param1" => "foo",
38-
"Param2" => "bar"
39-
));
40-
?>
41-
--EXPECTF--
42-
<?xml version="1.0" encoding="UTF-8"?>
43-
<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" xmlns:ns2="http://localhost/header/">
44-
%w<SOAP-ENV:Header>
45-
%w<wsse11:Security SOAP-ENV:mustUnderstand="1">
46-
%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-1">%s</wsse11:BinarySecurityToken>
47-
%w<ds:Signature>
48-
%w<ds:SignedInfo>
49-
%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
50-
%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
51-
%w<ds:Reference URI="#BodyID-1">
52-
%w<ds:Transforms>
53-
%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
54-
%w</ds:Transforms>
55-
%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>
56-
%w<ds:DigestValue>%s</ds:DigestValue>
57-
%w</ds:Reference>
58-
%w</ds:SignedInfo>
59-
%w<ds:SignatureValue>%s</ds:SignatureValue>
60-
%w<ds:KeyInfo>
61-
%w<wsse11:SecurityTokenReference>
62-
%w<wsse11:Reference URI="#TokenID-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
63-
%w</wsse11:SecurityTokenReference>
64-
%w</ds:KeyInfo>
65-
%w</ds:Signature>
66-
%w</wsse11:Security>
67-
%w<ns2:TestHeader1>Hello</ns2:TestHeader1>
68-
%w<ns2:TestHeader2>World</ns2:TestHeader2>
69-
%w</SOAP-ENV:Header>
70-
%w<SOAP-ENV:Body wsu:Id="BodyID-1">
71-
%w<ns1:testFunctionIn>
72-
%w<ns1:Param1>foo</ns1:Param1>
73-
%w<ns1:Param2>bar</ns1:Param2>
74-
%w</ns1:testFunctionIn>
75-
%w</SOAP-ENV:Body>
76-
</SOAP-ENV:Envelope>
1+
--TEST--
2+
SOAP CLIENT WSS: SOAP 1.1 / WSS 1.1 SHA512 with additional header 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");
12+
13+
$client->__setWSS(array(
14+
"random_id" => false,
15+
"digest_method" => SOAP_WSS_DIGEST_METHOD_SHA512,
16+
"wss_version" => SOAP_WSS_VERSION_1_1,
17+
"x509_binsectoken" => "TEST CERTIFICATE",
18+
"signfunc" => function($data) {
19+
return "TEST SIGNATURE";
20+
}
21+
));
22+
23+
$client->__setSoapHeaders(array(
24+
new SoapHeader(
25+
'http://localhost/header/',
26+
'TestHeader1',
27+
'Hello'
28+
),
29+
new SoapHeader(
30+
'http://localhost/header/',
31+
'TestHeader2',
32+
'World'
33+
),
34+
));
35+
36+
$client->testFunction(array(
37+
"Param1" => "foo",
38+
"Param2" => "bar"
39+
));
40+
?>
41+
--EXPECTF--
42+
<?xml version="1.0" encoding="UTF-8"?>
43+
<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" xmlns:ns2="http://localhost/header/">
44+
%w<SOAP-ENV:Header>
45+
%w<wsse11:Security SOAP-ENV:mustUnderstand="1">
46+
%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-1">%s</wsse11:BinarySecurityToken>
47+
%w<ds:Signature>
48+
%w<ds:SignedInfo>
49+
%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
50+
%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
51+
%w<ds:Reference URI="#BodyID-1">
52+
%w<ds:Transforms>
53+
%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
54+
%w</ds:Transforms>
55+
%w<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>
56+
%w<ds:DigestValue>%s</ds:DigestValue>
57+
%w</ds:Reference>
58+
%w</ds:SignedInfo>
59+
%w<ds:SignatureValue>%s</ds:SignatureValue>
60+
%w<ds:KeyInfo>
61+
%w<wsse11:SecurityTokenReference>
62+
%w<wsse11:Reference URI="#TokenID-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
63+
%w</wsse11:SecurityTokenReference>
64+
%w</ds:KeyInfo>
65+
%w</ds:Signature>
66+
%w</wsse11:Security>
67+
%w<ns2:TestHeader1>Hello</ns2:TestHeader1>
68+
%w<ns2:TestHeader2>World</ns2:TestHeader2>
69+
%w</SOAP-ENV:Header>
70+
%w<SOAP-ENV:Body wsu:Id="BodyID-1">
71+
%w<ns1:testFunctionIn>
72+
%w<ns1:Param1>foo</ns1:Param1>
73+
%w<ns1:Param2>bar</ns1:Param2>
74+
%w</ns1:testFunctionIn>
75+
%w</SOAP-ENV:Body>
76+
</SOAP-ENV:Envelope>

ext/soap/tests/wss/wss-test.inc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<?php
2-
class LocalSoapClient extends SoapClient {
3-
public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string {
4-
$doc = new DOMDocument();
5-
$doc->preserveWhiteSpace = false;
6-
$doc->formatOutput = true;
7-
$doc->loadXML($request);
8-
die($doc->saveXML());
9-
}
10-
}
1+
<?php
2+
class LocalSoapClient extends SoapClient {
3+
public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string {
4+
$doc = new DOMDocument();
5+
$doc->preserveWhiteSpace = false;
6+
$doc->formatOutput = true;
7+
$doc->loadXML($request);
8+
die($doc->saveXML());
9+
}
10+
}

0 commit comments

Comments
 (0)