How To: Consume the Service Management Service
This topic describes the steps to consume the Service Management Service. See Service Management Service for conceptual details about the service.
Open the root Web.config file in any editor. You can find this file in the %WINDIR%\Microsoft.NET\<Framework or Framework64>\v4.0.xxxxx\Config folder.
Search for the keyword: ServiceManagementBehavior in the configuration file.
Modify the service behavior definition to enable publishing service metadata over HTTP as shown in the following example.
<behavior name="ServiceManagementBehavior"> <serviceMetadata httpGetEnabled="true" /> </behavior>
Save the Web.config file. You will receive an error message if you do not have write permission to the configuration file. Update the access control list (ACL) on the file and then try to save it again.
Right-click your client project, and then click Add Service Reference.
Type https://localhost/<application name>/ServiceManagement.svc for the address and click Go.
Click OK to close the Add Service Reference dialog box.
Add code similar to the following code to invoke the Service Management Service to activate a service in your application.
ServiceManagementClient clnt = new ServiceManagementClient(); ActivationRequest request = new ActivationRequest(); request.VirtualPath = "https://localhost/MyWFServiceApp/MyWFService.xamlx"; clnt.ActivateService(request);
2012-09-12