Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReliableSession #1655

Closed
GibSral opened this issue Nov 10, 2016 · 21 comments
Closed

ReliableSession #1655

GibSral opened this issue Nov 10, 2016 · 21 comments
Assignees
Labels
feature request Adding new functionality requiring adding an API to the public contract. MRS priority 1 Stack ranked level of priority. P1
Milestone

Comments

@GibSral
Copy link

GibSral commented Nov 10, 2016

I try to establish a reliable duplex connection via WCF (netTcpBinding) in UWP.
NetTcpBinding/NetHttpBinding does not offer the possibility to configure a reliable session (option missing in ctor).

Am I missing something?

@zhenlan
Copy link
Member

zhenlan commented Nov 15, 2016

@GibSral sorry for running into this. You did not miss anything. Reliable session is currently not supported.

@zhenlan zhenlan added this to the Future milestone Nov 15, 2016
@zhenlan zhenlan added feature request Adding new functionality requiring adding an API to the public contract. and removed discussion labels Sep 26, 2017
@zhenlan
Copy link
Member

zhenlan commented Sep 26, 2017

If we do this, we should consider decoupling reliable session from the transport. Currently, reliable sessions are not usable without an in-box binding.

@SurendraPhadke
Copy link

Any update on the support of ReliableSession?

@Lxiamail
Copy link
Member

@SurendraPhadke ReliableSession is very complicated and problemetic in some satuation evens in .NET Framework WCF. Currently, there is no plan to bring the feature to WCF in .NET Core. However, it is helpful to hear if any customer is blocked by missing this feature and why it is a blocking issue. Please continue vote and share your scenario with us.

@StephenBonikowsky StephenBonikowsky added the Backlog Legitimate tasks of lower priority not in current dev schedule. label May 23, 2019
@Alois-xx
Copy link

Alois-xx commented Jul 29, 2019

@Lxiamail: I have seen people using reliable sessions to enforce in order message delivery. Is it true that WCF messages can arrive in a different order than they were sent? Is reliable messaging the only way to cure that odd behavior of WCF?

We are using a (nettcp) duplex commuincation and we have a callback on the service.
Let suppose we call on backend and on different threads:

  1. ICallback.DoSomething(byte[]) with a huge byte array
  2. ICallback.DoSomething(byte[]) with a small byte array.

On client side it is possible that the second call will arrive first if we do not use a reliable session.
And it can mess up our datamodel on client side.

@StephenBonikowsky StephenBonikowsky added vnext consider Feature requests or Bugs to consider taking in vNext. and removed Backlog Legitimate tasks of lower priority not in current dev schedule. Community labels Feb 7, 2020
@StephenBonikowsky StephenBonikowsky removed this from the Future milestone Mar 5, 2020
@krkawalli
Copy link

krkawalli commented Mar 5, 2020

We trying to consume WCF service with the reliable session (this is older one) , so trying to consume it through the .NET core , do not find this option yet to set reliable session as part of the Custom Binding. This is blocking to consume the existing WCF service which is enabled reliable session ,this service is not maintained by us.

Can some one give an option on how we can consume Reliable session enabled service in .NET Core.

Error :
"One or more errors occurred. (The action http://tempuri.org/...../GetDefaultHosts is not supported by this endpoint. Only WS-ReliableMessaging February 2005 messages are processed by this endpoint.)"

@mconnew
Copy link
Member

mconnew commented Mar 5, 2020

After we have the work completed to support WS-Federation, my next big project is to implement reliable sessions. The hope is to have it complete for the .NET 5 release.

@krkawalli
Copy link

After we have the work completed to support WS-Federation, my next big project is to implement reliable sessions. The hope is to have it complete for the .NET 5 release.

That means - we do not have any way to consume Reliable Session Enabled WCF in .NET Core now?

@krkawalli
Copy link

@SurendraPhadke ReliableSession is very complicated and problemetic in some satuation evens in .NET Framework WCF. Currently, there is no plan to bring the feature to WCF in .NET Core. However, it is helpful to hear if any customer is blocked by missing this feature and why it is a blocking issue. Please continue vote and share your scenario with us.

-Yes we are blocked to consume some of the data which is being exposed by WCF service which has reliable session enabled by WCF service. Since we moving all the old .NET code to .NET core , this is one think which has blocked us to completely move to .NET Core.

@HongGit HongGit removed the vnext consider Feature requests or Bugs to consider taking in vNext. label Mar 13, 2020
@HongGit HongGit added the priority 1 Stack ranked level of priority. P1 label Mar 13, 2020
@HongGit HongGit added the MRS label May 7, 2020
@Henk7
Copy link

Henk7 commented May 12, 2020

@SurendraPhadke ReliableSession is very complicated and problemetic in some satuation evens in .NET Framework WCF. Currently, there is no plan to bring the feature to WCF in .NET Core. However, it is helpful to hear if any customer is blocked by missing this feature and why it is a blocking issue. Please continue vote and share your scenario with us.

Hi,
Also depending on a third party service which is using ReliableSession. The endpoint throws "Only WS-ReliableMessaging February 2005 messages are processed by this endpoint."
We have control over the client code but not the server.
Is there a workaround in netcore3.1?

@LouisCPro
Copy link

LouisCPro commented Jun 26, 2020

Hi,

Same Problem for me trying to port a Framework based WCF Duplex Service to UWP to create a new HMI under Win10IotCore.
No RealiableSession property in NetTcpBinding !

