Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Once you have selected an appropriate hosting mode, use the COM+ Service Model Configuration command-line tool (ComSvcConfig.exe) to configure the application interfaces that will be exposed as Web services.
Note
You must be an administrator on the machine to perform any of the following tasks.
When using ComSvcConfig.exe on a Windows 7 machine to configure a web service to use the latest service model version (currently v4.5), perform the following steps:
Set the registry key
[HKEY_LOCAL_COMPUTER\SOFTWARE\Microsoft\.NETFramework]\OnlyUseLatestCLRto a DWORD value of 0x00000001Run comsvcconfig.exe
Revert the registry key added in step 1 back to its original value, or delete it if did not exist.
Important
Reverting this registry key is important. This is a compatibility key. Not reverting this change may cause issues with other .NET applications running on the machine).
Warning
When using ComSvcConfig.exe /install on a Windows 8 machine, a dialog is displayed stating "An app on your PC needs the following Windows feature: .NET Framework 3.5 (includes .NET 2.0 and .NET 3.0" if .NET Framework 3.5 is not installed. This dialog may be ignored. Alternatively you can sed the OnlyUseLatestCLR registry key to a DWORD value of 0x00000001
Add an interface using the COM+ hosting mode
Run ComSvcConfig using the
/installand/hosting:complusoptions, as shown in the following example.ComSvcConfig.exe /install /application:OnlineStore /contract:ItemOrders.Financial,IFinances /hosting:complus /verboseThe command adds the
IFinancesinterface of theItemOrders.IFinancialcomponent (from the OnlineStore COM+ application) to the set of interfaces that will be exposed as Web services. The service uses the COM+ hosting mode and therefore requires explicit application activation.While the wildcard asterisk (*) character can be used for the component and the interface, avoid using it because you might want to expose only selected functionality as a Web service. If run with a future version of this component, using the wildcard may unintentionally expose interfaces that may not have been present when the configuration syntax was determined.
The /verbose option instructs the tool to display warnings in addition to any errors.
The contract for the exposed service will contain all of the methods from the
IFinancesinterface.
Add specific methods from an interface using the COM+ hosting mode
Run ComSvcConfig using the
/installand/hosting:complusoptions with explicit naming of the required methods, as shown in the following example.ComSvcConfig.exe /install /application:OnlineStore /contract:ItemOrders.Financial,IFinances.{Credit,Debit} /hosting:complus /verboseThe command adds only the
CreditandDebitmethods from theIFinancesinterface as operations to the exposed service contract. All other methods on the interface will be omitted from the contract and will not be callable from Web service clients.
Add an interface using the Web hosting mode
Run ComSvcConfig using the
/installoption and the/hosting:wasoption, as shown in the following example.ComSvcConfig.exe /install /application:OnlineWarehouse /contract:ItemInventory.Warehouse,IStockLevels /hosting:was /webDirectory:root/OnlineWarehouse /mex /verboseThe command adds the
IStockLevelsinterface on theItemInventory.Warehousecomponent (from the OnlineWarehouse COM+ application) to the set of interfaces that will be exposed as Web services. The service is Web hosted in the OnlineWarehouse virtual directory of IIS rather than in COM+, and thus the application is automatically activated as required.To use the Web-hosted in-process configuration, the COM+ application must be configured to run as a Library application rather than a Server application using the Component Services administration console. Applications configured as Server applications use the standard Web-hosted mode and incur a process hop to process each request.
The
/mexoption adds an additional Metadata Exchange (MEX) service endpoint that uses the same transport as the application's service endpoint to support clients that want to retrieve a contract definition from the service.
Remove a Web service for a specified interface
Run ComSvcConfig using the
/uninstalloption, as shown in the following example.ComSvcConfig.exe /uninstall /application:OnlineStore /contract:ItemOrders.Financial,IFinances /hosting:complusThe command removes the
IFinancesinterface on theItemOrders.Financialcomponent (from the OnlineStore COM+ application).
List currently exposed interfaces
Run ComSvcConfig using the
/listoption, as shown in the following example.ComSvcConfig.exe /listThe command lists the currently exposed interfaces, along with the corresponding address and binding details, scoped to the local machine.
List specific currently exposed interfaces
Run ComSvcConfig using the
/listoption, as shown in the following example.ComSvcConfig.exe /list /application:OnlineStore /hosting:complusThe command lists currently exposed COM+-hosted interfaces, along with the corresponding address and binding details, for the OnlineStore COM+ application on the local machine.
Display help for options
Run ComSvcConfig using the /? option, as shown in the following example.
ComSvcConfig.exe /?