Share via


<exposedMethod>

Represents a COM+ method that is exposed when the interface on a COM+ component is exposed as a Web service.

Schema Hierarchy

<system.serviceModel>
  <comContracts>
    <comContract>
      <exposedMethods>

Syntax

<comContracts>
  <comContract>
      <exposedMethods>
         <exposedMethod name="string" />
      </exposedMethods>
  </comContract>
</comContracts>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

name

A string that contains the COM+ method that is exposed when the interface on a COM+ component is exposed as a Web service.

Child Elements

None.

Parent Elements

Element Description

<exposedMethods>

A collection of <exposedMethod> elements.

Remarks

The COM+ integration configuration tool (ComSvcConfig.exe) can be used to add specific methods from a COM interface to appear on the generated service contract.

For example, you can use the following command to add the three named methods from the IFinances COM interface on the ItemOrders.Financial component, to the generated service contract.

ComSvcConfig.exe /i /application:OnlineStore /contract:ItemOrders.Financial,IFinances.{TransferFunds,AddFunds,RemoveFunds} /hosting:complus

When you also run the ComSvcConfig.exe, it then generates the following service contract listing the previously mentioned methods as <exposedMethod> elements.

<comContract contractType="{C551FBA9-E3AA-4272-8C2A-84BD8D290AC7}" name="IFinances" namespace="https://contoso.com/services/financial">
    <exposedMethod name="TransferFunds"/>
    <exposedMethod name="AddFunds"/>
    <exposedMethod name="RemoveFunds"/>
</comContract>

At service initialization time, the runtime attempts to generate a service contract by reflecting over and adding only the methods included in the list of <exposedMethod> elements. A trace is produced for every interface method that is not included on the service contract.

See Also

Reference

ComMethodElementCollection
ComMethodElement

Concepts

<comContracts>

Other Resources

Integrating with COM+ Applications
How to: Configure COM+ Service Settings


© 2007 Microsoft Corporation. All rights reserved.
Last Published: 2010-01-05