You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.mdx
+29-19Lines changed: 29 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -59,21 +59,28 @@ The `call` method returns an instance of `CodeDredd\Soap\Client\Response`, which
59
59
The `CodeDredd\Soap\Client\Response` object also implements the PHP `ArrayAccess` interface, allowing you to access your response data directly on the response:
If you have published the config file then your able to setup a soap client in that configuration. After that it's even easier to initialize the client:
64
+
65
+
$client = Soap::buildClient('your_client_name');
66
+
$response = $client->call(...);
62
67
63
68
<aname="request-data"></a>
64
69
### Request Data
65
70
66
71
Of course, calling a action with arguments is also possible:
@@ -204,7 +214,7 @@ For example, to instruct the SOAP client to return empty, `200` status code resp
204
214
205
215
Alternatively, you may pass an array to the `fake` method. The array's keys should represent ACTION patterns that you wish to fake and their associated responses. The `*` character may be used as a wildcard character. You may use the `response` method to construct stub / fake responses for these endpoints:
206
216
The difference between Laravels HTTP wrapper is the fact that actions which are not defined in fake are also faked with a default 200 response!
207
-
Also a faked response status code is always 200 if you define it int the range between 200 and 400. Status codes 400 and greater are correct faked.
217
+
Also a faked response status code is always 200 if you define it in the range between 200 and 400. Status codes 400 and greater are correct responded.
208
218
209
219
Soap::fake([
210
220
// Stub a JSON response for all Get_ actions...
@@ -238,26 +248,26 @@ Sometimes you may need to specify that a single ACTION should return a series of
238
248
Soap::fake([
239
249
// Stub a series of responses for Get_* actions...
240
250
'Get_*' => Soap::sequence()
241
-
->push('Hello World')
242
-
->push(['foo' => 'bar'])
243
-
->pushStatus(404),
251
+
->push('Hello World')
252
+
->push(['foo' => 'bar'])
253
+
->pushStatus(404)
244
254
]);
245
255
246
256
When all of the responses in a response sequence have been consumed, any further requests will cause the response sequence to throw an exception. If you would like to specify a default response that should be returned when a sequence is empty, you may use the `whenEmpty` method:
247
257
248
258
Soap::fake([
249
-
/ Stub a series of responses for Get_* actions...
259
+
// Stub a series of responses for Get_* actions...
250
260
'Get_*' => Soap::sequence()
251
-
->push('Hello World')
252
-
->push(['foo' => 'bar'])
253
-
->whenEmpty(Soap::response()),
261
+
->push('Hello World')
262
+
->push(['foo' => 'bar'])
263
+
->whenEmpty(Soap::response())
254
264
]);
255
265
256
266
If you would like to fake a sequence of responses but do not need to specify a specific ACTION pattern that should be faked, you may use the `Soap::fakeSequence` method:
0 commit comments