ActionNotSupportedException.cs 1.3 KB

1234567891011121314151617181920212223242526272829
  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. public class ActionNotSupportedException : CommunicationException
  12. {
  13. public ActionNotSupportedException() { }
  14. public ActionNotSupportedException(string message) : base(message) { }
  15. public ActionNotSupportedException(string message, Exception innerException) : base(message, innerException) { }
  16. protected ActionNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
  17. internal Message ProvideFault(MessageVersion messageVersion)
  18. {
  19. Fx.Assert(messageVersion.Addressing != AddressingVersion.None, "");
  20. FaultCode code = FaultCode.CreateSenderFaultCode(AddressingStrings.ActionNotSupported, messageVersion.Addressing.Namespace);
  21. string reason = this.Message;
  22. return System.ServiceModel.Channels.Message.CreateMessage(
  23. messageVersion, code, reason, messageVersion.Addressing.FaultAction);
  24. }
  25. }
  26. }