+2002-07-23 Tim Coleman <tim@timcoleman.com>
+ * HttpGetClientProtocol.cs:
+ * HttpPostClientProtocol.cs
+ Implemented the GetWebRequest method
+ * HttpSimpleClientProtocol:
+ Some implementation of the EndInvoke method
+ * HttpWebClientProtocol.cs:
+ Set the UserAgent string appropriately
+ Implemented the GetWebRequest method
+ Implemented the GetWebResponse methods
+ * SoapHttpClientProtocol.cs:
+ Removed unused fields
+ Implemented the GetWebRequest method
+ * SoapMessage.cs:
+ Implemented the EnsureStage method
+ * WebClientProtocol.cs:
+ Added a static constructor to construct the cache
+ Implemented the Abort method
+ Implemented the AddToCache, GetFromCache methods
+ Implemented the GetWebRequest method
+ Implemented the GetWebResponse methods
+
2002-07-23 Tim Coleman <tim@timcoleman.com>
* LogicalMethodTypes.cs:
* SoapHeaderDirection.cs:
\r
#region Methods\r
\r
- [MonoTODO]\r
protected override WebRequest GetWebRequest (Uri uri)\r
{\r
- throw new NotImplementedException ();\r
+ if (uri == null)\r
+ throw new InvalidOperationException ("The uri parameter is null.");\r
+ if (uri.ToString () == String.Empty)\r
+ throw new InvalidOperationException ("The uri parameter has a length of zero.");\r
+ return WebRequest.Create (uri);\r
}\r
\r
#endregion // Methods\r
\r
#region Methods\r
\r
- [MonoTODO]\r
protected override WebRequest GetWebRequest (Uri uri)\r
{\r
- throw new NotImplementedException ();\r
+ if (null == uri)\r
+ throw new InvalidOperationException ("The uri parameter is a null reference.");\r
+ if (String.Empty == uri.ToString ())\r
+ throw new InvalidOperationException ("The uri parameter has a length of zero.");\r
+ return WebRequest.Create (uri);\r
}\r
\r
#endregion // Methods\r
namespace System.Web.Services.Protocols {\r
public abstract class HttpSimpleClientProtocol : HttpWebClientProtocol {\r
\r
+ #region Fields\r
+\r
+ IAsyncResult result;\r
+\r
+ #endregion // Fields\r
+\r
#region Constructors\r
\r
protected HttpSimpleClientProtocol () \r
[MonoTODO]\r
protected object EndInvoke (IAsyncResult asyncResult)\r
{\r
+ if (asyncResult != result)\r
+ throw new ArgumentException ("asyncResult is not the return value from BeginInvoke");\r
throw new NotImplementedException ();\r
}\r
\r
// Copyright (C) Tim Coleman, 2002\r
//\r
\r
+using System;\r
using System.ComponentModel;\r
using System.Net;\r
using System.Security.Cryptography.X509Certificates;\r
+using System.Threading;\r
using System.Web.Services;\r
\r
namespace System.Web.Services.Protocols {\r
clientCertificates = new X509CertificateCollection ();\r
cookieContainer = null;\r
proxy = null; // FIXME\r
- userAgent = "Mono Web Services Client Protocol 1.0.1234.0"; // FIXME\r
+ userAgent = String.Format ("Mono Web Services Client Protocol {0}", Environment.Version);\r
}\r
\r
#endregion // Constructors\r
\r
#region Methods\r
\r
- [MonoTODO]\r
protected override WebRequest GetWebRequest (Uri uri)\r
{\r
- throw new NotImplementedException ();\r
+ if (null == uri)\r
+ throw new InvalidOperationException ("The uri parameter is a null reference.");\r
+ return WebRequest.Create (uri);\r
}\r
\r
- [MonoTODO]\r
protected override WebResponse GetWebResponse (WebRequest request)\r
{\r
- throw new NotImplementedException ();\r
+ return request.GetResponse ();\r
}\r
\r
- [MonoTODO]\r
protected override WebResponse GetWebResponse (WebRequest request, IAsyncResult result)\r
{\r
- throw new NotImplementedException ();\r
+ IAsyncResult ar = request.BeginGetResponse (null, null);\r
+ ar.AsyncWaitHandle.WaitOne ();\r
+ return request.EndGetResponse (result);\r
}\r
\r
#endregion // Methods\r
//\r
\r
using System.Net;\r
-using System.Security.Cryptography.X509Certificates;\r
+using System.Web;\r
using System.Web.Services;\r
\r
namespace System.Web.Services.Protocols {\r
public class SoapHttpClientProtocol : HttpWebClientProtocol {\r
\r
- #region Fields\r
-\r
- bool allowAutoRedirect;\r
- X509CertificateCollection clientCertificates;\r
- CookieContainer cookieContainer;\r
- IWebProxy proxy;\r
- string userAgent;\r
-\r
- #endregion\r
-\r
#region Constructors\r
\r
public SoapHttpClientProtocol () \r
throw new NotImplementedException ();\r
}\r
\r
- [MonoTODO]\r
protected override WebRequest GetWebRequest (Uri uri)\r
{\r
- throw new NotImplementedException ();\r
+ return WebRequest.Create (uri);\r
}\r
\r
[MonoTODO]\r
protected abstract void EnsureInStage ();\r
protected abstract void EnsureOutStage ();\r
\r
- [MonoTODO]\r
protected void EnsureStage (SoapMessageStage stage) \r
{\r
- throw new NotImplementedException ();\r
+ if ((((int) stage) & ((int) Stage)) == 0)\r
+ throw new InvalidOperationException ("The current SoapMessageStage is not the asserted stage or stages.");\r
}\r
\r
[MonoTODO]\r
// Copyright (C) Tim Coleman, 2002\r
//\r
\r
+using System.Collections.Specialized;\r
using System.ComponentModel;\r
using System.Net;\r
using System.Text;\r
+using System.Threading;\r
using System.Web.Services;\r
\r
namespace System.Web.Services.Protocols {\r
Encoding requestEncoding;\r
int timeout;\r
string url;\r
+ bool abort;\r
+ static HybridDictionary cache;\r
\r
#endregion\r
\r
#region Constructors\r
\r
+ static WebClientProtocol ()\r
+ {\r
+ cache = new HybridDictionary ();\r
+ }\r
+\r
protected WebClientProtocol () \r
{\r
connectionGroupName = String.Empty;\r
requestEncoding = null;\r
timeout = 100000;\r
url = String.Empty;\r
+ abort = false;\r
}\r
\r
#endregion // Constructors\r
\r
#region Methods\r
\r
- [MonoTODO]\r
public virtual void Abort ()\r
{\r
- throw new NotImplementedException ();\r
+ abort = true;\r
}\r
\r
- [MonoTODO]\r
protected static void AddToCache (Type type, object value)\r
{\r
- throw new NotImplementedException ();\r
+ cache [type] = value;\r
}\r
\r
- [MonoTODO]\r
protected static object GetFromCache (Type type)\r
{\r
- throw new NotImplementedException ();\r
+ return cache [type];\r
}\r
\r
- [MonoTODO]\r
protected virtual WebRequest GetWebRequest (Uri uri)\r
{\r
- throw new NotImplementedException ();\r
+ return WebRequest.Create (uri);\r
}\r
\r
- [MonoTODO]\r
protected virtual WebResponse GetWebResponse (WebRequest request)\r
{\r
- throw new NotImplementedException ();\r
+ if (abort)\r
+ throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
+ return request.GetResponse ();\r
}\r
\r
- [MonoTODO]\r
protected virtual WebResponse GetWebResponse (WebRequest request, IAsyncResult result)\r
{\r
- throw new NotImplementedException ();\r
+ if (abort)\r
+ throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
+\r
+ IAsyncResult ar = request.BeginGetResponse (null, null);\r
+ ar.AsyncWaitHandle.WaitOne ();\r
+ return request.EndGetResponse (result);\r
}\r
\r
#endregion // Methods\r