Set up web service application for project
|
Application Consultant
|
For an outbound web service, a connection must be established with an external web service. To connect to the external web service, for the applicable project, set up the web service application. The web service application defines the base URL for the related web service actions. If required, you can also set up the user authentication to get access to the external web service. |
Set up web service action - Outbound
|
Application Consultant
|
You can use an outbound web service action to request data from an external application and to process the response in D365 FO, 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 FO. |
Response message |
The response message processes the response from the web service in D365 FO. |
Error message |
The error message processes the error from the web service in D365 FO. |
Note: Only D365 FO 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.
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. |
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. |
|
Set up data synchronization for outbound web service action
|
Application Consultant
|
On export of data with an outbound web service action, the data synchronization setup defines which records are processed.
Data synchronization only applies to the request message of the outbound web service action.
Note: The request message also can have data synchronization set up. This setup is overruled by the outbound web service data synchronization setup.
You can use these types of data synchronization:
Type |
Description |
All |
This is the standard data synchronization. All records that are found, based on the source document setup, are exported. No data synchronization setup is required for this. |
Table events |
You can use table events to log data changes. You can define, for each record, which table events are logged. The table events are logged in the Data synchronization log. From here, the logged entries must be processed further to the Outbound message queue. Process the outbound message queue to run the messages to export the records. |
Date range |
You can use a date range to export only the records that are changed or added since the latest outbound web service action run. |
|