diff --git a/src/System.Private.ServiceModel/src/Internals/WcfEventSource.cs b/src/System.Private.ServiceModel/src/Internals/WcfEventSource.cs index c87ff2c83bc..842ff2fac6a 100644 --- a/src/System.Private.ServiceModel/src/Internals/WcfEventSource.cs +++ b/src/System.Private.ServiceModel/src/Internals/WcfEventSource.cs @@ -221,6 +221,46 @@ public void FaultProviderInvoked(string TypeName, string ExceptionTypeName) FaultProviderInvoked(TypeName, ExceptionTypeName, "", ""); } + public bool MessageInspectorAfterReceiveInvokedIsEnabled() + { + return base.IsEnabled(EventLevel.Informational, Keywords.Troubleshooting | Keywords.ServiceModel, EventChannel.Analytic); + } + + [Event(EventIds.MessageInspectorAfterReceiveInvoked, Level = EventLevel.Informational, Channel = EventChannel.Analytic, Opcode = Opcodes.DispatchMessageDispathMessageInspectorAfterReceiveInvoked, Task = Tasks.DispatchMessage, + Keywords = Keywords.Troubleshooting | Keywords.ServiceModel, + Message = "The Dispatcher invoked 'AfterReceiveReply' on a MessageInspector of type '{0}'.")] + public void MessageInspectorAfterReceiveInvoked(string TypeName, string HostReference, string AppDomain) + { + WriteEvent(EventIds.MessageInspectorAfterReceiveInvoked, TypeName, HostReference, AppDomain); + } + + [NonEvent] + public void MessageInspectorAfterReceiveInvoked(EventTraceActivity eventTraceActivity, string TypeName) + { + SetActivityId(eventTraceActivity); + MessageInspectorAfterReceiveInvoked(TypeName, "", ""); + } + + public bool MessageInspectorBeforeSendInvokedIsEnabled() + { + return base.IsEnabled(EventLevel.Informational, Keywords.Troubleshooting | Keywords.ServiceModel, EventChannel.Analytic); + } + + [Event(EventIds.MessageInspectorBeforeSendInvoked, Level = EventLevel.Informational, Channel = EventChannel.Analytic, Opcode = Opcodes.DispatchMessageDispathMessageInspectorBeforeSendInvoked, Task = Tasks.DispatchMessage, + Keywords = Keywords.Troubleshooting | Keywords.ServiceModel, + Message = "The Dispatcher invoked 'BeforeSendRequest' on a MessageInspector of type '{0}'.")] + public void MessageInspectorBeforeSendInvoked(string TypeName, string HostReference, string AppDomain) + { + WriteEvent(EventIds.MessageInspectorBeforeSendInvoked, TypeName, HostReference, AppDomain); + } + + [NonEvent] + public void MessageInspectorBeforeSendInvoked(EventTraceActivity eventTraceActivity, string TypeName) + { + SetActivityId(eventTraceActivity); + MessageInspectorBeforeSendInvoked(TypeName, "", ""); + } + public bool ParameterInspectorAfterCallInvokedIsEnabled() { return base.IsEnabled(EventLevel.Informational, Keywords.Troubleshooting | Keywords.ServiceModel, EventChannel.Analytic); diff --git a/src/System.Private.ServiceModel/src/Resources/Strings.resx b/src/System.Private.ServiceModel/src/Resources/Strings.resx index 51d9ee48072..1eca7a853b3 100644 --- a/src/System.Private.ServiceModel/src/Resources/Strings.resx +++ b/src/System.Private.ServiceModel/src/Resources/Strings.resx @@ -3000,4 +3000,7 @@ Cannot create a typed message due to action mismatch, expecting {0} encountered {1} - + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + \ No newline at end of file diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.cs.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.cs.xlf index 05a21925dd7..0f29f659efc 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.cs.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.cs.xlf @@ -3227,6 +3227,11 @@ Hodnota NONE elementu WS-Addressing není platná pro verzi elementu WS-Addressing ze srpna 2004. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. Formátovací modul {0} vrátil zprávu odpovědi s hodnotou NULL pro volání do operace {1}. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.de.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.de.xlf index 76572f0170e..5aedbebed63 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.de.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.de.xlf @@ -3227,6 +3227,11 @@ Der Wert "none" der WS-Adressierung ist für die August 2004-Version der WS-Adressierung nicht gültig. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. Der Formatierer {0} hat eine leere Antwortnachricht für einen Aufruf des Vorgangs "{1}" zurückgegeben. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.es.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.es.xlf index bd89edcbd25..d83beeda604 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.es.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.es.xlf @@ -3227,6 +3227,11 @@ El valor "none" de WS-Addressing no es válido para la versión de agosto de 2004 de WS-Addressing. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. El formateador {0} devolvió un mensaje de respuesta nulo para la llamada a la operación "{1}". diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.fr.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.fr.xlf index c9672b5df9c..a668bb86fa1 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.fr.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.fr.xlf @@ -3227,6 +3227,11 @@ La valeur 'none' de WS-Addressing n'est pas valide pour la version d'août 2004 de WS-Addressing. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. Le formateur {0} a retourné un message de réponse avec une valeur null pour l'appel à l'opération '{1}'. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.it.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.it.xlf index d22ba566cab..aab5bddf89d 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.it.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.it.xlf @@ -3227,6 +3227,11 @@ Valore WS-Addressing "none" non valido per la versione di agosto 2004 di WS-Addressing. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. Il formattatore {0} ha restituito un messaggio di risposta Null per la chiamata all'operazione '{1}'. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ja.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ja.xlf index f358fb39809..71215e95dd6 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ja.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ja.xlf @@ -3227,6 +3227,11 @@ WS-Addressing の値を "なし" にすることは、2004 年 8 月版の WS-Addressing では無効です。 + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. フォーマッタ {0} が、操作 '{1}' への呼び出しに対して null の応答メッセージを返しました。 diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ko.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ko.xlf index 457e9460e89..906f600fea3 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ko.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ko.xlf @@ -3227,6 +3227,11 @@ WS-Addressing "none" 값이 2004년 8월 버전의 WS-Addressing에 올바르지 않습니다. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. {0} 포맷터가 '{1}' 작업의 호출에 대해 null 회신 메시지를 반환했습니다. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pl.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pl.xlf index 9f0019779cc..89cf6cb0008 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pl.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pl.xlf @@ -3227,6 +3227,11 @@ Wartość WS-Addressing „none” jest nieprawidłowa dla wersji WS-Addressing z sierpnia 2004. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. Program formatujący {0} zwrócił komunikat odpowiedzi o wartości null dla wywołania operacji „{1}”. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pt-BR.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pt-BR.xlf index d2d195ae112..173e38eaa10 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pt-BR.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.pt-BR.xlf @@ -3227,6 +3227,11 @@ O valor "none" do WS-Addressing não é válido para a versão de agosto de 2004 do WS-Addressing. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. O formatador {0} retornou uma mensagem de resposta nula da chamada para a operação '{1}'. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ru.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ru.xlf index 8331451123d..2dd95ee87f7 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ru.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.ru.xlf @@ -3227,6 +3227,11 @@ Значение WS-Addressing "none" недопустимо для версии WS-Addressing августа 2004 г. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. Модуль форматирования {0} вернул нулевое ответное сообщение для вызова операции "{1}". diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.tr.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.tr.xlf index fbf92af21a8..e1a4c597525 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.tr.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.tr.xlf @@ -3227,6 +3227,11 @@ WS-Addressing "none" değeri, WS-Addressing Ağustos 2004 sürümü için geçerli değil. + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. {0} biçimlendiricisi '{1}' işlemi çağrısı için bir null yanıt iletisi döndürdü. diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hans.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hans.xlf index 1f9f4a5ce0e..6c78a4fc524 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hans.xlf @@ -3227,6 +3227,11 @@ WS-Addressing "none" 值对 2004 年 8 月版本的 WS-Addressing 无效。 + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. 格式化程序 {0} 对操作“{1}”的调用返回了空回复消息。 diff --git a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hant.xlf b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hant.xlf index 79d2a6a6806..6cf775bb9f7 100644 --- a/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/System.Private.ServiceModel/src/Resources/xlf/Strings.zh-Hant.xlf @@ -3227,6 +3227,11 @@ WS-Addressing "none" 值對於 WS-Addressing August 2004 版本無效。 + + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + Extension {0} prevented call to operation '{1}' from replying by setting the reply to null. + + Formatter {0} returned a null reply message for call to operation '{1}'. 格式器 {0} 對作業 '{1}' 的呼叫,傳回了 null 的回覆訊息。 diff --git a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/DispatchRuntime.cs b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/DispatchRuntime.cs index 3348500702a..e744ee22967 100644 --- a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/DispatchRuntime.cs +++ b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/DispatchRuntime.cs @@ -20,6 +20,7 @@ public sealed class DispatchRuntime private ChannelDispatcher _channelDispatcher; private IInstanceProvider _instanceProvider; private IInstanceContextProvider _instanceContextProvider; + private SynchronizedCollection _messageInspectors; private OperationCollection _operations; private ImmutableDispatchRuntime _runtime; private SynchronizationContext _synchronizationContext; @@ -42,6 +43,7 @@ private DispatchRuntime(SharedRuntimeState shared) _shared = shared; _operations = new OperationCollection(this); + _messageInspectors = NewBehaviorCollection(); _synchronizationContext = ThreadBehavior.GetCurrentSynchronizationContext(); _automaticInputSessionShutdown = true; @@ -157,6 +159,11 @@ public IInstanceProvider InstanceProvider } } + public SynchronizedCollection MessageInspectors + { + get { return _messageInspectors; } + } + public SynchronizedKeyedCollection Operations { get { return _operations; } diff --git a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ErrorBehavior.cs b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ErrorBehavior.cs index cd2ee3265d4..f2023e3127a 100644 --- a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ErrorBehavior.cs +++ b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ErrorBehavior.cs @@ -223,6 +223,11 @@ internal bool HandleError(Exception error, ref ErrorHandlerFaultInfo faultInfo) return HandleErrorCommon(error, ref faultInfo); } + internal static bool ShouldRethrowExceptionAsIs(Exception e) + { + return true; + } + internal static bool ShouldRethrowClientSideExceptionAsIs(Exception e) { return true; diff --git a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/IDispatchMessageInspector.cs b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/IDispatchMessageInspector.cs new file mode 100644 index 00000000000..81635c02188 --- /dev/null +++ b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/IDispatchMessageInspector.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + + +using System.ServiceModel.Channels; + +namespace System.ServiceModel.Dispatcher +{ + public interface IDispatchMessageInspector + { + object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext); + void BeforeSendReply(ref Message reply, object correlationState); + } +} diff --git a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs index 52b9f5fa788..262988e0b6f 100644 --- a/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs +++ b/src/System.Private.ServiceModel/src/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - using System.Collections.Specialized; using System.Runtime; using System.Runtime.Diagnostics; @@ -13,10 +12,11 @@ namespace System.ServiceModel.Dispatcher { internal class ImmutableDispatchRuntime { - readonly private ConcurrencyBehavior _concurrency; - readonly private IDemuxer _demuxer; - readonly private ErrorBehavior _error; + private readonly ConcurrencyBehavior _concurrency; + private readonly IDemuxer _demuxer; + private readonly ErrorBehavior _error; private InstanceBehavior _instance; + private readonly IDispatchMessageInspector[] _messageInspectors; private readonly TerminatingOperationBehavior _terminate; private readonly ThreadBehavior _thread; private readonly bool _sendAsynchronously; @@ -45,6 +45,7 @@ internal ImmutableDispatchRuntime(DispatchRuntime dispatch) EnableFaults = dispatch.EnableFaults; _instance = new InstanceBehavior(dispatch, this); ManualAddressing = dispatch.ManualAddressing; + _messageInspectors = EmptyArray.ToArray(dispatch.MessageInspectors); _terminate = TerminatingOperationBehavior.CreateIfNecessary(dispatch); _thread = new ThreadBehavior(dispatch); _sendAsynchronously = dispatch.ChannelDispatcher.SendAsynchronously; @@ -87,9 +88,93 @@ internal ImmutableDispatchRuntime(DispatchRuntime dispatch) internal bool ValidateMustUnderstand { get; } + internal int MessageInspectorCorrelationOffset => 0; + internal void AfterReceiveRequest(ref MessageRpc rpc) { - // IDispatchMessageInspector would normally be called here. That interface isn't in contract. + if (_messageInspectors.Length > 0) + { + AfterReceiveRequestCore(ref rpc); + } + } + + internal void AfterReceiveRequestCore(ref MessageRpc rpc) + { + int offset = MessageInspectorCorrelationOffset; + try + { + for (int i = 0; i < _messageInspectors.Length; i++) + { + rpc.Correlation[offset + i] = _messageInspectors[i].AfterReceiveRequest(ref rpc.Request, (IClientChannel)rpc.Channel.Proxy, rpc.InstanceContext); + if (WcfEventSource.Instance.MessageInspectorAfterReceiveInvokedIsEnabled()) + { + WcfEventSource.Instance.MessageInspectorAfterReceiveInvoked(rpc.EventTraceActivity, _messageInspectors[i].GetType().FullName); + } + } + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + if (ErrorBehavior.ShouldRethrowExceptionAsIs(e)) + { + throw; + } + throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e); + } + } + + void BeforeSendReply(ref MessageRpc rpc, ref Exception exception, ref bool thereIsAnUnhandledException) + { + if (_messageInspectors.Length > 0) + { + BeforeSendReplyCore(ref rpc, ref exception, ref thereIsAnUnhandledException); + } + } + + internal void BeforeSendReplyCore(ref MessageRpc rpc, ref Exception exception, ref bool thereIsAnUnhandledException) + { + int offset = MessageInspectorCorrelationOffset; + for (int i = 0; i < _messageInspectors.Length; i++) + { + try + { + Message originalReply = rpc.Reply; + Message reply = originalReply; + + _messageInspectors[i].BeforeSendReply(ref reply, rpc.Correlation[offset + i]); + if (WcfEventSource.Instance.MessageInspectorBeforeSendInvokedIsEnabled()) + { + WcfEventSource.Instance.MessageInspectorBeforeSendInvoked(rpc.EventTraceActivity, _messageInspectors[i].GetType().FullName); + } + + if ((reply == null) && (originalReply != null)) + { + string message = SR.Format(SR.SFxNullReplyFromExtension2, _messageInspectors[i].GetType().ToString(), (rpc.Operation.Name ?? "")); + ErrorBehavior.ThrowAndCatch(new InvalidOperationException(message)); + } + rpc.Reply = reply; + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + if (!ErrorBehavior.ShouldRethrowExceptionAsIs(e)) + { + throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e); + } + + if (exception == null) + { + exception = e; + } + thereIsAnUnhandledException = (!_error.HandleError(e)) || thereIsAnUnhandledException; + } + } } private void Reply(ref MessageRpc rpc) @@ -304,6 +389,8 @@ private void PrepareReply(ref MessageRpc rpc) } } + BeforeSendReply(ref rpc, ref exception, ref thereIsAnUnhandledException); + if (rpc.Operation.IsOneWay) { rpc.CanSendReply = false; diff --git a/src/System.ServiceModel.Duplex/ref/System.ServiceModel.Duplex.cs b/src/System.ServiceModel.Duplex/ref/System.ServiceModel.Duplex.cs index 5d0573e18ea..f9e2f4c38fc 100644 --- a/src/System.ServiceModel.Duplex/ref/System.ServiceModel.Duplex.cs +++ b/src/System.ServiceModel.Duplex/ref/System.ServiceModel.Duplex.cs @@ -4,6 +4,7 @@ // Changes to this file must follow the http://aka.ms/api-review process. // ------------------------------------------------------------------------------ +[assembly:System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.InstanceContext))] namespace System.ServiceModel { @@ -51,24 +52,4 @@ protected DuplexClientBase(System.ServiceModel.InstanceContext callbackInstance, [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected DuplexClientBase(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress) { } } - public sealed partial class InstanceContext : System.ServiceModel.Channels.CommunicationObject, System.ServiceModel.IExtensibleObject - { - public InstanceContext(object implementation) { } - protected override System.TimeSpan DefaultCloseTimeout { get { return default(System.TimeSpan); } } - protected override System.TimeSpan DefaultOpenTimeout { get { return default(System.TimeSpan); } } - public System.Threading.SynchronizationContext SynchronizationContext { get { return default(System.Threading.SynchronizationContext); } set { } } - public System.ServiceModel.IExtensionCollection Extensions { get { return default(System.ServiceModel.IExtensionCollection); } } - public object GetServiceInstance(System.ServiceModel.Channels.Message message) { return default(object); } - protected override void OnAbort() { } - protected override System.IAsyncResult OnBeginClose(System.TimeSpan timeout, System.AsyncCallback callback, object state) { return default(System.IAsyncResult); } - protected override System.IAsyncResult OnBeginOpen(System.TimeSpan timeout, System.AsyncCallback callback, object state) { return default(System.IAsyncResult); } - protected override void OnClose(System.TimeSpan timeout) { } - protected override void OnClosed() { } - protected override void OnEndClose(System.IAsyncResult result) { } - protected override void OnEndOpen(System.IAsyncResult result) { } - protected override void OnFaulted() { } - protected override void OnOpen(System.TimeSpan timeout) { } - protected override void OnOpened() { } - protected override void OnOpening() { } - } } diff --git a/src/System.ServiceModel.Duplex/src/System.ServiceModel.Duplex.Facade.csproj b/src/System.ServiceModel.Duplex/src/System.ServiceModel.Duplex.Facade.csproj index 4541a1e0ffc..034530e0016 100644 --- a/src/System.ServiceModel.Duplex/src/System.ServiceModel.Duplex.Facade.csproj +++ b/src/System.ServiceModel.Duplex/src/System.ServiceModel.Duplex.Facade.csproj @@ -17,7 +17,7 @@ - + @@ -56,4 +56,21 @@ + + + system_Private_ServiceModel + + + system_Private_ServiceModel + + + system_Private_ServiceModel + + + system_Private_ServiceModel + + + system_Private_ServiceModel + + diff --git a/src/System.ServiceModel.Primitives/ref/System.ServiceModel.Primitives.cs b/src/System.ServiceModel.Primitives/ref/System.ServiceModel.Primitives.cs index 9ccfb3cf0fc..b1d740a66d2 100644 --- a/src/System.ServiceModel.Primitives/ref/System.ServiceModel.Primitives.cs +++ b/src/System.ServiceModel.Primitives/ref/System.ServiceModel.Primitives.cs @@ -635,7 +635,7 @@ protected InvalidMessageContractException(System.Runtime.Serialization.Serializa [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = false)] public partial class MessageHeaderAttribute : MessageContractMemberAttribute { - public bool MustUnderstand { get { return default; } set { } } + public bool MustUnderstand { get { return default; } set { } } } [System.AttributeUsageAttribute((System.AttributeTargets)(384), AllowMultiple = false, Inherited = false)] public sealed partial class MessageHeaderArrayAttribute : MessageHeaderAttribute @@ -850,7 +850,27 @@ public sealed partial class XmlSerializerFormatAttribute : System.Attribute public XmlSerializerFormatAttribute() { } public System.ServiceModel.OperationFormatStyle Style { get { return default; } set { } } public bool SupportFaults { get { return default; } set { } } - public OperationFormatUse Use{ get { throw null; } set { } } + public OperationFormatUse Use { get { throw null; } set { } } + } + public sealed partial class InstanceContext : System.ServiceModel.Channels.CommunicationObject, System.ServiceModel.IExtensibleObject + { + public InstanceContext(object implementation) { } + protected override System.TimeSpan DefaultCloseTimeout { get { return default(System.TimeSpan); } } + protected override System.TimeSpan DefaultOpenTimeout { get { return default(System.TimeSpan); } } + public System.Threading.SynchronizationContext SynchronizationContext { get { return default(System.Threading.SynchronizationContext); } set { } } + public System.ServiceModel.IExtensionCollection Extensions { get { return default(System.ServiceModel.IExtensionCollection); } } + public object GetServiceInstance(System.ServiceModel.Channels.Message message) { return default(object); } + protected override void OnAbort() { } + protected override System.IAsyncResult OnBeginClose(System.TimeSpan timeout, System.AsyncCallback callback, object state) { return default(System.IAsyncResult); } + protected override System.IAsyncResult OnBeginOpen(System.TimeSpan timeout, System.AsyncCallback callback, object state) { return default(System.IAsyncResult); } + protected override void OnClose(System.TimeSpan timeout) { } + protected override void OnClosed() { } + protected override void OnEndClose(System.IAsyncResult result) { } + protected override void OnEndOpen(System.IAsyncResult result) { } + protected override void OnFaulted() { } + protected override void OnOpen(System.TimeSpan timeout) { } + protected override void OnOpened() { } + protected override void OnOpening() { } } } namespace System.ServiceModel.Channels @@ -1749,6 +1769,7 @@ public sealed partial class ClientRuntime internal ClientRuntime() { } public System.Collections.Generic.SynchronizedCollection ChannelInitializers { get { return default; } } public System.Collections.Generic.ICollection ClientMessageInspectors { get { return default; } } + public System.ServiceModel.Dispatcher.DispatchRuntime CallbackDispatchRuntime { get { return default; } } public System.Collections.Generic.ICollection ClientOperations { get { return default; } } public System.Type ContractClientType { get { return default; } set { } } public string ContractName { get { return default; } } @@ -1774,6 +1795,7 @@ public DispatchOperation(System.ServiceModel.Dispatcher.DispatchRuntime parent, public sealed partial class DispatchRuntime { internal DispatchRuntime() { } + public System.Collections.Generic.SynchronizedCollection MessageInspectors { get { return default; } } } public partial class EndpointDispatcher { @@ -1799,6 +1821,11 @@ public partial interface IClientMessageInspector void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState); object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel); } + public interface IDispatchMessageInspector + { + object AfterReceiveRequest(ref Message request, IClientChannel channel, System.ServiceModel.InstanceContext instanceContext); + void BeforeSendReply(ref Message reply, object correlationState); + } public partial interface IClientOperationSelector { bool AreParametersRequiredForSelection { get; }