Skip to content

Commit 7a5c5a8

Browse files
author
Florian Simon
committed
Added the possibility to use local WSDL files
1 parent 2abd330 commit 7a5c5a8

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ $factory->createClient($url)->then(
9090
);
9191
```
9292

93+
#### createClientFromWsdl($wsdlContents)
94+
95+
Same as createClient(), but leaves you the responsibility to load the WSDL file. This allows you to use local WSDL files, for instance.
96+
9397
### Client
9498

9599
The `Client` class is responsible for communication with the remote SOAP

src/Factory.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ public function __construct(LoopInterface $loop, Browser $browser = null)
2222

2323
public function createClient($wsdl)
2424
{
25-
$browser = $this->browser;
26-
27-
return $this->browser->get($wsdl)->then(function (Response $response) use ($browser) {
28-
$url = 'data://text/plain;base64,' . base64_encode((string)$response->getBody());
25+
$that = $this;
2926

30-
return new Client($url, $browser);
27+
return $this->browser->get($wsdl)->then(function (Response $response) use ($that) {
28+
return $that->createClientFromWsdl($response->getBody());
3129
});
3230
}
31+
32+
public function createClientFromWsdl($wsdlContents)
33+
{
34+
$browser = $this->browser;
35+
$url = 'data://text/plain;base64,' . base64_encode((string)$wsdlContents);
36+
37+
return new Client($url, $browser);
38+
}
3339
}

0 commit comments

Comments
 (0)