The DCS ServiceModelConfig Utility
The ServiceModelConfig utility enables you to configure the operations and policies for a service. The operation and policy information is stored in the ServiceConfiguration database. You should run the ServiceModelConfig utility after the ServiceModelReg utility. For more information about the ServiceModelReg utility, see The DCS ServiceModelReg Utility.
Note
The ServiceModelConfig utility is located in ServiceModelConfig folder in the DCS Business Logic Visual Studio Extensions folder under the DCS installation folder.
ServiceModelConfig Arguments
The ServiceModelConfig utility requires several arguments. The following table summarizes these arguments.
Argument |
Description |
---|---|
-Url |
The logical URL of the service. It should match the URL of the Web application that you created to host the service. |
-Assembly |
The assembly containing the service to configure. |
-interface |
The service interface that you are registering operations for. |
-add |
If this parameter is present, the utility adds a policy to the service. It is paired with the –action parameter to specify the operations to add the policy to. |
-force |
If a policy being added already exists, this parameter forces the addition of the new policy. It is used with the –add parameter.. |
-remove |
If this parameter is present, the utility removes a policy from the service. It is paired with the –action parameter to specify the operation to remove the policy from. |
-list |
This parameter causes the utility to return a list of all policies for a service with a specified Url. It is used with the –Url parameter. |
-action |
This parameter indicates the soap action to associate with the policy. If you use the wildcard asterisk (*), this indicates that the policy should be associated with all operations. |
-context |
If this parameter is present, the utility removes the context policy that relates to an operation. It requires the –action parameter. |
-log |
If this parameter is present, the utility removes the logging policy that relates to an operation. It requires the –action parameter. |
-security |
If this parameter is present, the utility removes the security policy that relates to an operation. It requires the –action parameter. |
-Mtom |
If this parameter is present, the utility specifies that an operation should use the Mtom protocol. |
-Protection |
If this parameter is present, the utility adds or removes a protection policy from an operation. The value of the parameter must be None, Sign, or EncryptAndSign. It requires the –action parameter, and either the –add or –remove parameter. |
-cache |
If this parameter is present, the utility removes the caching policy that relates to an operation. You must also specify the caching key. It requires the –action parameter. |
Example Usage
The following command line sample extracts the operations defined in the specified service assembly and stores the operations and any related policies in the ServiceConfiguration database.
ServiceModelConfig -url:"https://servername/servicelocation/service.svc" -assembly:"ServiceNamespace.ServiceName.dll" –interface:"ServiceNamespace.IServiceName"
The following command line sample adds the context and caching policy to Operation1 of the service indicated by the –url parameter.
ServiceModelConfig -url:"https://servername/servicelocation/service.svc" –add –action:"Operation1" –context -caching
The following command line sample adds the context policy to all operations in the service indicated by the –url parameter.
ServiceModelConfig -url:"https://servername/servicelocation/service.svc" –add –action:* -context
The following command line sample removes the context policy from Operation2 for the service indicated by the –url parameter
ServiceModelConfig -url:"https://servername/servicelocation/service.svc" –remove –action:"Operation2" -context
The following command line sample returns a list of policies implemented by the service indicated by the –url parameter
ServiceModelConfig -url:"https://servername/servicelocation/service.svc" –list