From 318cc7c984e316e1aef184b5b610d18b99cc0c24 Mon Sep 17 00:00:00 2001 From: Dariusz Uchman Date: Mon, 27 Apr 2020 12:57:35 +0200 Subject: [PATCH 1/3] Passed request message to FaultException provider --- src/SoapCore/DefaultFaultExceptionTransformer.cs | 2 +- src/SoapCore/Extensibility/IFaultExceptionTransformer.cs | 3 ++- src/SoapCore/SoapEndpointMiddleware.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SoapCore/DefaultFaultExceptionTransformer.cs b/src/SoapCore/DefaultFaultExceptionTransformer.cs index d9ff7104..53c62dfc 100644 --- a/src/SoapCore/DefaultFaultExceptionTransformer.cs +++ b/src/SoapCore/DefaultFaultExceptionTransformer.cs @@ -24,7 +24,7 @@ public DefaultFaultExceptionTransformer(ExceptionTransformer exceptionTransforme _exceptionTransformer = exceptionTransformer; } - public Message ProvideFault(Exception exception, MessageVersion messageVersion, XmlNamespaceManager xmlNamespaceManager) + public Message ProvideFault(Exception exception, MessageVersion messageVersion, Message requestMessage, XmlNamespaceManager xmlNamespaceManager) { var bodyWriter = _exceptionTransformer == null ? new FaultBodyWriter(exception, messageVersion) : diff --git a/src/SoapCore/Extensibility/IFaultExceptionTransformer.cs b/src/SoapCore/Extensibility/IFaultExceptionTransformer.cs index 6a9a4cc4..9c9e0940 100644 --- a/src/SoapCore/Extensibility/IFaultExceptionTransformer.cs +++ b/src/SoapCore/Extensibility/IFaultExceptionTransformer.cs @@ -18,9 +18,10 @@ public interface IFaultExceptionTransformer /// /// Exception to transform /// SOAP message version + /// SOAP requestMessage /// Namespace manager /// Fully formatted SOAP Message /// - Message ProvideFault(Exception exception, MessageVersion messageVersion, XmlNamespaceManager xmlNamespaceManager); + Message ProvideFault(Exception exception, MessageVersion messageVersion, Message requestMessage, XmlNamespaceManager xmlNamespaceManager); } } diff --git a/src/SoapCore/SoapEndpointMiddleware.cs b/src/SoapCore/SoapEndpointMiddleware.cs index 48bc3a0b..53cab530 100644 --- a/src/SoapCore/SoapEndpointMiddleware.cs +++ b/src/SoapCore/SoapEndpointMiddleware.cs @@ -661,7 +661,7 @@ private async Task WriteErrorResponseMessage( HttpContext httpContext) { var faultExceptionTransformer = serviceProvider.GetRequiredService(); - var faultMessage = faultExceptionTransformer.ProvideFault(exception, messageEncoder.MessageVersion, _xmlNamespaceManager); + var faultMessage = faultExceptionTransformer.ProvideFault(exception, messageEncoder.MessageVersion, requestMessage, _xmlNamespaceManager); httpContext.Response.ContentType = httpContext.Request.ContentType; httpContext.Response.Headers["SOAPAction"] = faultMessage.Headers.Action; From eb9ac77ac6a9a40be522de06fbccb2e43fcc1cf9 Mon Sep 17 00:00:00 2001 From: Dariusz Uchman Date: Tue, 28 Apr 2020 08:25:14 +0200 Subject: [PATCH 2/3] Fixed implementations of IFaultExceptionTransformer --- .../FaultExceptionTransformer/TestFaultExceptionTransformer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SoapCore.Tests/FaultExceptionTransformer/TestFaultExceptionTransformer.cs b/src/SoapCore.Tests/FaultExceptionTransformer/TestFaultExceptionTransformer.cs index 1cb67906..8f53b516 100644 --- a/src/SoapCore.Tests/FaultExceptionTransformer/TestFaultExceptionTransformer.cs +++ b/src/SoapCore.Tests/FaultExceptionTransformer/TestFaultExceptionTransformer.cs @@ -9,7 +9,7 @@ namespace SoapCore.Tests.FaultExceptionTransformer { public class TestFaultExceptionTransformer : IFaultExceptionTransformer { - public Message ProvideFault(Exception exception, MessageVersion messageVersion, XmlNamespaceManager xmlNamespaceManager) + public Message ProvideFault(Exception exception, MessageVersion messageVersion, Message requestMessage, XmlNamespaceManager xmlNamespaceManager) { var fault = new TestFault { From 66e013bb33e8c9f7c31c81731a43d35b05b2ff10 Mon Sep 17 00:00:00 2001 From: Kotov Alexander Date: Wed, 29 Apr 2020 10:52:40 +0300 Subject: [PATCH 3/3] 1.1.0.0-alpha --- src/SoapCore/SoapCore.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SoapCore/SoapCore.csproj b/src/SoapCore/SoapCore.csproj index 72220df2..c3dd4b88 100644 --- a/src/SoapCore/SoapCore.csproj +++ b/src/SoapCore/SoapCore.csproj @@ -2,7 +2,7 @@ SOAP protocol middleware for ASP.NET Core - 1.0.0.4-alpha + 1.1.0.0-alpha Digital Design netcoreapp3.0;netstandard2.0;netcoreapp2.1;netcoreapp3.1 SoapCore @@ -14,7 +14,7 @@ false false false - 1.0.0.4-alpha + 1.1.0.0-alpha false SoapCore.snk true