|
| 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