HttpPostProtocolReflector.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // System.Web.Services.Description.HttpPostProtocolReflector.cs
  3. //
  4. // Author:
  5. // Lluis Sanchez Gual ([email protected])
  6. //
  7. // (C) 2003 Ximian, Inc.
  8. //
  9. using System.Web.Services;
  10. using System.Web.Services.Protocols;
  11. using System.Xml.Serialization;
  12. using System.Xml;
  13. namespace System.Web.Services.Description {
  14. internal class HttpPostProtocolReflector : HttpSimpleProtocolReflector
  15. {
  16. #region Constructors
  17. public HttpPostProtocolReflector ()
  18. {
  19. }
  20. #endregion // Constructors
  21. #region Properties
  22. public override string ProtocolName {
  23. get { return "HttpPost"; }
  24. }
  25. #endregion // Properties
  26. #region Methods
  27. protected override void BeginClass ()
  28. {
  29. base.BeginClass ();
  30. HttpBinding hb = new HttpBinding ();
  31. hb.Verb = "POST";
  32. Binding.Extensions.Add (hb);
  33. }
  34. protected override bool ReflectMethod ()
  35. {
  36. if (!base.ReflectMethod ()) return false;
  37. MimeContentBinding mcb = new MimeContentBinding ();
  38. mcb.Type = "application/x-www-form-urlencoded";
  39. OperationBinding.Input.Extensions.Add (mcb);
  40. return true;
  41. }
  42. #endregion
  43. }
  44. }