Define a Call a Web Service Action for a One-Step
Use the Call a Web Service One-Step Action to dynamically call a web service and save the results as a variable. For example, call a web service that calculates currency, then use the results in a Field. The results can be saved as a variable in one of the following data types: number, string, or Boolean.
Note: Currently, CSM supports REST and WSDL-based web services using either no authentication or Basic authentication.
Good to know:
- Web Service: A web service is a web Application Programming Interface (API) that is accessed via HTTP/HTTPS.
- A web service will have one or more Methods.
- A Method is a call where you specify some Action to take place. You pass in zero or more parameters and optionally get a result back from the Method (ex: A calculator web service might have several Methods: multiply, divide, add, subtract, etc.).
- A parameter is a value you send to a Method (ex: A login Method might require one parameter for the username and one parameter for the password).
- WSDL: WSDL (Web Service Description Language) is an XML-based language for describing Web Services and how to access them. Network services are described as a set of endpoints operating on messages. WSDL Methods are generated by parsing the WSDL and should not be modified.
- REST: REST (Representational State Transfer) is an approach used to allow simple point-to-point communication over HTTP.
- Before you can call a web service from a One-Step, you must set up the web service using the Web Service Manager, which can either be accessed from CSM Administrator (Browser and Mobile>Web Service Manager), or directly from the Call a Web Service Action in a One-Step.
- Security rights: Using and configuring web services requires security rights.
- If you cannot run, add, edit, or delete the Call a Web Service Action in One-Steps, check your One-Step functionality security rights (CSM Administrator>Security>Edit Security Groups>"Security Group">Rights tab>One-Step).
- If you cannot call a web service, or view, add, edit, or delete web services using the Web Service Manager, check your Web Services security rights (CSM Administrator>Security>Edit Security Groups>"Security Group">Rights tab>Web Services category).
To define a Call a Web Service Action:
- Create a One-Step.
- On the General page in the One-Step window (accessed from within the One-Step Manager), click Add, and then select Call a Web Service.
The Web Service window opens.
- Define general properties for the Call a Web Service Action:
- Specify the Method to call on the web service:
- Method: In the drop-down, select a Web Service Method.
The Parameters tree on the left displays all the parameters for the selected Web Service Method.
- Define a value for each parameter. You have two options:
- Blank: Select this radio button to not set a value for the parameter. This might or might not be valid for different web services. If a required parameter is not provided, the web service will likely generate an error.
- Set Value: Select this radio button to manually set the Method value. Then, provide text, clicking the Selector button to open the Token tree and insert Fields, System Functions, and Stored Values directly into the text.
- (Optional) Define how results will be stored:
Note: This is not required; however, in most cases, you want to store the result so that you can do something with it (ex: Pop-up results, edit a Business Object, etc.). There are some cases where you might not save the result (ex: Where posting data to the web service might not return anything; for example, Send a Tweet).
- Click OK.