Overview of policy metadata
Web Services for Microsoft Dynamics GP requires a policy object for each service method that creates, updates, or deletes a business document. When adding a service for a new type of document, you must add policy metadata for the create, update, and delete operations of the service. For more information about how policies are used, see Policy. Policy metadata includes the following components:
Policies A policy is a collection of configured behaviors that can control important characteristics of the create, update, and delete operations of a service.
Behaviors A behavior is a single, configurable characteristic of a policy. A policy can include one or more behaviors. A policy is not required to have behaviors.
Behavior options A behavior option represents the configuration options that are available for a behavior. Each behavior option represents a configuration choice the service administrator can select.
Parameters A parameter stores the configuration information entered by the service administrator. Behavior options use parameters to enable customization of the behavior.
To add policy metadata, you need to create a "policy helper" application. The "policy helper" application adds policy metadata to the Dynamics GP Service. You must run the "policy helper" application when you install your your service. When your "policy helper" application installs policy metadata, you must first add the metadata for the behaviors and then add the metadata for the policies.
You also use the "policy helper" application to remove policy metadata when you uninstall your service. To remove policy metadata, use the "policy helper" application to first remove the metadata for the policies and then remove the metadata for the behaviors.
The service administrator uses the Dynamics Security Console to view and configure policies for services. When you add policy, you must create a .NET assembly that contains the text and messages that the Dynamics Security Console displays for your policy.
The "policy helper" application you create will require the same configuration parameters that were used to install policy metadata for the Dynamics GP Service. To supply the required parameters, create an application configuration file that your "policy helper" application can use to retrieve configuration information.
This section of the documentation describes how to add policy metadata for a service. To implement the configuration options that a policy supports, you will need to add XSLT for each policy behavior. For more information about how to use XSLT to implement a policy, see Creating XSLT for the Create operation.