Click here to Skip to main content
15,881,044 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

According to msdn,the definition of ChannelFactory<t> is :

C#
 public class ChannelFactory<TChannel> : ChannelFactory, IChannelFactory<TChannel>, IChannelFactory, ICommunicationObject,

TChannel The type of channel produced by the channel factory. This type must be either IOutputChannel or IRequestChannel.


Here the TChannel is either IOutputChannel or IRequestChannel because of the channel shape. ok, no problem.

If I create a service contract like:

ISampleServiceChannel, and on the client side, we create the service proxy as below:

C#
ISampleServiceChannel wcfClientChannel = factory.CreateChannel();


But as I set the breakpoint here, and use

(wcfClientChannel as IOutputChannel) or (wcfClientChannel as IRequestChannel), both are null.

what is the problem here? and how can I know the channel shape of user defined service contract ?

I know we can craete the custom channel which inherits the shaped channel (IOutputChannel or IRequestChannel).
Posted
Updated 18-Apr-12 17:09pm
v3
Comments
Nelek 18-Apr-12 17:33pm    
First place: Please do not add solutions to add information or to comment/answer to someone that did it. You can use the "improve question" right side below your text (as I did above) to add information, or the "have a question or comment?" to directly speak to someone to give feedback, explain something concrete or things like that (as I am doing here).

Second: This is a free forum, where the users help in their spare time, just for the good of learning and/or helping others to learn and there are users of the whole world. The people who maybe answer you are just sleeping or working to get money to live. So please be patient.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900