使用 Siebel 创建频道
本部分演示如何通过提供和使用 XML 消息创建使用 Siebel 直接消息传递的通道。
//create a channel factory, capable of sending a request to Siebel and receiving a reply (IRequestChannel)
IChannelFactory<IRequestChannel> factory = binding.BuildChannelFactory<IRequestChannel>(new BindingParameterCollection());
//open factory
factory.Open();
//obtain a channel from the factory by specifying the address you want to connect to
IRequestChannel irc = factory.CreateChannel(address);
//open the channel
irc.Open();
//perform operations
…………
…………
…………
//close the channel
irc.Close();
//close the factory
factory.Close();
创建通道后,可以使用该通道对 Siebel 执行操作。