none
How to implement Sessionful message exchange pattern in WCF LOB Adapter ? RRS feed

  • Question

  • Hi,

    while developing WCF LOB adapter I selected dataflow as synchronousOutbound.

     

    Here my question is by default what message exchange pattern it creates, i.e

     

    1. One way Outbound or

    2. request - responce outbound or

    3. Sessionful outbound.

     

    and one more thing if I want to create message exchange pattern as sessionful outbound(IRequest Session channel)

    what are the changes need to be done in code and where .

     

     

    Thanks,

    Monday, July 21, 2008 10:44 AM

Answers

  • If all 3 are in the same contract, then WCF will use the IRequestSessionChannel for all 3 operations. A single proxy/contract can just use one type of channel for all the operations - so it will use that channel using which all operations can be invoked.

    Also, if you set the SessionMode attribute, then that value applies to all operations in the contract.

     

    Tuesday, July 22, 2008 7:46 AM

All replies

  • The code in the adapter can handle all of - IOutputChannel, IOutputSessionChannel, IRequestChannel and IRequestSessionChannel.

     

    The actual channel used depends on what the client asks for. If you are directly using the ChannelFactory, then you can use:

     

    binding.CreateChannelFactory<IRequestSessionChannel>()

     

    in order to use IRequestSessionChannels, for example.

     

    If you are using the generated proxy, then it will either use IOutputChannel or IRequestChannel, depending on whether all the operations in the contract are 1-way or not.

     

    If you want the proxy to use the Session-ful channels instead, you can modify the interface (which the proxy implements), by adding the "SessionMode = SessionMode.Required" attribute to the ServiceContract attribute.

     

    Monday, July 21, 2008 5:51 PM
  • Thanks for the reply Mustansir,

     

    suppose I have a scenario like this, I am having a Service under which there are three operations which are with their message exchnge patterns(MEP) as follows

     

    1. void ( one way) operation

    2. request response operation and

    3. sessionful operation

     

    I wan to implement all three MEP at a time, How this can be achieved by direct way and through proxy way ?

     

     

     

     

    Thanks,

     

     

    Tuesday, July 22, 2008 7:05 AM
  • If all 3 are in the same contract, then WCF will use the IRequestSessionChannel for all 3 operations. A single proxy/contract can just use one type of channel for all the operations - so it will use that channel using which all operations can be invoked.

    Also, if you set the SessionMode attribute, then that value applies to all operations in the contract.

     

    Tuesday, July 22, 2008 7:46 AM