@LouisCPro
Copy link

LouisCPro commented Jun 26, 2020

Notice also that even Instancecontext is not supported.

Here is the way I initialize my clientservice in classic WCF :

"...
m_ServiceCallback = new MyClientInstanceCallback();
m_InstanceContext = new InstanceContext(m_ServiceCallback);
m_Client = new MyClient(m_InstanceContext);
m_Client.ChannelFactory.Closed += ChannelFactory_Closed;
m_Client.ChannelFactory.Faulted += ChannelFactory_Faulted;

This constructor is marked as private in UWP Service Reference, and however I use a partial implementation to enable a new constructor in public, it throws a NotSupportedException....

@HongGit HongGit added this to the 5.0 milestone Sep 1, 2020
@mconnew
Copy link
Member

mconnew commented Sep 18, 2020

I just committed the reliable sessions implementation. While this is shipping as part of the overall .NET 5 release, WCF continues to only depend on netstandard2.0 so new features are enabled for all supported versions of .NET Core and you do not need to move to .NET 5 to use these new features.

@mconnew mconnew closed this as completed Sep 18, 2020
@ssa3512
Copy link

ssa3512 commented Oct 14, 2020

@mconnew I pulled latest master and built the service model packages but can't get a reliable session one way call to work under netcore3.1. Getting this assertion:

Process terminated. Assertion failed.
Type 'System.ServiceModel.Channels.ReliableOutputSessionChannelOverDuplex' is required to override OnOpenAsync
   at System.ServiceModel.Channels.CommunicationObject.OnOpenAsyncInternal(TimeSpan timeout) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\CommunicationObject.cs:line 561
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.ServiceModel.Channels.CommunicationObject.OnOpenAsyncInternal(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.System.ServiceModel.IAsyncCommunicationObject.OpenAsync(TimeSpan timeout) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\CommunicationObject.cs:line 532
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.ServiceModel.Channels.CommunicationObject.System.ServiceModel.IAsyncCommunicationObject.OpenAsync(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.OpenAsyncInternal(TimeSpan timeout) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\CommunicationObject.cs:line 504
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.ServiceModel.Channels.CommunicationObject.OpenAsyncInternal(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\CommunicationObject.cs:line 498
   at System.Runtime.TaskHelpers.CallActionAsync[TArg](Action`1 action, TArg argument) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\Internals\System\Runtime\TaskHelpers.cs:line 377
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.<>c.<System.Runtime.CompilerServices.IStateMachineBoxAwareAwaiter.AwaitUnsafeOnCompleted>b__5_0(Object s)
   at System.Runtime.ServiceModelSynchronizationContext.<>c__DisplayClass1_0.<Post>b__0(Object s) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\Internals\System\Runtime\ServiceModelSynchronizationContext.cs:line 15
   at System.Runtime.IOThreadScheduler.ScheduledOverlapped.Callback() in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\Internals\System\Runtime\IOThreadScheduler.cs:line 461
   at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\Internals\System\Runtime\IOThreadScheduler.cs:line 434
   at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) in C:\Projects\dotnet\wcf\src\System.Private.ServiceModel\src\Internals\System\Runtime\Fx.cs:line 485
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped)

Repro here:
https://github.com/ssa3512/wcf-reliable-sessions

With service host project running
dotnet run -f net472 --project .\wcfasynctestclient\wcfasynctestclient.csproj succeeds
dotnet run -f netcoreapp3.1 --project .\wcfasynctestclient\wcfasynctestclient.csproj fails

Am I missing something?

@mconnew
Copy link
Member

mconnew commented Oct 14, 2020

@ssa3512, oops that's a bug. It should be an easy fix but it might be tight to get it in before we release the final build. I'll try, but if it doesn't make it into the final build, I'll get it out in the first patch release which should be a month later.

@mconnew
Copy link
Member

mconnew commented Oct 15, 2020

Fix is in PR #4395, it should get merged tomorrow.

@mconnew
Copy link
Member

mconnew commented Oct 15, 2020

@ssa3512, the fix is merged now. Can you try that out and confirm your issue is fixed.

@ssa3512
Copy link

ssa3512 commented Oct 15, 2020

@mconnew Thanks - I verified it is working as expected now.

@xnlu
Copy link

xnlu commented Oct 23, 2020

Hi when will this feature be available in NuGet? I just downloaded the latest System.ServiceModel.NetTcp package, 4.8.0-preview3.20412.3. But reliable sessions implementation is not included yet. Thanks!

@mconnew
Copy link
Member

mconnew commented Oct 24, 2020

It will published to nuget at the same time .Net 5 is released which happens next month. I can't say more than that as I don't know if a more definite release date has been announced publicly yet and I don't want to be the guy to announce an internal schedule by mistake!

@rughvi
Copy link

rughvi commented May 27, 2021

HI there,
I am still unable to have a success with 'reliableSession' binding in any of the following clients:
.Net Core 3.1
.Net standard 2
.Net 5

My wcf service is running as a .net framework 4.7.2.

I tried both wsHttpBinding and CustomBinding.

Am I missing anything?

How can I achieve 'reliableSession' in .Net Core 3.1 client talking to .Net framework 4.7 server setup with 'reliableSession' binding.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Adding new functionality requiring adding an API to the public contract. MRS priority 1 Stack ranked level of priority. P1
Projects
None yet
Development

No branches or pull requests