DCS Context

A client application uses a DCS context object to specify the business environment in which the application tries to call a DCS service. A client application populates the context object with scope information that can help identify the preferred service instance that it needs to connect to, and then sends it as part of the request message to a service. When a client application first connects to a service, the Discovery Service uses the scope information in the context object to find the most appropriate service instance for the client application to use.

A context object can also contain environmental information about the client application, such as the culture of the client application, the user running the client application, and the current date and time. DCS provides a default implementation of the Context class. However, if you need different fields or functionality, you can build your own customized version. For more information, see Building a Custom Context Class.

The context information is added to the header of request messages sent by the client application. The code that is generated by the Business Logic Visual Studio Extensions when you implement an operation makes the context information available to the service. You can then implement your own business logic to examine the context object and perform the appropriate processing for your organization. If you have defined a task filter, the Activator component of the DCS runtime uses the context object to determine which implementation of a task should run.

See Also

DCS Scopes

Building a Custom Context Class.