ComContractElement.ExposedMethods Propriedade

Definição

Obtém uma coleção de métodos COM+ que são expostos quando a interface em um componente COM+ é exposta como um serviço Web.Gets a collection of COM+ methods that are exposed when the interface on a COM+ component is exposed as a Web service.

public:
 property System::ServiceModel::Configuration::ComMethodElementCollection ^ ExposedMethods { System::ServiceModel::Configuration::ComMethodElementCollection ^ get(); };
[System.Configuration.ConfigurationProperty("exposedMethods", Options=System.Configuration.ConfigurationPropertyOptions.None)]
public System.ServiceModel.Configuration.ComMethodElementCollection ExposedMethods { get; }
[<System.Configuration.ConfigurationProperty("exposedMethods", Options=System.Configuration.ConfigurationPropertyOptions.None)>]
member this.ExposedMethods : System.ServiceModel.Configuration.ComMethodElementCollection
Public ReadOnly Property ExposedMethods As ComMethodElementCollection

Valor da propriedade

ComMethodElementCollection

A coleção de métodos COM+ que são expostos quando a interface em um componente COM+ é exposta como um serviço Web.The collection of COM+ methods that are exposed when the interface on a COM+ component is exposed as a Web service.

Atributos

Comentários

A ferramenta de configuração de integração COM+ (ComSvcConfig.exe) pode ser usada para adicionar métodos específicos de uma interface COM para aparecer no contrato de serviço gerado.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.

Por exemplo, você pode usar o comando a seguir para adicionar os três métodos nomeados da IFinances interface com no ItemOrders.Financial componente, ao contrato de serviço gerado.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  

Quando você executa a ferramenta de ComSvcConfig.exe, ela gera o seguinte contrato de serviço listando os métodos mencionados anteriormente como exposedMethod elementos.When you run the ComSvcConfig.exe tool, it then generates the following service contract listing the previously mentioned methods as exposedMethod elements.

<comContracts>
  <comContract contract="{5163B1E7-F0CF-4B6A-9A02-4AB654F34284}"                     												   																						   
  namespace="http://tempuri.org/5163B1E7-F0CF-4B6A-9A02-4AB654F34284"													   																						   
  name="_Broker" requiresSession="true">
    <userDefinedTypes>
      <userDefinedType name="CustomerType"																	   																						   
         typeLibID="{91DC728C-4F1A-45de-A9B6-B538E209CEA6}"															   																						   
         typeLibVersion="1.0"																		   																						   
         typeDefID="{D129765C-F211-434e-825A-9A63198C41F2}" />          
      <userDefinedType name="AddressType"																	   																						   
         typeLibID="{91DC728C-4F1A-45de-A9B6-B538E209CEA6}"															   																						   
         typeLibVersion="1.0"																		   																						   
         typeDefID="{4616AE0D-687A-43B7-BC63-141AE3DFD099}" />          
    </userDefinedTypes>
    <exposedMethods>
      <add exposedMethod ="BuyStock" />
      <add exposedMethod ="SellStock" />
      <add exposedMethod ="ExecuteTransaction" />
    </exposedMethods>
  </comContract>
</comContracts>

No momento da inicialização do serviço, o tempo de execução tenta gerar um contrato de serviço refletindo e adicionando apenas os métodos incluídos na lista de exposedMethod elementos.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. Um rastreamento é produzido para cada método de interface que não está incluído no contrato de serviço.A trace is produced for every interface method that is not included on the service contract.

Aplica-se a