Compartir a través de


<endpoint> of <client> (Silverlight)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Specifies contract, binding, and address properties of the channel endpoint, which is used by clients to connect to service endpoints on the server.

Syntax

<system.serviceModel>
    <client>
        <endpoint> 
           address="String"
           binding="String"
           bindingConfiguration="String"
           contract="String"
           name="String"
        </endpoint>
    </client>
</system.serviceModel>

Attributes and Elements

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

Attributes

Attribute Description

address

Optional string attribute. Specifies the address of the endpoint. Silverlight version 4 supports the resolution of both absolute and relative addresses, where the resolution of relative endpoint addresses is relative to the location of the application of the XAP file. For more information about the endpoint addresses, see Configuring Web Service Usage in Silverlight Clients

binding

Required string attribute. A string that indicates the type of binding to use. The type must have a registered configuration section to be referenced. The type is registered by section name, instead of by the type name of the binding.

bindingConfiguration

Optional string attribute. A string that contains the name of the binding configuration to be used when the endpoint is instantiated. The default is an empty string.

This attribute is used in conjunction with binding to reference a specific binding configuration in the configuration file. Set this attribute if you are attempting to use a custom binding. Otherwise, an exception can be thrown.

contract

Required string attribute. A string that indicates which contract this endpoint is exposing. The assembly must implement the contract type.

name

Optional string attribute. This attribute uniquely identifies an endpoint for a given contract. The default is an empty string.

Child Elements

None.

Parent Elements

Element Description

<client> (Silverlight)

This element is used to define a list of endpoints to which a client can connect.

Example

The following sample shows how to configure a Silverlight application to communicate with an endpoint configured with a basicHttpBinding and located at myAddress.

<configuration>
    <system.serviceModel>
        <bindings>
           <!-- List of Bindings -->
        </bindings>
        <client>
            <endpoint address="myAddress" 
                      binding="basicHttpBinding" 
                      bindingConfiguration="myBinding" 
                      contract="myContract" />
        </client>
    </system.serviceModel>
</configuration>

See Also

Reference

EndpointAddress