--- title: "Set up web service action - Outbound" slug: "set-up-web-service-action-outbound" description: "Learn how to set up outbound web service actions in D365 F&SCM to integrate with external applications, including defining messages and attributes." tags: ["Task topic"] status: "update" updated: 2026-09-22T13:18:59Z published: 2026-09-22T13:18:59Z canonical: "docs.staedean.com/set-up-web-service-action-outbound" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Set up web service action - Outbound You can use an outbound web service action to request data from an external application and to process the response in D365 F&SCM, via an external web service. For each outbound web service action, you can define these messages: | Message | Description | | --- | --- | | Request message | The request message provides the web service with data from D365 F&SCM. | | Response message | The response message processes the response from the web service in D365 F&SCM. | | Error message | The error message processes the error from the web service in D365 F&SCM. | > [!NOTE] > **Note** Only D365 F&SCM can trigger an outbound web service action. When triggered, the outbound web service action automatically runs the defined messages. ## Attributes You can use attributes to add extra information to the web service URL or HTTP request. ### Attribute type The attribute type indicates how the attribute value is defined. You can use these types: | Attribute type | Description | | --- | --- | | Value | The attribute is a fixed value. Enter the fixed value in the **Value or Custom** field. | | Document field | The attribute value is derived from a field of the source document of the request message. Fill in the **Document field** field. | | Record field | The attribute value is derived from a field of a selected record. Usually, this type is used to get records. Only use this type if you start the web service with a menu item from a specific page. Fill in these fields: **Record table** and **Record** field. **Example:** You start the web service from the Sales orders page. You can use the attribute to get all sales orders for the customer of the selected sales order. In this case, you fill in the CustTable and ID. | | Custom | You can enter a static method that defines the range. The static method is applied to the source document of the request message. | | Secret | You can enter a secret reference to be used as attribute. The secret reference refers to a centrally stored secret which makes updating secrets easier. So, the secret value is not visible on the Web service action page. You only see the secret reference. Fill in the **Secret reference** field. | ### Attribute style The attribute styles define how the attribute is applied to the request. You can use these attribute styles: | Attribute style | Description | | --- | --- | | Header | Sends a custom header with an HTTP request. The attribute is added to the header of the HTTP request. | | Query | Most common attribute type. It applies to the whole request. It is added to the URL after the question mark (?) after the resource name. **Example:** https://myserver.com/resource?attr1=Your Value&attr2=Your Value | | Template | Parameterizes the resource path, adding a placeholder for a variable value. **Example:** https://myserver.com/resource/{attr3} | | Matrix | Applies to a specific resource path element. The attribute is added to the URL, between the resource or the template attribute and the QUERY attributes. The attribute is separated from the resource or the template attribute with a semicolon (;). **Example:** https://myserver.com/resource/{attr3};;attr4=Your Value?attr1=Your Value | | Plain | Excludes the attribute from the HTTP request. For example, for testing purposes. | | Body key pair | Usually, for an outbound web service, the body contains the content. In some cases, for example for Dataverse, the body contains more data than only the content. The data is split in a list of, so called, key pairs. In this case, the content is stored in a key pair, instead of in the body. For each of the key pairs to be added to the request body, add an attribute to the outbound web service action. To use key pairs in your body, use these settings: - Content type: application/x-www-form-urlencoded - Attribute type: Value - Attribute style: Body key pair - Attribute value: [Body]; only for the attribute that contains the request content. **Note:** You only can apply this setup if the target document of the request message is of type **JSON**. | ## Steps 1. Click **Connectivity** **studio - Integration Design**. 2. Click the **Web service** tab. 3. Click **New**. 4. In the **Web service action** field, type the unique name of the web service action. 5. In the **Project** field, enter or select a value. 6. Define the goal of the outbound web service: In the **HTTP action** field, select an option. > [!NOTE] > **Note** > > If the **HTTP action** is '**Post or put**', you must set up an attribute of type **Document** **field** or **Record** **field** with the **Key** check box selected. This key attribute is used to determine if, in the external application, the record already exists and must be updated, or if the record does not yet exist and must be created. - **Post**: Create records in the external application. - **Put**: Update records in the external application. - **Get**: Get data from the external application. - **Patch**: Update only a part of records in the external application. - **Delete**: Delete records from the external application. - **Post or put**: Create or update records in the external application. 7. Sub-task: Set web service properties. 1. Expand the **Properties** section. 2. Define the direction of the web service action. In the **Acts as** field, select '**Outbound**'. 3. Define the access type of the web service: In the **Web service type** field, select an option. - **Basic**: You can use this option if the web service access type is SOAP (Simple Object Access Protocol). - **REST**: Use this option is the web service access type is REST (Representational State Transfer). 4. Define the content type of the web service. For example, application/json, text/xml, or text/plain. The content type is added to the web service header. In the **Content type** field, type a value. 5. Sometimes, a sent web request cannot be received by the web service. You can indicate the number of times to retry getting a web request received by the web service. A retry is only done in case of one of these errors: In the **Maximum retries** field, enter a number. - **429**: A response status code that indicates that the web service has surpassed its rate limit, or number of requests they can receive in a given period of time. - **503**: A response status code that indicates that the web service is temporarily unavailable. 6. Sometimes, a sent web request cannot be received by the web service. If you have defined the number of times to retry getting a web request received by the web service, also define the number of seconds between the retries. In the **Delay operation with** field, enter a number. 7. Define the request message for the web service action. The goal of the request message depends on the HTTP action of the web service action. In general, the request message provides the web service with data from D365 F&SCM. In the **Request message** field, enter or select a value. > [!NOTE] > **Note** > > If the **HTTP action** is **Get**, the request message is optional. 8. Define the response message for the web service action. The goal of the response message depends on the HTTP action of the web service action. In general, the response message processes the response from the web service in D365 F&SCM. In the **Response message** field, enter or select a value. > [!NOTE] > **Note** > > Only if the **HTTP action** is **Get**, it is mandatory to define a response message. 9. You can define an error message for the web service action. The error message processes errors that you receive from the web service in D365 F&SCM. In the **Error message** field, enter or select a value. 10. Enter the name of the applicable resource in the external web service. The resource name is added to the URL for this web service action. In the **Resource** field, type a value. > [!NOTE] > **Note:** > > - Click **Save** to see the result in the URL preview field below. > - If environment-type-specific attributes are applicable, the URL preview includes the attributes that apply to the environment type as selected in the **Environment types** field at the right-top of the **Web service action** page. > - The base URL is defined in the web service application setup of the related project. 8. Sub-task: Set up attributes. 1. You can use attributes to add extra information to the web service URL or HTTP request. Expand the **Attributes section**. 2. You can export connectivity setup and import it in another D365 F&SCM environment. For example, you first set up and test the connectivity setup in a development environment. When finished, you deploy the setup in your production environment. To prevent messing up your production data, use different file locations for your development or testing environment and for your production environment. To strictly distinguish between different environments, you can define unique web service action attributes for each of your environment types. So, each web service action can have a different set of attributes for each applicable environment type. Which web service action attributes are applicable to the current environment is defined in the **Environment type** field on the **Connectivity studio parameters**. For example, if set to **Development**, the web service action attributes, as defined for environment type **Development** are applicable. In the **Environment types** field (at the right-top of the **Web service action** page), select an option. > [!NOTE] > Note > > - Environment-type-specific attributes are only applicable if the **Web service attributes per environment type** parameter in the **Connectivity studio parameters** is set to **Yes**. If set to **No**, the environment-type-related fields and button are not available. > - The default environment type is the one selected in the **Environment type** field on the **Connectivity studio parameters**. > - You can select another environment type to show the related attributes. 3. Click **New**. > [!NOTE] > Note > > If environment-type-specific attributes are applicable, you can copy the attributes from the currently shown environment type to another environment type. To do so, in the **Attributes** section, click **Copy attributes**. On the dialog select the environment type to which the attributes must be copied, and click **OK**. 4. If environment-type-specific attributes are applicable, define the environment type to which the attribute applies. In the **Environment types** field (in the **Attributes** section), select an option. > [!NOTE] > Note > > The default environment type is derived from the one selected in the **Environment types** field at the right-top of the **Web service action** page. 5. You can enter the sequence number of the attribute in the list of attributes. This can be important if the Web service type is **REST**. In the **Line number** field, enter a number. > [!NOTE] > **Note** > > - You can also change the sequence with the **Move up** and **Move down** buttons. This has an impact on the URL (see URL preview). > - If environment-type-specific attributes are applicable, you define the attribute sequence per environment type. So, changing the attribute sequence only applies to the environment type as selected in the **Environment types** field at the right-top of the **Web service action** page. 6. Enter a meaningful name for the attribute. In the **Name** field, type a value. 7. Use the attribute type to indicate how the attribute value is defined. You can use these types: In the **Type** field, select an option. > [!NOTE] > **Note** For more information on the attribute types, refer to the topic introduction. - **Value**: The attribute is a fixed value. - **Document** **field**: The attribute value is derived from a field of the source document of the request message. - **Record** **field**: The attribute value is derived from a field of a selected record. - **Custom**: You can enter a static method that defines the range. - **Secret**: You can enter a secret reference to be used as attribute. 8. If the type is: In the **Value or Custom** field, type a value. > [!NOTE] > **Note** This field is only available if the type is **Value** or **Custom**. - **Value**, enter the attribute value. - **Custom**, enter a static method to define the range. For example, you can use the SysQueryRangeUtil class to apply advanced date queries. Other examples are: 'curExt()' (gets the current company), 'strFmt("%1..%2", prevMth(today()), today())' (gets the orders from the last month), and 'DateTimeUtil::utcNow()' (filters on the current date/time). 9. Enter the field of the source document of the request message from which attribute value is derived. In the **Document** **field** field, enter or select a value. > [!NOTE] > **Note** > > This field is only available if the type is **Document** **field**. 10. Enter the table from which you want to select the field from which the attribute value is derived. In the **Record** **table** field, enter or select a value. > [!NOTE] > **Note** > > **This** field is only available if the type is **Record** **field**. 11. Enter the field from which the attribute value is derived. In the **Record** **field** field, enter or select a value. > [!NOTE] > **Note** > > This field is only available if the type is **Record** **field**. 12. Enter a secret reference to be used as attribute. The secret reference refers to a centrally stored secret which makes updating secrets easier. In the **Secret reference** field, enter or select a value. > [!NOTE] > **Note** > > This field is only available if the type is **Secret**. 13. You can use attributes to set varying parts of the HTTP request. In the **Style** field, select an option. > [!NOTE] > **Note** > > - Usually, the external web service administrator can provide you with the required attributes and attribute styles. > - For more information on the attribute styles, refer to the topic introduction. - **Header**: Sends a custom header with an HTTP request. The attribute is added to the header of the HTTP request. - **Query**: Most common attribute type. It applies to the whole request. - **Template**: Parameterizes the resource path, adding a placeholder for a variable value. - **Matrix**: Applies to a specific resource path element. The attribute is added to the URL, between the resource or the template attribute and the QUERY attributes. - **Plain**: Excludes the attribute from the HTTP request. - **Body key** pair: The attribute is added as a key pair to the request body. 14. If the HTTP action is '**Post or put**', you must set up an attribute of type **Document** **field** or **Record** **field** with the **Key** check box selected. This key attribute is used to determine if, in the external application, the record already exists and must be updated, or if the record does not yet exist and must be created. Select the **Key** check box. > [!NOTE] > **Note** > > This field is only available if the **HTTP action** is '**Post or put**', and if the type is **Document** **field** or **Record** **field**. 15. If the attribute type is **Document** **field** or **Record** **field**, you can indicate if the value of the defined document field or record field is linked to an external ID or revision number. So, for the document field or record field value, an external ID must exist in the application of the source connector of the request message. In the **External ID** field, select an option. > [!NOTE] > **Note** > > If the attribute type is **Document** **field** or **Record** **field**, and the **External ID** field is not available, click **Save** to make it available. 16. Most attributes result in a change of the syntax of the resource URL. However, sometimes a different syntax is required for an attribute. You can define the custom attribute syntax in this field. For the: **Example:** A standard template attribute syntax is ../{'attribute name'}. When run, the variable {'attribute name'} is replaced by the attribute value. This results in, for example: ../1234. For example, for OData, when requesting customer information, another syntax is required: ../account({attribute value}). In the **Custom URL part** field enter /account(%2). This results in, for example: ../account(1234). In the **Custom URL part** field, type a value. - Attribute name use %1. - Attribute value use %2. 9. Sub-task: Set custom handler, class, and action menu item. 1. Expand the **Custom** section. 2. For an outbound web service action, the standard handler classes are: In the **Handler** field, enter or select a value. - **BisWsClientHandler**: Runs the outbound web service action. For the request message, the target connector must be of type Windows folder. For the Response message and error message, the source connector must be of type Windows folder. - **BisWsClientHandlerV3**: Runs the outbound web service action, using streaming. For the request message, the target connector must be of type Web service. For the response message and error message, the source connector must be of type **Web service**. You can use a customized handler class. To do so, extend a standard handler class. 3. To actually run the web service HTTP request, a separate class is used. If your HTTP request works differently compared to the standard HTTP request, you can create your own HTTP class. Make sure, it implements the same interface with the same methods as exist in the HttpRequest class. The standard client HTTP classes are: In the **Client HTTP class** field, enter or select a value. - **BisWsClientHttpFileRequest**: Calls the external web service if files are used to exchange data. The result of the handler class is the input for the web service call. This class also handles the response from the web service. This response is the input for the handler class to process the response in D365 F&SCM. - **BisWsClientHttpRequest**: Calls the external web service if streaming used to exchange data. The result of the handler class is the input for the web service call. This class also handles the response from the web service. This response is the input for the handler class to process the response in D365 F&SCM. 4. You can use a custom action menu item to manually start an outbound web service action. To make this work: As a result, for a selected record, you can manually run the web service action from the form to which you added the action menu item. In the **Action menu item name** field, enter or select a value. **Example:** On the Sales orders form, you can select a record and click the action menu item button. This starts a web service action to post a sales order. The web service action is processed, and the selected sales order is posted. - Create the custom menu item. The action menu item must be of type class and must be linked to the '**BisWsCmdActionRunWebservice**' class. To avoid best practice warnings, in the menu item setup, define the permissions for the roles who can use the action menu item. As the action menu item is not linked to a RunBase class, you cannot run it in batch. - Add the action menu item to the form from where you want to start the web service action. For example, the Sales orders form to post a sales order. - Enter the name of the action menu item for the desired web service action in the **Action menu item name** field. For example, a web service action to post a sales order. 10. Sub-task: Set history settings. 1. Expand the **History** section. 2. You can create a report in Microsoft Excel format that contains the errors that occurred during a web service action run. You can, for example, use this to inform the sender of data on the errors. The report is created when the web service action run is finished. The report is stored in the folder as defined in the **Connectivity studio parameters**, in the **History report path** field. Select **Yes** in the **Create history report** field. 11. In the **Secret reference** field, enter or select a value. 12. Close the page. > [!NOTE] > Note > > The file extension for web service outbound files is defined by the target document of the applicable message. ## Related - [Customize web service action handler class](/customize-web-service-action-handler-class.md) - [Troubleshooting web services](/troubleshooting-web-services.md) - [Set up secret references](/set-up-secret-references.md) - [Outbound web service process](/outbound-web-service-process.md)