HttpGetClientProtocol.cs 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // System.Web.Services.Protocols.HttpGetClientProtocol.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. using System.Net;
  10. using System.Web.Services;
  11. namespace System.Web.Services.Protocols {
  12. public class HttpGetClientProtocol : HttpSimpleClientProtocol {
  13. #region Constructors
  14. public HttpGetClientProtocol ()
  15. {
  16. TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpGet");
  17. }
  18. #endregion // Constructors
  19. #region Methods
  20. protected override WebRequest GetWebRequest (Uri uri)
  21. {
  22. if (uri == null)
  23. throw new InvalidOperationException ("The uri parameter is null.");
  24. if (uri.ToString () == String.Empty)
  25. throw new InvalidOperationException ("The uri parameter has a length of zero.");
  26. WebRequest request = WebRequest.Create (uri);
  27. request.Method = "GET";
  28. return request;
  29. }
  30. #endregion // Methods
  31. }
  32. }