ChannelFactory<TChannel>.CreateChannel メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定したエンドポイント アドレスへの指定した種類のチャネルを作成します。
オーバーロード
CreateChannel(Binding, EndpointAddress, Uri) |
指定したバインドで構成された、指定したトランスポート アドレスのサービス エンドポイントにメッセージを送信するために使用される、指定した種類のチャネルを作成します。 |
CreateChannel(Binding, EndpointAddress) |
指定したバインドで構成されているサービス エンドポイントにメッセージを送信するために使用される、指定した種類のチャネルを作成します。 |
CreateChannel(EndpointAddress, Uri) |
指定したトランスポート アドレスを通して指定したエンドポイント アドレスのサービスにメッセージを送信するために使用されるチャネルを作成します。 |
CreateChannel(EndpointAddress) |
指定したエンドポイント アドレスのサービスにメッセージを送信するために使用されるチャネルを作成します。 |
CreateChannel() |
指定したエンドポイント アドレスへの指定した種類のチャネルを作成します。 |
CreateChannel(String) |
エンドポイントが指定した方法で構成されているサービスにメッセージを送信するために使用されるチャネルを作成します。 |
注釈
クラスのジェネリック パラメーターである TChannel
型のチャネルを作成します。
CreateChannel(Binding, EndpointAddress, Uri)
指定したバインドで構成された、指定したトランスポート アドレスのサービス エンドポイントにメッセージを送信するために使用される、指定した種類のチャネルを作成します。
public:
static TChannel CreateChannel(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ endpointAddress, Uri ^ via);
public:
static TChannel CreateChannel(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ address, Uri ^ via);
public static TChannel CreateChannel (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress endpointAddress, Uri via);
public static TChannel CreateChannel (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress address, Uri via);
static member CreateChannel : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress * Uri -> 'Channel
static member CreateChannel : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress * Uri -> 'Channel
Public Shared Function CreateChannel (binding As Binding, endpointAddress As EndpointAddress, via As Uri) As TChannel
Public Shared Function CreateChannel (binding As Binding, address As EndpointAddress, via As Uri) As TChannel
パラメーター
- endpointAddressaddress
- EndpointAddress
サービスの場所を提供する EndpointAddress。
戻り値
- TChannel
ファクトリによって作成された TChannel
型の IChannel。
例外
ChannelFactory には、サポートしない二重操作があります。
例
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
Uri uri = new Uri("http://localhost:8000/Via");
IRequestChannel channel =
ChannelFactory<IRequestChannel>.CreateChannel(binding, address, uri);
channel.Open();
class Program : ChannelFactory<IService1Channel>
{
static void Main(string[] args)
{
IService1Channel channel = CreateChannel("BasicHttpBinding_IService1");
channel.Open();
channel.Close();
}
}
適用対象
CreateChannel(Binding, EndpointAddress)
指定したバインドで構成されているサービス エンドポイントにメッセージを送信するために使用される、指定した種類のチャネルを作成します。
public:
static TChannel CreateChannel(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ endpointAddress);
public:
static TChannel CreateChannel(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ address);
public static TChannel CreateChannel (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress endpointAddress);
public static TChannel CreateChannel (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress address);
static member CreateChannel : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress -> 'Channel
static member CreateChannel : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress -> 'Channel
Public Shared Function CreateChannel (binding As Binding, endpointAddress As EndpointAddress) As TChannel
Public Shared Function CreateChannel (binding As Binding, address As EndpointAddress) As TChannel
パラメーター
- endpointAddressaddress
- EndpointAddress
サービスの場所を提供する EndpointAddress。
戻り値
- TChannel
ファクトリによって作成された TChannel
型の IChannel。
例外
ChannelFactory には、サポートしない二重操作があります。
例
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
IRequestChannel channel = ChannelFactory<IRequestChannel>.CreateChannel(binding, address);
channel.Open();
適用対象
CreateChannel(EndpointAddress, Uri)
指定したトランスポート アドレスを通して指定したエンドポイント アドレスのサービスにメッセージを送信するために使用されるチャネルを作成します。
public:
virtual TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ address, Uri ^ via);
public virtual TChannel CreateChannel (System.ServiceModel.EndpointAddress address, Uri via);
abstract member CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
override this.CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
Public Overridable Function CreateChannel (address As EndpointAddress, via As Uri) As TChannel
パラメーター
- address
- EndpointAddress
サービスの場所を提供する EndpointAddress。
戻り値
- TChannel
ファクトリによって作成された TChannel
型の IChannel。
実装
例外
address
が null
です。
ChannelFactory には、サポートしない二重操作があります。
例
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);
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();
適用対象
CreateChannel(EndpointAddress)
指定したエンドポイント アドレスのサービスにメッセージを送信するために使用されるチャネルを作成します。
public:
virtual TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ address);
public TChannel CreateChannel (System.ServiceModel.EndpointAddress address);
abstract member CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
override this.CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
Public Function CreateChannel (address As EndpointAddress) As TChannel
パラメーター
- address
- EndpointAddress
サービスの場所を提供する EndpointAddress。
戻り値
- TChannel
ファクトリによって作成された TChannel
型の IChannel。
実装
例外
address
が null
です。
例
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding);
factory.CreateChannel(address);
適用対象
CreateChannel()
指定したエンドポイント アドレスへの指定した種類のチャネルを作成します。
public:
TChannel CreateChannel();
public TChannel CreateChannel ();
member this.CreateChannel : unit -> 'Channel
Public Function CreateChannel () As TChannel
戻り値
- TChannel
ファクトリによって作成された TChannel
型の IChannel。
例
IChannelFactory<IRequestChannel> factory = binding.BuildChannelFactory<IRequestChannel>(bindingParams);
factory.Open();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
IRequestChannel channel = factory.CreateChannel(address);
channel.Open();
注釈
クラスのジェネリック パラメーターである TChannel
型のチャネルを作成します。
適用対象
CreateChannel(String)
エンドポイントが指定した方法で構成されているサービスにメッセージを送信するために使用されるチャネルを作成します。
protected:
static TChannel CreateChannel(System::String ^ endpointConfigurationName);
protected static TChannel CreateChannel (string endpointConfigurationName);
static member CreateChannel : string -> 'Channel
Protected Shared Function CreateChannel (endpointConfigurationName As String) As TChannel
パラメーター
- endpointConfigurationName
- String
サービスで使用されるエンドポイント構成の名前。
戻り値
- TChannel
ファクトリによって作成された TChannel
型の IChannel。
例外
ChannelFactory には、サポートしない二重操作があります。
例
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory =
new ChannelFactory<IRequestChannel>(binding, address);
IRequestChannel channel = factory.CreateChannel();
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();
}