File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ Like Wss/Wsse it uses the same package:
4242 ->withWsa()
4343 ->call(...)
4444
45+ You can also use the 2005 version of Wsa with
46+
47+ $response = Soap::baseWsdl(...)
48+ ->withWsa2005()
49+ ->call(...)
50+
4551### DHL Cis Authentication
4652
4753DHL uses his own authentication header
Original file line number Diff line number Diff line change 3838use Soap \Psr18Transport \Psr18Transport ;
3939use Soap \Psr18Transport \Wsdl \Psr18Loader ;
4040use Soap \Psr18WsseMiddleware \WsaMiddleware ;
41+ use Soap \Psr18WsseMiddleware \WsaMiddleware2005 ;
4142use Soap \Wsdl \Loader \FlatteningLoader ;
4243use Soap \Wsdl \Loader \StreamWrapperLoader ;
4344
@@ -248,6 +249,18 @@ public function withWsa()
248249 return $ this ;
249250 }
250251
252+ /**
253+ * @return $this
254+ */
255+ public function withWsa2005 ()
256+ {
257+ $ this ->middlewares = array_merge_recursive ($ this ->middlewares , [
258+ new WsaMiddleware2005 (),
259+ ]);
260+
261+ return $ this ;
262+ }
263+
251264 public function withWsse (array $ options ): static
252265 {
253266 $ this ->middlewares = array_merge_recursive ($ this ->middlewares , [
Original file line number Diff line number Diff line change @@ -70,6 +70,22 @@ public function testWsseWithWsaCall()
7070 self ::assertTrue ($ response ->ok ());
7171 }
7272
73+ public function testWsseWithWsa2005Call ()
74+ {
75+ Soap::fake ();
76+ ray ()->showSoapClientRequests ();
77+ $ client = Soap::baseWsdl (dirname (__DIR__ , 1 ).'/Fixtures/Wsdl/weather.wsdl ' )->withWsse ([
78+ 'userTokenName ' => 'Test ' ,
79+ 'userTokenPassword ' => 'passwordTest ' ,
80+ 'mustUnderstand ' => false ,
81+ ])->withWsa2005 ();
82+ $ response = $ client ->GetWeatherInformation ();
83+ Soap::assertSent (function (Request $ request ) {
84+ return ! Str::contains ($ request ->xmlContent (), 'mustUnderstand ' );
85+ });
86+ self ::assertTrue ($ response ->ok ());
87+ }
88+
7389 public function testArrayAccessResponse ()
7490 {
7591 Soap::fakeSequence ()->push ('test ' );
You can’t perform that action at this time.
0 commit comments