Call Web Service Activity

Use the Call Web Service activity to create and send an HTTP request to call a remote service such as an API call.

Best Practice

The Call Web Service activity requires an object as an input parameter. Always use a Custom Script activity as a previous step in the workflow of your automation: it will define the options input parameter of the Call Web Service activity.

Use Case Example

In this example of a basic use case you use the Call Web Service activity to retrieve a session token from a server.

  1. In your automation, on the right-hand side panel, go to the Controls section. Drag and drop Custom Script in your workflow.

  2. Select Custom script and click Edit Script. A code editor and the step details side panel appear, where you can set the input and output parameters of your custom script.

  3. Here you define two input parameters: clientInfo and uaaUrl.

    In the script the Return defines:
    • The method: GET in this example, to retrieve a token

    • An URL: composed of the input parameter uaaUrl concatenated with a path

    • A response type: json here

    • A key word: resolveBodyOnly set to true

    • Headers: parameters that you set, here Authorization:Basic and the input parameter clientInfo

  4. Drag and drop the Call Web Service activity: the activity uses as an input parameter optionsGet.

    This optionsGet parameter retrieves the content of the Return previously defined in the custom script:
    • The call uses a GET method (to retrieve the token)

    • The web service, in this example a server, is accessed via the URL (parameter uaaURL + predefined path)

    • The response type json means that the expected token is of type JSON

    • Etc.

  5. Select the output parameter of the Call Web Service activity: here resToken is the token retrieved within the server session.

Sample Examples

Call with parameters:
Call with maximum header size:

This option allows you to override the value in the maxHeaderSize property. For more information, see the Node.jsInformation published on non-SAP site documentation.

Call with authorization:
Call to upload with metadata:
Call to upload with body:
Call with WinCa certificate:
Call with Cookie value:
Call with body: