Set Up a Web Service
Before you can call a web service from a One-Step Action, you must first set up a web service. When you set up a web service, you define the following:
- General properties for the web service: Name, description, URL, Service Type (REST or WSDL), and Security Type (Basic or None).
- Web service Method: Define one or more Methods (and parameters) that will be available from the web service.
Note: WSDL Methods can be generated by parsing the WSDL definition, if available, and generally do not need to be modified.
- Web Service Account: User ID and password required to call the web service (only required when Basic Security is required).
Note: The ability to set up a web service requires security rights.
To set up a web service:
- Select a scope and subfolder (if needed) for the Web service.
- Click the Create New button .
The Web Service Options window opens, displaying two pages (General and Methods; Accounts appears later if you select to use Basic Security).
- Click the General page.
- Define general properties for the web service:
- Name: Provide a display name to use within CSM (this property can be searched in CSM Item Managers). It does not have to match the web service, although it is wise to do so.
- Description: Provide a description to use within CSM (this property can be searched in CSM Item Managers).
- URL: Provide the URL for the web service (ex: http://test.com/webservice/).
- Define the Service Type, either:
- REST: You must then manually define the Methods (and parameters) available from the web service (see below).
- WSDL (SOAP 1.1 or SOAP 1.2): Many WSDL web services expose a "WSDL file" from which CSM can automatically generate the Methods and parameters that will be available from the web service. To parse the items, provide the full path to the WSDL file in the WSDL URL field (ex: http://www.test.com/service.asmx?WSDL), and then click the Parse WSDL button when it becomes enabled. If the web service does not expose a "WSDL file," then you will need to manually define the Methods (and parameters) to call (see below).
- Define the Security Type, either:
- Basic: If Basic is selected, the Accounts page appears to define the Web Service Account information.
- Define web service call options:
- Click the Methods page.
- Define a Web Service Method:
- Click the Add button to add a Method.
The Web Service Method window opens.
- Define general properties for the Method:
- Name: Provide a name for the Method.
- Description: Provide a description for the Method.
- (Optional) Endpoint: Provide the additional URL path for the Method. Some services have an additional endpoint in the URL to access the Method. For example, if the full path to an addition Method is http://test.com/webservice/addNumbers, the base URL of the service is http://test.com/webservice/ and the endpoint would be addNumbers.
- Result Type: Select the data type to use when saving the results:
- Text (Default).
- Request Type: Select a verb that determines the way a web service is called.
Note: For most WSDL web services, the Method should be set to POST. For most REST web services, the Method should be set to GET. Only override these defaults if indicated by the web service’s documentation.
- Add the Parameters:
Note: Most Methods require one or more parameters to be passed to the Web Service Method. For example, addNumbers would likely require passing two numbers that would be added together.
- Click the Add button.
The Web Service Parameter window opens.
- Name: Provide a name for the parameter.
- Data Type: Select the data type for the parameter (Date/Time, Logical, Number, or Text).
Note: With the WDSL (SOAP 1.1 or SOAP 1.2) Service Type, you can pass a text parameter that contains XML representing the full SOAP message. The full SOAP message will be included in the web service log if the logging level is set to Debug (refer to Configure Logging for a CSM Server or Web Application for more information).
- Header Parameter: Select this check box if the parameter is a header element. This adds the parameter value to the message header rather than the body content. Typically, the header parameter is named SOAPAction.
- Is SOAP Content: Select this check box if the parameter contains an XML value that includes all of the values (the entire SOAP content) that would otherwise be specified in individual parameters.
Note: This check box is only displayed if WSDL (SOAP 1.1 or SOAP 1.2) is the selected web service method.
- Click OK.
- Click the Accounts page.
Note: The page is only displayed if Basic is selected as the web service Security Type.
- Define one or more Web Service Accounts:
Note: The Web Service Account is used when a web service simply requires a User ID and password to be passed with the web service call. You can define multiple accounts (ex: A basic account and an administrative account) and select the appropriate account when you define a Call a Web Service Action for a One-Step.
- Click the Add button.
The Web Service Account window opens.
- Name: Provide a name for the Web Service Account.
- Description: Provide a description for the Web Service Account.
- User ID: Provide the username for the Web Service Account
- Password: Provide and confirm the password for the Web Service Account.
- Click OK.
- Click OK.