ChannelFactory<TChannel> コンストラクター

定義

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

オーバーロード

ChannelFactory<TChannel>()

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(Binding)

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(ServiceEndpoint)

指定したエンドポイント アドレスを持つチャネルを作成する ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(String)

指定したエンドポイントの構成名を使用して、ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(Type)

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(Binding, EndpointAddress)

指定したバインドとエンドポイント アドレスを使用して、ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(Binding, String)

指定したバインドとリモート アドレスを使用して、ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>(String, EndpointAddress)

指定したエンドポイントの名前とリモート アドレスに関連付けられた ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

ChannelFactory<TChannel>()

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory();
public ChannelFactory ();
Public Sub New ()

この例では、ChannelFactory<TChannel> クラスの新しいオブジェクトを IRequestChannel インターフェイスで作成する方法を示します。

EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint", address);

適用対象

ChannelFactory<TChannel>(Binding)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory(System::ServiceModel::Channels::Binding ^ binding);
public ChannelFactory (System.ServiceModel.Channels.Binding binding);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Channels.Binding -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (binding As Binding)

パラメーター

binding
Binding

ファクトリにより作成されるチャネルのために指定する Binding

注釈

このコンストラクターは、バインド情報を、アプリケーション構成ファイルを使用するのではなく、プログラムで渡す場合に使用します。

適用対象

ChannelFactory<TChannel>(ServiceEndpoint)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

指定したエンドポイント アドレスを持つチャネルを作成する ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory(System::ServiceModel::Description::ServiceEndpoint ^ endpoint);
public ChannelFactory (System.ServiceModel.Description.ServiceEndpoint endpoint);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Description.ServiceEndpoint -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (endpoint As ServiceEndpoint)

パラメーター

endpoint
ServiceEndpoint

ファクトリにより作成されるチャネルの ServiceEndpoint

例外

endpointnull です。

ContractDescription contract = new ContractDescription("MyContract");
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
BasicHttpBinding binding = new BasicHttpBinding();
ServiceEndpoint endpoint = new ServiceEndpoint(contract, binding, address);

ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(endpoint);

注釈

このコンストラクターは、サービス エンドポイント情報を、アプリケーション構成ファイルを使用するのではなく、プログラムで渡す場合に使用します。

適用対象

ChannelFactory<TChannel>(String)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

指定したエンドポイントの構成名を使用して、ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory(System::String ^ endpointConfigurationName);
public ChannelFactory (string endpointConfigurationName);
new System.ServiceModel.ChannelFactory<'Channel> : string -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (endpointConfigurationName As String)

パラメーター

endpointConfigurationName
String

エンドポイントで使用される構成名。

例外

endpointConfigurationNamenullです。

ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint");

注釈

アプリケーション構成ファイル内で複数のターゲット エンドポイントが存在する場合にこのコンストラクターを使用します。

適用対象

ChannelFactory<TChannel>(Type)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

protected:
 ChannelFactory(Type ^ channelType);
protected ChannelFactory (Type channelType);
new System.ServiceModel.ChannelFactory<'Channel> : Type -> System.ServiceModel.ChannelFactory<'Channel>
Protected Sub New (channelType As Type)

パラメーター

channelType
Type

チャネル ファクトリにより作成される Type のチャネル。

例外

channelTypenull です。

channelType がクラスまたは値型であり、インターフェイスではありません。

注釈

このコンストラクターは、チャネルの種類情報を、アプリケーション構成ファイルを使用するのではなく、プログラムで渡す場合に使用します。 channelType パラメーターは、インターフェイスである必要があります。

適用対象

ChannelFactory<TChannel>(Binding, EndpointAddress)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

指定したバインドとエンドポイント アドレスを使用して、ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ remoteAddress);
public ChannelFactory (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (binding As Binding, remoteAddress As EndpointAddress)

パラメーター

binding
Binding

エンドポイントの構成で使用される Binding

remoteAddress
EndpointAddress

サービスの場所を提供する EndpointAddress

例外

bindingnull です。

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, address);

注釈

このコンストラクターは、バインディングとアドレスの情報を、アプリケーション構成ファイルを使用するのではなく、プログラムで渡す場合に使用します。

適用対象

ChannelFactory<TChannel>(Binding, String)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

指定したバインドとリモート アドレスを使用して、ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory(System::ServiceModel::Channels::Binding ^ binding, System::String ^ remoteAddress);
public ChannelFactory (System.ServiceModel.Channels.Binding binding, string remoteAddress);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Channels.Binding * string -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (binding As Binding, remoteAddress As String)

パラメーター

binding
Binding

エンドポイントの構成で使用される Binding

remoteAddress
String

サービスの場所を提供するアドレス。

例外

remoteAddressnullです。

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
Uri via = new Uri("http://localhost:8000/Via");

ChannelFactory<IRequestChannel> factory =
    new ChannelFactory<IRequestChannel>(binding, "http://fsHost/fs/endp");

IRequestChannel channel = factory.CreateChannel(address, via);
channel.Open();
Message request = Message.CreateMessage(MessageVersion.Soap11, "hello");
Message reply = channel.Request(request);
Console.Out.WriteLine(reply.Headers.Action);
reply.Close();
channel.Close();
factory.Close();

注釈

このコンストラクターは、リモート アドレス情報に関する情報を、型指定されたオブジェクトではなく、文字列で渡す場合に使用します。

適用対象

ChannelFactory<TChannel>(String, EndpointAddress)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

指定したエンドポイントの名前とリモート アドレスに関連付けられた ChannelFactory<TChannel> クラスの新しいインスタンスを初期化します。

public:
 ChannelFactory(System::String ^ endpointConfigurationName, System::ServiceModel::EndpointAddress ^ remoteAddress);
public ChannelFactory (string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress);
new System.ServiceModel.ChannelFactory<'Channel> : string * System.ServiceModel.EndpointAddress -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (endpointConfigurationName As String, remoteAddress As EndpointAddress)

パラメーター

endpointConfigurationName
String

エンドポイントで使用される構成名。

remoteAddress
EndpointAddress

サービスの場所を提供する EndpointAddress

例外

endpointConfigurationName または remoteAddressnull です。

EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint", address);

適用対象