ActionMismatchAddressingException.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.ServiceModel
  5. {
  6. using System;
  7. using System.Runtime;
  8. using System.Runtime.Serialization;
  9. using System.ServiceModel.Channels;
  10. [Serializable]
  11. internal class ActionMismatchAddressingException : ProtocolException
  12. {
  13. string httpActionHeader;
  14. string soapActionHeader;
  15. public ActionMismatchAddressingException(string message, string soapActionHeader, string httpActionHeader)
  16. : base(message)
  17. {
  18. this.httpActionHeader = httpActionHeader;
  19. this.soapActionHeader = soapActionHeader;
  20. }
  21. protected ActionMismatchAddressingException(SerializationInfo info, StreamingContext context)
  22. : base(info, context)
  23. {
  24. }
  25. public string HttpActionHeader
  26. {
  27. get
  28. {
  29. return httpActionHeader;
  30. }
  31. }
  32. public string SoapActionHeader
  33. {
  34. get
  35. {
  36. return soapActionHeader;
  37. }
  38. }
  39. internal Message ProvideFault(MessageVersion messageVersion)
  40. {
  41. Fx.Assert(messageVersion.Addressing == AddressingVersion.WSAddressing10, "");
  42. WSAddressing10ProblemHeaderQNameFault phf = new WSAddressing10ProblemHeaderQNameFault(this);
  43. Message message = System.ServiceModel.Channels.Message.CreateMessage(messageVersion, phf, messageVersion.Addressing.FaultAction);
  44. phf.AddHeaders(message.Headers);
  45. return message;
  46. }
  47. }
  48. }