IVsWCFReferenceContract Interface
Visual Studio 2015
Represents a Windows Communication Foundation (WCF) reference contract interface generated by the proxy generator.
Assembly: Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)
| Name | Description | |
|---|---|---|
![]() | GetName() | Returns the contract name from the configuration file. |
![]() | GetPortTypeName() | Returns the port type name from the Web Services Description Language (WSDL). |
![]() | GetReferenceEndpointEnumerator() | Returns the collection of endpoints for the Windows Communication Foundation (WCF) service reference. |
![]() | GetReferenceGroup() | Returns the reference group that contains the contract. |
![]() | GetTargetNamespace() | Returns the target namespace of the Web Services Description Language (WSDL). |
![]() | GetTypeName() | Returns the full name of the contract Type. |
The following example demonstrates how to implement the IVsWCFReferenceContract interface.
/// Populates the values to a grid with the initial values of all
/// the endpoints selected.
private void PopulateGrid(IVsWCFReferenceGroup referenceGroup)
{
if (referenceGroup == null)
{
throw new ArgumentNullException("referenceGroup");
}
IEnumWCFReferenceContracts contractsEnum =
referenceGroup.GetContractsEnumerator();
foreach (IVsWCFReferenceContract contract in contractsEnum)
{
string contractName = contract.GetPortTypeName();
string contractNamespace = contract.GetTargetNamespace();
IEnumWCFReferenceEndpoints endpointsEnum =
contract.GetReferenceEndpointEnumerator();
foreach (IVsWCFReferenceEndpoint endpoint in endpointsEnum)
{
endpointsDataGridView.Rows.Add(true, endpoint.GetName(),
contractNamespace, contractName);
}
}
}
Show:
