Bug 44247 - Problem with using Dictionary<TKey,TValue>(KeyValuePair<TKey,TValue>) through WCF
Summary: Problem with using Dictionary<TKey,TValue>(KeyValuePair<TKey,TValue>) through...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: 4.4.2 (C7SR1)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-09-13 09:17 UTC by Alex
Modified: 2017-09-06 16:55 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Alex 2016-09-13 09:17:45 UTC
Description of Problem: 
If operation contract call Method with parametr KeyValuePair<TKey,TValue>:
Like

[OperationContract]
bool TESTSTRINGTRASFER(KeyValuePair<int, int> test);

And then close the channel. We always get an exception in server 
ProtocolException (String.Format ("Duplex mode is expected to be 2"));


Steps to reproduce the problem:
1. Start wcf service:
var host = new ServiceHost(obj, url);
host.AddServiceEndpoint(typeof (T), new NetTcpBinding(SecurityMode.None), string.Empty);
host .Open();

2. On client create ChannelFactory<T>:
var factory = new ChannelFactory<T> (new NetTcpBinding (SecurityMode.None),new EndpointAddress (url));

3. Using the factory create channel:
var connection = factory.CreateChannel ();

4. Call Method TESTSTRINGTRASFER with some KeyValuePair<int, int>
Get an answer from server (simple return true in realization)

5. Close channel 

ICommunicationObject channel = (ICommunicationObject)connection;
if (channel.State != CommunicationState.Closed && channel.State != CommunicationState.Faulted) {						
try {
channel.Close ();
} catch (Exception ex) {															channel.Abort();}

On the client error does not occur

6. On server get an error from 	TcpBinaryFrameManager.ProcessPreambleRecipient 	
			
throw new ProtocolException (String.Format ("Duplex mode is expected to be {0:X}", mode));

Actual Results:

  A execution error caused by the "Duplex mode is expected to be 2";

Expected Results:

  Wcf channel should be closed after the closed by client.


How often does this happen? 

  Always

Additional Information:

  None

Note You need to log in before you can comment on or make changes to this bug.