Skip to content

Commit e219a39

Browse files
Add RequestTask doc
1 parent 7e98456 commit e219a39

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ CleverAge\SoapProcessBundle\CleverAgeSoapProcessBundle::class => ['all' => true]
2222
## Reference
2323

2424
- Tasks
25-
- [RequestTask]
25+
- [RequestTask](reference/tasks/request_task.md)
2626
- Transformers
2727
- [RequestTransformer]

docs/reference/tasks/request_task.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
RequestTask
2+
===============
3+
4+
Call a SOAP Request and get result.
5+
6+
Task reference
7+
--------------
8+
9+
* **Client Service Interface**: `CleverAge\SoapProcessBundle\Client\ClientInterface`
10+
* **Task Service**: `CleverAge\SoapProcessBundle\Task\RequestTask`
11+
12+
Accepted inputs
13+
---------------
14+
15+
`array`: list of of the arguments to pass as `$args` to the [SoapClient::__soapCall()](https://www.php.net/manual/en/soapclient.soapcall.php) method.
16+
17+
Possible outputs
18+
----------------
19+
20+
`false|stdClass|array`: the result of the soap call.
21+
22+
Options
23+
-------
24+
25+
### For Client
26+
27+
| Code | Type | Required | Default | Description |
28+
|-----------------|------------------|:---------:|---------|-------------------------------------------------------------------------------|
29+
| `code` | `string` | **X** | | Service identifier, used by Task client option |
30+
| `wsdl` | `string or null` | | | URI of a WSDL file describing the service |
31+
| `options` | `array` | | [] | An associative array specifying additional options for the SOAP client. |
32+
| `options.trace` | `boolean` | | true | Captures request and response information. Add debug informations into logger |
33+
34+
Calls setter methods in `CleverAge\SoapProcessBundle\Client\ClientInterface` to add more options.
35+
36+
### For Task
37+
38+
| Code | Type | Required | Default | Description |
39+
|-------------------------------|-----------------------------------------------|:----------------------------------------:|---------|---------------------------------------------------------------------|
40+
| `client` | `string` | **X** | | `ClientInterface` service identifier |
41+
| `method` | `string` | **X** | | The name of the SOAP function to call. |
42+
| `soap_call_options` | `array or null` | | null | An associative array of options to pass to the client. |
43+
| `soap_call_headers` | `array or null` resolved as \SoapHeader array | | null | An array of headers to be sent along with the SOAP request. |
44+
| `soap_call_headers.namespace` | `array or null` | **X** if `soap_call_headers` is not null | | The namespace of the SOAP header element. |
45+
| `soap_call_headers.data` | `array or null` | **X** if `soap_call_headers` is not null | | A SOAP header's content. It can be a PHP value or a SoapVar object. |
46+
47+
Examples
48+
--------
49+
50+
### Client
51+
52+
```yaml
53+
services:
54+
app.cleverage_soap_process.client.domain_sample:
55+
class: CleverAge\SoapProcessBundle\Client\Client
56+
bind:
57+
$code: 'domain_sample'
58+
$wsdl: 'https://domain/sample.wsdl'
59+
$options:
60+
trace: true
61+
exceptions: true
62+
calls:
63+
- [ setSoapOptions, [ { features: SOAP_SINGLE_ELEMENT_ARRAYS} ] ]
64+
tags:
65+
- { name: cleverage.soap.client }
66+
```
67+
68+
### Task
69+
70+
```yaml
71+
# Task configuration level
72+
code:
73+
service: '@CleverAge\SoapProcessBundle\Task\RequestTask'
74+
options:
75+
client: domain_sample
76+
method: 'MethodToCall'
77+
```

0 commit comments

Comments
 (0)