Invoke Apex Operations Page

Specify the following values on the Salesforce invoke Apex Operations page.

If you selected Invoke Apex Web Services on the Action page, the following options are displayed. Select the operation to perform in the Salesforce.com application:

Apex SOAP

Apex SOAP provides support for consumption of SOAP endpoints exposed through Apex in the Salesforce Adapter.

Element Description
Select the Apex WSDL Click Choose File to select the Apex WSDL to use.

Operations in Uploaded WSDL

Displays the list of operations included in the uploaded Apex WSDL. Select the operation to perform in the Salesforce Cloud application.

Select New Apex WSDL Click Choose File to select the Apex WSDL to use. This selection replaces any previously uploaded WSDL file. After selecting the new WSDL, return to the Operations in Uploaded WSDL list and select the new operation to use.

You can use an Apex WSDL that includes Apex classes written on force.com and exposed as SOAP web services. See Exposing Apex Methods as SOAP Web Services.

Apex REST

Apex REST provides support for consumption of REST endpoints exposed through Apex in the Salesforce Adapter.

Note:

Configure the OAuth-based security policies for your Salesforce Adapter connection if you need to use the Apex REST operation. This is because the Apex REST operation is not supported when you configure the Username Password security policy for your Salesforce Adapter connection.
Element Description

What is the endpoint's relative resource URI?

Specify the relative path associated with the resource. The path can contain template parameters specified with curly braces (for example, {order-id}). A resource is any source of specific information that can be addressed. The resource path follows a fixed, prefixed URL appended with the specified relative path. By default, the URL is prefixed with the following path:
https://yourInstance.salesforce.com/services/apexrest/

What action do you want to perform on the endpoint?

Select a single HTTP action (method) for the endpoint to perform:
  • GET: Retrieves (reads) information (for example, makes queries). If you select this option, you cannot configure a request payload for this endpoint.
  • PUT: Updates information.
  • POST: Creates information.
  • DELETE: Deletes information. If you select this option, you cannot configure a request payload for this endpoint.
  • PATCH: Partially updates existing resources (for example, when you only need to update one attribute of the resource).

Select any options that you want to configure Based on your selections, you can add parameters or configure a request and/or response for this endpoint.
  • Add and review parameters for this endpoint: Click to specify the query parameters and view the template request parameters created as part of the resource URI for this endpoint. If you select this option, the Query and Template Parameters page is displayed.
  • Configure a request payload for this endpoint: Click to configure the request payload for this endpoint, including specifying the JSON sample location. If you select this option, the Sample Request Payload page is displayed.

    Note: Only PUT and POST actions support this (Configure a request payload for this endpoint) option. Therefore, this option is displayed when you select the PUT or POST action.

  • Configure this endpoint to receive the response: Click to configure the response payload for this endpoint, including specifying the JSON sample location. If you select this option, the Sample Response Payload page is displayed.

Query and Template Parameters Page

If you select Add and review parameters for this endpoint option on the Apex Operations Page, the following options are displayed.

Element Description

Specify Query Parameters

Specify query parameters for the REST endpoint.

Click the Add icon to display a row for entering the parameter name and selecting its data type. For example, specify state and select a data type of string.

Click the Delete icon to delete a selected row.

Template Parameters

Displays the template parameters in the relative resource URI. Template parameters are based on details you specified on the Basic Info page and cannot be edited.

Template parameters must be defined as part of a path with curly braces around them. For example, the URL default/customers/{cust-id}/{ship-id} has cust-id and ship-id template parameters.

You can change the data type for the parameters.

Invoke Sample Request Payload Page

If you select Configure a request payload for this endpoint on the Apex Operations page, the following options are displayed.

Note:

The Configure a request payload for this endpoint option is visible only if the PUT or POST action is selected on the Apex Operations page.
Element Description
Select the request payload format Select the request payload format to use.
  • JSON: Upload a JSON file containing a sample request payload or copy and paste the JSON payload into the text field.
  • Binary: Use with payloads that are unstructured and inline (for example, application/octet-stream). This option preserves the file contents, but requires the receiver to determine the file type (for example, from the file name extension). The internet media type for an arbitrary byte stream is application/octet-stream. A list of commonly-used types is shown in a dropdown list. You can select a type from this list or provide a type not listed by selecting Other Media Type and entering the type in the text field.

Note: Ensure that the sample JSON is representative of the actual runtime messages exchanged with the endpoint. A mismatch in the structure or type of runtime messages can result in errors.

Location of Sample Payload Specify the sample JSON request payload file in either of the following ways:
  • Click Choose File to select the sample JSON request payload to use.
  • Click <<inline>> to copy and paste the JSON payload. Click Generate Element when complete.
Element Select the element that defines the payload structure. This field is not displayed until you import the request payload file.
Select the type of payload with which you want the endpoint to send

(If the Binary payload format is selected.)

Select from a list of commonly-used types provided in the dropdown menu. You can also select Other Media Type to provide a type not listed in the dropdown list (for example, video/mp4).

Invoke Sample Response Payload Page

If you select Configure this endpoint to receive the response on the Apex Operations page, the following options are displayed.

Element Description

Select the response payload format

The response payload can only be JSON.
  • Upload a JSON file containing a sample response payload.
  • Copy and paste the JSON payload.

Note: Ensure that the sample JSON is representative of the actual runtime messages exchanged with the endpoint. A mismatch in the structure or type of runtime messages can result in errors.

Location of Sample Payload

Specify the sample JSON response payload file in either of the following ways:
  • Click Choose File to select the sample JSON response payload to use.
  • Click <<inline>> to copy and paste the JSON payload. Click Generate Element when complete.
Element Select the element that defines the payload structure. This field is not displayed until you import the response payload file.