ajWebServiceSOAP function
Description
The ajWebServiceSOAP function returns data from a SOAP web service on the internet or intranet. The response can span across multiple cells if it is longer than a cell can hold.
Syntax
ajWebServiceSOAP(url As String, [http_method], [body], [user_name], [password], [header], [content_type], [run_condition], [run_by_function_point_only])
Argument Name | Argument Type | Description |
---|---|---|
url (required) | String | The URL of the web service call. |
http_method (optional) | Double | The HTTP method to call the web service. 0 indicates a POST request. 1 indicates a GET request. The default value is 0. |
body (optional) | Range s | The body for HTTP calls from a range of cells. The range of cells can span across multiple rows and columns. All the cells will be concatenated. The default value is an empty string (“”). |
user_name (optional) | String | The username to access the web service call if applicable. The default value is an empty string (“”). |
password (optional) | String | The password of the username to access the web service call if applicable. The default value is an empty string (“”). |
header (optional) | Range | The HTTP header from a range of cells. The first column should contain a header field name. The second column should contain a header field value. The default value is an empty string (“”). |
content_type (optional) | String | The content type of the HTTP request to the web service call. |
run_condition (optional) | Boolean | The function will run when the value is TRUE. Otherwise will not run. The default value is TRUE. |
run_by_function_point_only (optional) | Boolean | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Preview Function Point. If it equals TRUE, the function can be executed with Preview Function Point (AlchemyJ ribbon \ Preview Function Point) only. The default value is TRUE. |
The function will return:
Return Value: HTTP response body
Return Type: Single Value / Multiple values (array formula)
Example
Below is an example of a GET request in Postman.
As you can see from the above example, calling of the ajWebServiceSOAP function is successful and the result returned is the corresponding HTTP response body (same as in Postman).
Click here to download the use case workbooks for further reference.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will raise error for below scenario(s).
Error Scenario |
---|
The API throw error. |
Failed to call the API. |
Invalid http method.s |