You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I experimented with using WSTrustChannelSecurityTokenProvider to issue a token via WS-Trust, much like described in #4542. Then I ran into a problem when the STS responded with a SOAP Fault, which contained information that the code needed to act on.
The problem is that GetTokenCore uses try..finally to always call channel.Close() (source code), but if the channel has entered a faulted state it results in CommunicationObjectFaultedException, which in turn hides the SOAP Fault exception that had been thrown.
I believe the code in the finally block should examine the state of the channel and instead call Abort() in a faulted state.
It was just an experiment and I ended up using WSTrustChannelFactory instead for this, but I still want to report it, as it could hide valuable exception information in a normal WsFederationHttpBinding use case.
Describe the bug
I experimented with using
WSTrustChannelSecurityTokenProvider
to issue a token via WS-Trust, much like described in #4542. Then I ran into a problem when the STS responded with a SOAP Fault, which contained information that the code needed to act on.The problem is that
GetTokenCore
usestry..finally
to always callchannel.Close()
(source code), but if the channel has entered a faulted state it results inCommunicationObjectFaultedException
, which in turn hides the SOAP Fault exception that had been thrown.I believe the code in the finally block should examine the state of the channel and instead call
Abort()
in a faulted state.It was just an experiment and I ended up using
WSTrustChannelFactory
instead for this, but I still want to report it, as it could hide valuable exception information in a normalWsFederationHttpBinding
use case.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The SOAP Fault exception should not be hidden by a
CommunicationObjectFaultedException
.Additional context
This was tested with .NET 8 and
System.ServiceModel.Federation
version 8.0.0.The text was updated successfully, but these errors were encountered: