| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Runtime.Serialization; |
| | | 6 | | using CoreWCF.Channels; |
| | | 7 | | using CoreWCF.Runtime; |
| | | 8 | | |
| | | 9 | | namespace CoreWCF |
| | | 10 | | { |
| | | 11 | | [Serializable] |
| | | 12 | | internal class ActionMismatchAddressingException : ProtocolException |
| | | 13 | | { |
| | | 14 | | private readonly string _httpActionHeader; |
| | | 15 | | private readonly string _soapActionHeader; |
| | | 16 | | |
| | | 17 | | public ActionMismatchAddressingException(string message, string soapActionHeader, string httpActionHeader) |
| | 1 | 18 | | : base(message) |
| | | 19 | | { |
| | 1 | 20 | | _httpActionHeader = httpActionHeader; |
| | 1 | 21 | | _soapActionHeader = soapActionHeader; |
| | 1 | 22 | | } |
| | | 23 | | |
| | | 24 | | protected ActionMismatchAddressingException(SerializationInfo info, StreamingContext context) |
| | 0 | 25 | | : base(info, context) |
| | | 26 | | { |
| | 0 | 27 | | } |
| | | 28 | | |
| | | 29 | | public string HttpActionHeader |
| | | 30 | | { |
| | | 31 | | get |
| | | 32 | | { |
| | 0 | 33 | | return _httpActionHeader; |
| | | 34 | | } |
| | | 35 | | } |
| | | 36 | | |
| | | 37 | | public string SoapActionHeader |
| | | 38 | | { |
| | | 39 | | get |
| | | 40 | | { |
| | 0 | 41 | | return _soapActionHeader; |
| | | 42 | | } |
| | | 43 | | } |
| | | 44 | | |
| | | 45 | | internal Message ProvideFault(MessageVersion messageVersion) |
| | | 46 | | { |
| | | 47 | | Fx.Assert(messageVersion.Addressing == AddressingVersion.WSAddressing10, ""); |
| | 0 | 48 | | WSAddressing10ProblemHeaderQNameFault phf = new WSAddressing10ProblemHeaderQNameFault(this); |
| | 0 | 49 | | Message message = Channels.Message.CreateMessage(messageVersion, phf, messageVersion.Addressing.FaultAction) |
| | 0 | 50 | | phf.AddHeaders(message.Headers); |
| | 0 | 51 | | return message; |
| | | 52 | | } |
| | | 53 | | } |
| | | 54 | | } |