2006-12-12 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / WebReference.cs
index 2c997a5ec478f82b7b3aad14b48516fe8b61d351..ef41cefdb7b161bf070b65ee9e5f6cbcbce51cf2 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.Web.Services.Discovery;
 using System.Collections.Specialized;
 using System.CodeDom;
 
 namespace System.Web.Services.Description 
 {
-       public sealed class WebReference
+#if NET_2_0
+       public
+#else
+       internal
+#endif
+       sealed class WebReference
        {
                DiscoveryClientDocumentCollection _documents;
+#if !TARGET_J2EE
                CodeNamespace _proxyCode;
+#endif
                ServiceDescriptionImportWarnings _warnings;
                string _protocolName;
                string _appSettingUrlKey;
                string _appSettingBaseUrl;
+               StringCollection _validationWarnings;
                
+#if !TARGET_J2EE
                public WebReference (DiscoveryClientDocumentCollection documents, CodeNamespace proxyCode)
                {
                        if (documents == null) throw new ArgumentNullException ("documents");
@@ -54,6 +61,11 @@ namespace System.Web.Services.Description
                        _proxyCode = proxyCode;
                }
                
+               public WebReference (DiscoveryClientDocumentCollection documents, CodeNamespace proxyCode, string appSettingUrlKey, string appSettingBaseUrl)
+                       : this (documents, proxyCode, String.Empty, appSettingUrlKey, appSettingBaseUrl)
+               {
+               }
+               
                public WebReference (DiscoveryClientDocumentCollection documents, CodeNamespace proxyCode, string protocolName, string appSettingUrlKey, string appSettingBaseUrl)
                {
                        if (documents == null) throw new ArgumentNullException ("documents");
@@ -65,7 +77,7 @@ namespace System.Web.Services.Description
                        _appSettingUrlKey = appSettingUrlKey;
                        _appSettingBaseUrl = appSettingBaseUrl;
                }
-               
+#endif         
                public string AppSettingBaseUrl {
                        get { return _appSettingBaseUrl; }
                }
@@ -82,21 +94,27 @@ namespace System.Web.Services.Description
                        get { return _protocolName; }
                        set { _protocolName = value; }
                }
-
+#if !TARGET_J2EE
                public CodeNamespace ProxyCode {
                        get { return _proxyCode; }
                }
-
-               [MonoTODO]
+#endif
                public StringCollection ValidationWarnings {
-                       get { throw new NotImplementedException (); }
+                       get { 
+                               if (_validationWarnings == null) _validationWarnings = new StringCollection ();
+                               return _validationWarnings; 
+                       }
                }
 
                public ServiceDescriptionImportWarnings Warnings {
                        get { return _warnings; }
                        set { _warnings = value; }
                }
+               
+               internal void SetValidationWarnings (StringCollection col)
+               {
+                       _validationWarnings = col;
+               }
        }
 }
 
-#endif