File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ class WsseMiddleware extends Middleware
62
62
*/
63
63
private $ encrypt = false ;
64
64
65
+ /**
66
+ * @var bool
67
+ */
68
+ private $ mustUnderstand = true ;
69
+
65
70
/**
66
71
* @var bool
67
72
*/
@@ -127,7 +132,7 @@ public function withServerCertificateHasSubjectKeyIdentifier(bool $hasSubjectKey
127
132
public function beforeRequest (callable $ handler , RequestInterface $ request ): Promise
128
133
{
129
134
$ xml = SoapXml::fromStream ($ request ->getBody ());
130
- $ wsse = new WSSESoap ($ xml ->getXmlDocument ());
135
+ $ wsse = new WSSESoap ($ xml ->getXmlDocument (), $ this -> mustUnderstand );
131
136
132
137
// Prepare the WSSE soap class:
133
138
$ wsse ->signAllHeaders = $ this ->signAllHeaders ;
Original file line number Diff line number Diff line change @@ -40,6 +40,21 @@ public function testMagicCallByConfig()
40
40
self ::assertTrue ($ response ->ok ());
41
41
}
42
42
43
+ public function testWsseWithWsaCall ()
44
+ {
45
+ Soap::fake ();
46
+ $ client = Soap::baseWsdl ('https://laravel-soap.wsdl ' )->withWsse ([
47
+ 'userTokenName ' => 'Test ' ,
48
+ 'userTokenPassword ' => 'passwordTest ' ,
49
+ 'mustUnderstand ' => false
50
+ ])->withWsa ();
51
+ $ response = $ client ->Get_User ();
52
+ $ lastRequestInfo = $ client ->getEngine ()->collectLastRequestInfo ();
53
+ self ::assertStringNotContainsString ( 'mustUnderstand ' , $ lastRequestInfo ->getLastRequest ());
54
+ // dd($client->debugLastSoapRequest());
55
+ self ::assertTrue ($ response ->ok ());
56
+ }
57
+
43
58
public function testArrayAccessResponse ()
44
59
{
45
60
Soap::fakeSequence ()->push ('test ' );
You can’t perform that action at this time.
0 commit comments