<system.serviceModel> (Silverlight)

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

The system.serviceModel configuration section contains all of the elements used to configure a Silverlight application to communicate with a Web service.

Syntax

<system.serviceModel>
    <bindings>
    </bindings>
    <client>
    </client>
</system.serviceModel>

Attributes and Elements

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

Attributes

None.

Child Elements

Element Description

<bindings> (Silverlight)

Required. This element holds a collection of standard and custom bindings. Each entry is identified by its unique name. Clients use bindings by linking to them using their name.

<client> (Silverlight)

Required. This element contains a list of endpoints that a client uses to connect to a service.

Parent Elements

Element Description

<configuration>

Required. The root element for all configuration elements in a .NET Framework configuration file.

Remarks

Silverlight does not add elements to the configuration sections of other products.

Silverlight clients are defined in the client section of the configuration file. The client exposes zero or more endpoints defined in an endpoint element. Each endpoint must specify a binding and contract and can indicate, optionally, an address or bindingConfiguration.

The binding attribute indicates the section in which the binding is defined. The bindingConfiguration attribute defines which configured binding within the binding section is used. A binding section can define several configured bindings.

Example

The following code sample shows how to configure the bindings and client for a Silverlight application.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
           <!-- List of Bindings -->
        </bindings>
        <client>
           <!-- List of Endpoints -->
        </client>
    </system.serviceModel>
</configuration>