SoapFault.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // System.Runtime.Serialization.Formatters.SoapFault.cs
  3. //
  4. // Author: Duncan Mak ([email protected])
  5. //
  6. // 2002 (C) Copyright, Ximian, Inc.
  7. //
  8. using System;
  9. using System.Runtime.Serialization;
  10. namespace System.Runtime.Serialization.Formatters {
  11. [Serializable]
  12. public sealed class SoapFault : ISerializable
  13. {
  14. string code;
  15. string actor;
  16. string faultString;
  17. ServerFault serverFault;
  18. [MonoTODO]
  19. public SoapFault ()
  20. {
  21. throw new NotImplementedException ();
  22. }
  23. private SoapFault (SerializationInfo info, StreamingContext context)
  24. {
  25. FaultCode = info.GetString ("faultcode");
  26. FaultString = info.GetString ("faultstring");
  27. Detail = info.GetValue ("detail", typeof (object));
  28. }
  29. public SoapFault (string faultCode, string faultString,
  30. string faultActor, ServerFault serverFault)
  31. {
  32. this.code = faultCode;
  33. this.actor = faultActor;
  34. this.faultString = faultString;
  35. this.serverFault = serverFault;
  36. }
  37. [MonoTODO]
  38. public object Detail {
  39. get { throw new NotImplementedException (); }
  40. set { throw new NotImplementedException (); }
  41. }
  42. public string FaultActor {
  43. get { return actor; }
  44. set { actor = value; }
  45. }
  46. public string FaultCode {
  47. get { return code; }
  48. set { code = value; }
  49. }
  50. public string FaultString {
  51. get { return faultString; }
  52. set { faultString = value; }
  53. }
  54. public void GetObjectData (SerializationInfo info,
  55. StreamingContext context)
  56. {
  57. info.AddValue ("faultcode", FaultCode, typeof (string));
  58. info.AddValue ("faultstring", FaultString, typeof (string));
  59. info.AddValue ("detail", Detail, typeof (object));
  60. }
  61. }
  62. }