Click or drag to resize
ClientBaseTChannel Class
Provides the base implementation used to create Windows Communication Foundation (WCF) client objects that can call services.
Inheritance Hierarchy
SystemObject
  System.ServiceModelClientBaseTChannel

Namespace: System.ServiceModel
Assemblies:  CSharpXamlForHtml5 (in CSharpXamlForHtml5.dll) Version: 1.0.0.0
  CSharpXamlForHtml5.ToBeReplacedAtRuntime.System.ServiceModel.dll (in CSharpXamlForHtml5.ToBeReplacedAtRuntime.System.ServiceModel.dll.dll) Version: 1.0.0.0
Syntax
C#
public abstract class ClientBase<TChannel>
where TChannel : class

Type Parameters

TChannel
The channel to be used to connect to the service.

The ClientBaseTChannel type exposes the following members.

Constructors
  NameDescription
Protected methodClientBaseTChannel
Initializes a new instance of the ClientBaseTChannel class using the default target endpoint from the application configuration file.
Protected methodClientBaseTChannel(String)
Initializes a new instance of the ClientBaseTChannel class using the configuration information specified in the application configuration file by endpointConfigurationName.
Protected methodClientBaseTChannel(Binding, EndpointAddress)
Initializes a new instance of the ClientBaseTChannel class using the specified binding and target address.
Protected methodClientBaseTChannel(String, EndpointAddress)
Initializes a new instance of the ClientBaseTChannel class using the specified target address and endpoint information.
Protected methodClientBaseTChannel(String, String)
Initializes a new instance of the ClientBaseTChannel class.
Top
Methods
  NameDescription
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Protected propertyChannel
Gets the inner channel used to send messages to variously configured service endpoints.
Top
Examples
Here is an example on how you can use a WebService to receive data:
C#
//We create a new instance of the ServiceClient
MyServiceClient soapClient =
    new MyServiceClient(
        new BasicHttpBinding(),
        new EndpointAddress(
            new Uri("http://MyServiceAddress.com/MyService.svc")));

//We call the method that will give us the data we want:
var result = await soapClient.GetToDosAsync(_ownerId);
//We get the data from the response:
ToDoItem[] todos = result.Body.GetToDosResult;
Here is another example that shows how you can send data to a WebService:
C#
//We create an item to send to the WebService:
ToDoItem todo = new ToDoItem()
{
    Description = MyTextBox.Text,
    Id = Guid.NewGuid(),
};

//We create a new instance of the ServiceClient
MyServiceClient soapClient =
    new MyServiceClient(
        new BasicHttpBinding(),
        new EndpointAddress(
            new Uri("http://MyServiceAddress.com/MyService.svc")));

//We send the data by calling a method implemented for that purpose in the WebService:
await soapClient.AddOrUpdateToDoAsync(todo);
See Also