Share via


IVsWCFReferenceContract Interface

Represents a Windows Communication Foundation (WCF) reference contract interface generated by the proxy generator.

Namespace:  Microsoft.VisualStudio.WCFReference.Interop
Assembly:  Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)

Syntax

'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("0ED7423C-615C-47EB-931A-8E7D3F45DDCD")> _
Public Interface IVsWCFReferenceContract
[InterfaceTypeAttribute()]
[GuidAttribute("0ED7423C-615C-47EB-931A-8E7D3F45DDCD")]
public interface IVsWCFReferenceContract
[InterfaceTypeAttribute()]
[GuidAttribute(L"0ED7423C-615C-47EB-931A-8E7D3F45DDCD")]
public interface class IVsWCFReferenceContract
[<InterfaceTypeAttribute()>]
[<GuidAttribute("0ED7423C-615C-47EB-931A-8E7D3F45DDCD")>]
type IVsWCFReferenceContract =  interface end
public interface IVsWCFReferenceContract

The IVsWCFReferenceContract type exposes the following members.

Methods

  Name Description
Public method GetName Returns the contract name from the configuration file.
Public method GetPortTypeName Returns the port type name from the Web Services Description Language (WSDL).
Public method GetReferenceEndpointEnumerator Returns the collection of endpoints for the Windows Communication Foundation (WCF) service reference.
Public method GetReferenceGroup Returns the reference group that contains the contract.
Public method GetTargetNamespace Returns the target namespace of the Web Services Description Language (WSDL).
Public method GetTypeName Returns the full name of the contract Type.

Top

Examples

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);
        }
            }
}

See Also

Reference

Microsoft.VisualStudio.WCFReference.Interop Namespace