Skip to content

Commit 1e280f4

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 04113b4 + 4cb1309 commit 1e280f4

File tree

7 files changed

+74
-44
lines changed

7 files changed

+74
-44
lines changed

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- name: Dependabot metadata
1616
id: metadata
17-
uses: dependabot/fetch-metadata@v1.3.0
17+
uses: dependabot/fetch-metadata@v1.3.1
1818
with:
1919
github-token: "${{ secrets.GITHUB_TOKEN }}"
2020

.github/workflows/releaseDrafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
# Drafts your next Release notes as Pull Requests are merged into "master"
15-
- uses: release-drafter/release-drafter@v5.19.0
15+
- uses: release-drafter/release-drafter@v5.20.0
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

composer.lock

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/client/authentication.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

4753
DHL uses his own authentication header

docs/v3/yarn.lock

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7185,12 +7185,7 @@ minimatch@~3.0.4:
71857185
dependencies:
71867186
brace-expansion "^1.1.7"
71877187

7188-
minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5:
7189-
version "1.2.5"
7190-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
7191-
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
7192-
7193-
minimist@^1.2.6:
7188+
minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6:
71947189
version "1.2.6"
71957190
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
71967191
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

src/SoapClient.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
use Soap\Psr18Transport\Psr18Transport;
3939
use Soap\Psr18Transport\Wsdl\Psr18Loader;
4040
use Soap\Psr18WsseMiddleware\WsaMiddleware;
41+
use Soap\Psr18WsseMiddleware\WsaMiddleware2005;
4142
use Soap\Wsdl\Loader\FlatteningLoader;
4243
use 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, [

tests/Unit/SoapClientTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)