|
| 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 | +* **Blocking task** |
| 12 | + |
| 13 | +Accepted inputs |
| 14 | +--------------- |
| 15 | + |
| 16 | +`array`: list of of the arguments to pass as `$args` to the [SoapClient::__soapCall()](https://www.php.net/manual/en/soapclient.soapcall.php) method. |
| 17 | + |
| 18 | +Possible outputs |
| 19 | +---------------- |
| 20 | + |
| 21 | +`false|stdClass|array`: the result of the soap call. |
| 22 | + |
| 23 | +Options |
| 24 | +------- |
| 25 | + |
| 26 | +### For Client |
| 27 | + |
| 28 | +| Code | Type | Required | Default | Description | |
| 29 | +|-----------------|------------------|:---------:|---------|-------------------------------------------------------------------------------| |
| 30 | +| `code` | `string` | **X** | | Service identifier, used by Task client option | |
| 31 | +| `wsdl` | `string or null` | | | URI of a WSDL file describing the service | |
| 32 | +| `options` | `array` | | [] | An associative array specifying additional options for the SOAP client. | |
| 33 | +| `options.trace` | `boolean` | | true | Captures request and response information. Add debug informations into logger | |
| 34 | + |
| 35 | +Calls setter methods in `CleverAge\SoapProcessBundle\Client\ClientInterface` to add more options. |
| 36 | + |
| 37 | +### For Task |
| 38 | + |
| 39 | +| Code | Type | Required | Default | Description | |
| 40 | +|-------------------------------|-----------------------------------------------|:----------------------------------------:|---------|---------------------------------------------------------------------| |
| 41 | +| `client` | `string` | **X** | | `ClientInterface` service identifier | |
| 42 | +| `method` | `string` | **X** | | The name of the SOAP function to call. | |
| 43 | +| `soap_call_options` | `array or null` | | null | An associative array of options to pass to the client. | |
| 44 | +| `soap_call_headers` | `array or null` resolved as \SoapHeader array | | null | An array of headers to be sent along with the SOAP request. | |
| 45 | +| `soap_call_headers.namespace` | `array or null` | **X** if `soap_call_headers` is not null | | The namespace of the SOAP header element. | |
| 46 | +| `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. | |
| 47 | + |
| 48 | +Examples |
| 49 | +-------- |
| 50 | + |
| 51 | +### Client |
| 52 | + |
| 53 | +```yaml |
| 54 | +services: |
| 55 | + app.cleverage_soap_process.client.domain_sample: |
| 56 | + class: CleverAge\SoapProcessBundle\Client\Client |
| 57 | + bind: |
| 58 | + $code: 'domain_sample' |
| 59 | + $wsdl: 'https://domain/sample.wsdl' |
| 60 | + $options: |
| 61 | + trace: true |
| 62 | + exceptions: true |
| 63 | + calls: |
| 64 | + - [ setSoapOptions, [ { features: SOAP_SINGLE_ELEMENT_ARRAYS} ] ] |
| 65 | + tags: |
| 66 | + - { name: cleverage.soap.client } |
| 67 | +``` |
| 68 | +
|
| 69 | +### Task |
| 70 | +
|
| 71 | +```yaml |
| 72 | +clever_age_process: |
| 73 | + configurations: |
| 74 | + project_prefix.request_example: |
| 75 | + tasks: |
| 76 | + constant_output_example: |
| 77 | + service: '@CleverAge\SoapProcessBundle\Task\RequestTask' |
| 78 | + options: |
| 79 | + client: domain_sample |
| 80 | + method: 'MethodToCall' |
| 81 | + outputs: [ debug ] |
| 82 | + debug: |
| 83 | + service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask' |
| 84 | +``` |
0 commit comments