SoapServerMessage.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //
  2. // System.Web.Services.Protocols.SoapServerMessage.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Lluis Sanchez Gual ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2002
  9. //
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. using System.Web.Services;
  31. using System.IO;
  32. namespace System.Web.Services.Protocols {
  33. public sealed class SoapServerMessage : SoapMessage {
  34. #region Fields
  35. string action;
  36. SoapMethodStubInfo stubInfo;
  37. object server;
  38. string url;
  39. object[] parameters;
  40. #endregion
  41. #region Constructors
  42. internal SoapServerMessage (HttpRequest request, object server, Stream stream)
  43. : base (stream, null)
  44. {
  45. this.action = request.Headers ["SOAPAction"];
  46. this.server = server;
  47. this.url = request.Url.ToString();
  48. }
  49. internal SoapServerMessage (HttpRequest request, SoapException exception, SoapMethodStubInfo stubInfo, object server, Stream stream)
  50. : base (stream, exception)
  51. {
  52. this.action = request.Headers ["SOAPAction"];
  53. this.stubInfo = stubInfo;
  54. this.server = server;
  55. this.url = request.Url.ToString();
  56. }
  57. #endregion
  58. #region Properties
  59. public override LogicalMethodInfo MethodInfo {
  60. get { return stubInfo.MethodInfo; }
  61. }
  62. public override string Action {
  63. get { return action; }
  64. }
  65. internal SoapMethodStubInfo MethodStubInfo {
  66. get { return stubInfo; }
  67. set { stubInfo = value; }
  68. }
  69. public override bool OneWay {
  70. get { return stubInfo.OneWay; }
  71. }
  72. public object Server {
  73. get { return server; }
  74. }
  75. public override string Url {
  76. get { return url; }
  77. }
  78. #if NET_2_0
  79. [MonoTODO]
  80. [System.Runtime.InteropServices.ComVisible(false)]
  81. public override SoapProtocolVersion SoapVersion {
  82. get { throw new NotImplementedException (); }
  83. }
  84. #endif
  85. #endregion // Properties
  86. #region Methods
  87. protected override void EnsureInStage ()
  88. {
  89. EnsureStage (SoapMessageStage.AfterDeserialize);
  90. }
  91. protected override void EnsureOutStage ()
  92. {
  93. EnsureStage (SoapMessageStage.BeforeSerialize);
  94. }
  95. #endregion // Methods
  96. }
  97. }