Show / Hide Table of Contents

Class CSHTML5_ClientBase<TChannel>

Provides the base implementation used to create Windows Communication Foundation (WCF) client objects that can call services.

Inheritance
System.Object
CSHTML5_ClientBase<TChannel>
CSHTML5_DuplexClientBase<TChannel>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.ServiceModel
Assembly: OpenSilver.dll
Syntax
public abstract class CSHTML5_ClientBase<TChannel>
    where TChannel : class
Type Parameters
Name Description
TChannel

The channel to be used to connect to the service.

Examples

Here is an example on how you can use a WebService to receive data:

//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:

//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);

Constructors

| Improve this Doc View Source

CSHTML5_ClientBase()

Initializes a new instance of the System.ServiceModel.ClientBase`1 class using the default target endpoint from the application configuration file.

Declaration
protected CSHTML5_ClientBase()
Exceptions
Type Condition
System.InvalidOperationException

Either there is no default endpoint information in the configuration file, more than one endpoint in the file, or no configuration file.

| Improve this Doc View Source

CSHTML5_ClientBase(Binding, EndpointAddress)

Initializes a new instance of the System.ServiceModel.ClientBase`1 class using the specified binding and target address.

Declaration
protected CSHTML5_ClientBase(Binding binding, EndpointAddress remoteAddress)
Parameters
Type Name Description
System.ServiceModel.Channels.Binding binding

The binding with which to make calls to the service.

System.ServiceModel.EndpointAddress remoteAddress

The address of the service endpoint.

Exceptions
Type Condition
System.ArgumentNullException

The binding is null.

System.ArgumentNullException

The remote address is null.

| Improve this Doc View Source

CSHTML5_ClientBase(String)

Initializes a new instance of the System.ServiceModel.ClientBase`1 class using the configuration information specified in the application configuration file by endpointConfigurationName.

Declaration
protected CSHTML5_ClientBase(string endpointConfigurationName)
Parameters
Type Name Description
System.String endpointConfigurationName

The name of the endpoint in the application configuration file.

Exceptions
Type Condition
System.ArgumentNullException

The specified endpoint information is null.

System.InvalidOperationException

The endpoint cannot be found or the endpoint contract is not valid.

| Improve this Doc View Source

CSHTML5_ClientBase(String, EndpointAddress)

Initializes a new instance of the System.ServiceModel.ClientBase`1 class using the specified target address and endpoint information.

Declaration
protected CSHTML5_ClientBase(string endpointConfigurationName, EndpointAddress remoteAddress)
Parameters
Type Name Description
System.String endpointConfigurationName

The name of the endpoint in the application configuration file.

System.ServiceModel.EndpointAddress remoteAddress

The address of the service.

Exceptions
Type Condition
System.ArgumentNullException

The endpoint is null.

System.ArgumentNullException

The remote address is null.

System.InvalidOperationException

The endpoint cannot be found or the endpoint contract is not valid.

| Improve this Doc View Source

CSHTML5_ClientBase(String, String)

Initializes a new instance of the System.ServiceModel.ClientBase`1 class.

Declaration
protected CSHTML5_ClientBase(string endpointConfigurationName, string remoteAddress)
Parameters
Type Name Description
System.String endpointConfigurationName

The name of the endpoint in the application configuration file.

System.String remoteAddress

The address of the service.

Exceptions
Type Condition
System.ArgumentNullException

The endpoint is null.

System.ArgumentNullException

The remote address is null.

System.InvalidOperationException

The endpoint cannot be found or the endpoint contract is not valid.

Properties

| Improve this Doc View Source

Channel

Declaration
public TChannel Channel { get; }
Property Value
Type Description
TChannel
| Improve this Doc View Source

ClientCredentials

Declaration
public ClientCredentials ClientCredentials { get; }
Property Value
Type Description
System.ServiceModel.Description.ClientCredentials
| Improve this Doc View Source

Endpoint

Declaration
public ServiceEndpoint Endpoint { get; }
Property Value
Type Description
System.ServiceModel.Description.ServiceEndpoint
| Improve this Doc View Source

InnerChannel

Gets the underlying System.ServiceModel.IClientChannel implementation.

Declaration
[NotImplemented]
public IClientChannel InnerChannel { get; }
Property Value
Type Description
System.ServiceModel.IClientChannel
| Improve this Doc View Source

INTERNAL_RemoteAddressAsString

Declaration
public string INTERNAL_RemoteAddressAsString { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

State

Declaration
[NotImplemented]
public CommunicationState State { get; }
Property Value
Type Description
System.ServiceModel.CommunicationState

Methods

| Improve this Doc View Source

Abort()

Declaration
[NotImplemented]
public void Abort()
| Improve this Doc View Source

CreateChannel()

Declaration
[NotImplemented]
protected virtual TChannel CreateChannel()
Returns
Type Description
TChannel
| Improve this Doc View Source

GetDefaultValueForInitialization<T>()

Declaration
[NotImplemented]
protected T GetDefaultValueForInitialization<T>()
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

InvokeAsync(CSHTML5_ClientBase<TChannel>.BeginOperationDelegate, Object[], CSHTML5_ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object)

Provides support for implementing the event-based asynchronous pattern.

Declaration
protected void InvokeAsync(CSHTML5_ClientBase<TChannel>.BeginOperationDelegate beginOperationDelegate, object[] inValues, CSHTML5_ClientBase<TChannel>.EndOperationDelegate endOperationDelegate, SendOrPostCallback operationCompletedCallback, object userState)
Parameters
Type Name Description
CSHTML5_ClientBase.BeginOperationDelegate<> beginOperationDelegate

A delegate that is used for calling the asynchronous operation.

System.Object[] inValues

The input values to the asynchronous call.

CSHTML5_ClientBase.EndOperationDelegate<> endOperationDelegate

A delegate that is used to end the asynchronous call after it has completed.

System.Threading.SendOrPostCallback operationCompletedCallback

A client-supplied callback that is invoked when the asynchronous method is complete. The callback is passed to the BeginOperationDelegate.

System.Object userState

The userState object to associate with the asynchronous call.

  • Improve this Doc
  • View Source