Last active
August 29, 2015 14:01
Revisions
-
woehrl01 revised this gist
May 23, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ /* Small snipped to transform a ServiceException into a SoapException if called from a SoapClient. * So you don't have to check the ReturnCode value of ResponseStatus for errors. * Feel free to use, edit, share, improve this one. */ -
woehrl01 revised this gist
May 23, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ /* Small snipped to transform a ServiceException into a SoapException if called from a SoapClient. * Feel free to use, edit, share, improve this one. */ using System.ServiceModel; public override void Configure(Funq.Container funq) -
woehrl01 created this gist
May 23, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ using System.ServiceModel; public override void Configure(Funq.Container funq) { ServiceExceptionHandlers.Add((req, request, ex) => { var requestMsg = req.GetItem("SoapMessage") as System.ServiceModel.Channels.Message; if (requestMsg != null) { var msgVersion = requestMsg.Version; using (var response = XmlWriter.Create(req.Response.OutputStream)) { var message = System.ServiceModel.Channels.Message.CreateMessage(msgVersion, new FaultCode("Receiver"), ex.ToString(), null); message.WriteMessage(response); } req.Response.End(); } return null; });