| ClientBaseTChannel Class |
Namespace: System.ServiceModel
public abstract class ClientBase<TChannel> where TChannel : class
The ClientBaseTChannel type exposes the following members.
| Name | Description | |
|---|---|---|
| ClientBaseTChannel | Initializes a new instance of the ClientBaseTChannel class using the default target endpoint from the application configuration file. | |
| ClientBaseTChannel(String) | Initializes a new instance of the ClientBaseTChannel class using the configuration information specified in the application configuration file by endpointConfigurationName. | |
| ClientBaseTChannel(Binding, EndpointAddress) | Initializes a new instance of the ClientBaseTChannel class using the specified binding and target address. | |
| ClientBaseTChannel(String, EndpointAddress) | Initializes a new instance of the ClientBaseTChannel class using the specified target address and endpoint information. | |
| ClientBaseTChannel(String, String) | Initializes a new instance of the ClientBaseTChannel class. |
| Name | Description | |
|---|---|---|
| Equals(Object) | (Inherited from Object.) | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
| Channel |
Gets the inner channel used to send messages to variously configured service
endpoints.
|
//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;
//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);