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)

[InterfaceTypeAttribute(1)]
[GuidAttribute("0ED7423C-615C-47EB-931A-8E7D3F45DDCD")]
public interface IVsWCFReferenceContract

NameDescription
System_CAPS_pubmethodGetName()

Returns the contract name from the configuration file.

System_CAPS_pubmethodGetPortTypeName()

Returns the port type name from the Web Services Description Language (WSDL).

System_CAPS_pubmethodGetReferenceEndpointEnumerator()

Returns the collection of endpoints for the Windows Communication Foundation (WCF) service reference.

System_CAPS_pubmethodGetReferenceGroup()

Returns the reference group that contains the contract.

System_CAPS_pubmethodGetTargetNamespace()

Returns the target namespace of the Web Services Description Language (WSDL).

System_CAPS_pubmethodGetTypeName()

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);
        }
            }
}
Return to top
Show: