Skip to content

Commit 7e95781

Browse files
committed
+2 tests
1 parent 47389e3 commit 7e95781

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed

ext/soap/tests/wss/T07.phpt

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
--TEST--
2+
SOAP CLIENT WSS: SOAP 1.1 / WSS 1.0 SHA1 with user defined function 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+
function __wss_test_signfunc($data) {
12+
return "TEST SIGNATURE";
13+
}
14+
15+
$client = new LocalSoapClient(__DIR__.DIRECTORY_SEPARATOR."wss-test.wsdl");
16+
17+
$client->__setWSS(array(
18+
"random_id" => false,
19+
"x509_binsectoken" => "TEST CERTIFICATE",
20+
"signfunc" => "__wss_test_signfunc"
21+
));
22+
23+
$client->testFunction(array(
24+
"Param1" => "foo",
25+
"Param2" => "bar"
26+
));
27+
?>
28+
--EXPECTF--
29+
<?xml version="1.0" encoding="UTF-8"?>
30+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.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">
31+
%w<SOAP-ENV:Header>
32+
%w<wsse:Security SOAP-ENV:mustUnderstand="1">
33+
%w<wsse: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">VEVTVCBDRVJUSUZJQ0FURQ==</wsse:BinarySecurityToken>
34+
%w<ds:Signature>
35+
%w<ds:SignedInfo>
36+
%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
37+
%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
38+
%w<ds:Reference URI="#BodyID-1">
39+
%w<ds:Transforms>
40+
%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
41+
%w</ds:Transforms>
42+
%w<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
43+
%w<ds:DigestValue>OaQiUDsEKrCjytgTUqF4CLsB9jo=</ds:DigestValue>
44+
%w</ds:Reference>
45+
%w</ds:SignedInfo>
46+
%w<ds:SignatureValue>VEVTVCBTSUdOQVRVUkU=</ds:SignatureValue>
47+
%w<ds:KeyInfo>
48+
%w<wsse:SecurityTokenReference>
49+
%w<wsse:Reference URI="#TokenID-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
50+
%w</wsse:SecurityTokenReference>
51+
%w</ds:KeyInfo>
52+
%w</ds:Signature>
53+
%w</wsse:Security>
54+
%w</SOAP-ENV:Header>
55+
%w<SOAP-ENV:Body wsu:Id="BodyID-1">
56+
%w<ns1:testFunctionIn>
57+
%w<ns1:Param1>foo</ns1:Param1>
58+
%w<ns1:Param2>bar</ns1:Param2>
59+
%w</ns1:testFunctionIn>
60+
%w</SOAP-ENV:Body>
61+
</SOAP-ENV:Envelope>

ext/soap/tests/wss/T08.phpt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
--TEST--
2+
SOAP CLIENT WSS: SOAP 1.1 / WSS 1.0 SHA1 with user defined class 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+
class __wssTestSignClass {
12+
public function sign($data) {
13+
return "TEST SIGNATURE";
14+
}
15+
}
16+
17+
$obj = new __wssTestSignClass();
18+
19+
$client = new LocalSoapClient(__DIR__.DIRECTORY_SEPARATOR."wss-test.wsdl");
20+
21+
$client->__setWSS(array(
22+
"random_id" => false,
23+
"x509_binsectoken" => "TEST CERTIFICATE",
24+
"signfunc" => array($obj,"sign")
25+
));
26+
27+
$client->testFunction(array(
28+
"Param1" => "foo",
29+
"Param2" => "bar"
30+
));
31+
?>
32+
--EXPECTF--
33+
<?xml version="1.0" encoding="UTF-8"?>
34+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.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">
35+
%w<SOAP-ENV:Header>
36+
%w<wsse:Security SOAP-ENV:mustUnderstand="1">
37+
%w<wsse: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">VEVTVCBDRVJUSUZJQ0FURQ==</wsse:BinarySecurityToken>
38+
%w<ds:Signature>
39+
%w<ds:SignedInfo>
40+
%w<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
41+
%w<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
42+
%w<ds:Reference URI="#BodyID-1">
43+
%w<ds:Transforms>
44+
%w<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
45+
%w</ds:Transforms>
46+
%w<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
47+
%w<ds:DigestValue>OaQiUDsEKrCjytgTUqF4CLsB9jo=</ds:DigestValue>
48+
%w</ds:Reference>
49+
%w</ds:SignedInfo>
50+
%w<ds:SignatureValue>VEVTVCBTSUdOQVRVUkU=</ds:SignatureValue>
51+
%w<ds:KeyInfo>
52+
%w<wsse:SecurityTokenReference>
53+
%w<wsse:Reference URI="#TokenID-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
54+
%w</wsse:SecurityTokenReference>
55+
%w</ds:KeyInfo>
56+
%w</ds:Signature>
57+
%w</wsse:Security>
58+
%w</SOAP-ENV:Header>
59+
%w<SOAP-ENV:Body wsu:Id="BodyID-1">
60+
%w<ns1:testFunctionIn>
61+
%w<ns1:Param1>foo</ns1:Param1>
62+
%w<ns1:Param2>bar</ns1:Param2>
63+
%w</ns1:testFunctionIn>
64+
%w</SOAP-ENV:Body>
65+
</SOAP-ENV:Envelope>

0 commit comments

Comments
 (0)