Data Factory > protocol-soap-perform β
TL;DR;
This task allows you to perform SOAP requests.
Name:
Max execution time: 120 mins
Target β
Perform one or more SOAP requests on a web service
Example of use in a job β
- Send products on a SOAP API that accepts one product per call and update a status for each product correctly sent
1. Export Items - Export products selected by the user
2. XSLT Transformation - for the soap task
3. SOAP - Calls soap
4. XLST Transformation - for item status update
5. Import Items - Import of items1
2
3
4
5
2
3
4
5
General notes β
- The result of the task is
COMPLETEDeven if the result of one or more queries are in error. It is theallSuccessoutput that determines if all the requests were successful. - To date, in the case where the web service cannot be contacted, in
REQUESTmode, the result is presented as below
xml
<Soap>
<Soap-Call>
<Request>
<Soap-Message>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</soapenv:Envelope>
</Soap-Message>
</Request>
<Response>
<Error>Unable to contact the web service.</Error>
</Response>
</Soap-Call>
</Soap>1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
- A number of headers are communicated by default at the time of the request to the web service:
- content-type: text/xml
- cache-control: no-cache
- mime-version: 1.0
- Header names are case-insensitive
- Therefore,
content-typeandContent-Typeare strictly equivalent - If
Content-Typeis given by the user, the proposed value will override the default value - If several headers with identical names are given, the last one in order of appearance will be used
- Therefore,
Inputs and Outputs β
Example of defining this task in JSON
json
{
"name": "protocol-soap-perform",
"taskReferenceName": "soap",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"endpoint": "http://",
"useAuthentication": true,
"login": "admin",
"password": "",
"request": "file://assets/request.xml"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Inputs β
TIP
If at least one task parameters (whether mandatory or not) is invalid, task execution is stopped and the returned status is FAILED. For example:
- The proposed value for the
allowPartialproperty is invalid. - The file specified for the
requestproperty does not exist
| Property | Description |
|---|---|
endpoint | Obligatoire - String The entry point of the web service |
useAuthentication | Obligatoire - Booleantrue : Calling the web service requires authentication, in this case login and password are required false: - |
login | String Login, only required if useAuthentication is true |
password | String Password, only required if useAuthentication is true |
mode | Obligatoire - Enum - REQUEST, FILES, FILESREQUEST: requires request parameter FILES requires files parameter FILE requires file parameter |
request | Obligatoire si mode = REQUEST - FileA file |
files | Obligatoire si mode = FILES - Array of File |
file | Obligatoire si mode = FILE - File |
Outputs β
TIP
The outputs of the task defined below are always available if the task completes its execution (status COMPLETED and FAILED). If the task is stopped before the end of its execution (if the task is canceled by the user for example - CANCELED status, or if it exceeds the authorized execution time - TIMED_OUT), the outputs are not available.
| Property | Description |
|---|---|
allSuccess | Enum - YES ou NOIf all request ended up in success : YES, otherwise NOIf no request had to be performed : YES |
file | File Present if the FILE mode is used |
files | Array of File Present if the FILES mode is used |
listing | File Present if the FILE or FILES mode is used |
responses | File Present if the REQUEST mode is used |
Details regarding the request document β
xml
<Soap>
<Soap-Call>
<Request>
<Soap-Message>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
</Soap-Message>
<Headers>
<Header key="customHeader">value</Header>
</Headers>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
</Soap-Call>
</Soap>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| XPath | Description | Occurrence |
|---|---|---|
Soap | Root of the document | 1 |
./Soap-Call | For each call. | 0..* |
../Request | The request element | 1 |
../Request/@path | The path containing path params. | 0..1 |
../Request/Headers | The headers | 0..1 |
.../Headers/Header | A header | 1..* |
.../Headers/Header@key | The name of the header (case-insensitive) | 1 |
.../Soap-Message | The soap message | 1 |
../Metadata | An element that can be used to store information and retrieve them in the responses. | 0..1 |
Regarding the responses output (REQUEST mode) β
xml
<Soap>
<Soap-Call>
<Request>
<Soap-Message>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
</Soap-Message>
<Headers>
<Header key="customHeader">value</Header>
</Headers>
</Request>
<Response>
<Status-Code>200</Status-Code>
<Content>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body xmlns:m="">
</soap:Body>
</soap:Envelope>
</Content>
</Response>
<Metadata>
<key>value</key>
</Metadata>
</Soap-Call>
</Soap>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| XPath | Description | Occurrence |
|---|---|---|
| ./Response | The response for each call. | 1 |
| ../Status-Code | The status code of the response | 1 |
| ../Content | The content of the response | 1 |
Available logs β
| Code | Type | Metadata | Remarks |
|---|---|---|---|
| SOAP_REQUEST_START | info | endpoint, file | Logged once at each soap request. In mode FILE/FILES also once at the beginning of the task. |
| SOAP_REQUEST_SUCCESS | info | endpoint, file, statusCode | Logged after each successful soap request. |
| SOAP_REQUEST_ERROR | error | endpoint, file, statusCode | Logged after each soap request that encountered errors. It sometimes throw an error and stop the worker. |
| SOAP_INVALID_INPUT | error | message | Logged when input is invalid. It throws an error and stops the worker. |
| SOAP_INVALID_XML_INPUT | error | message | Logged when input file in request mode is invalid. It sometimes throws an error and stops the worker. |
| SOAP_TASK_COMPLETE_SUCCESS | info | listing, responses | Logged after task finished, if no error encountered. |
| SOAP_TASK_COMPLETE_ERROR | error | listing, responses | Logged after task finished, if there were errors. |