2 // System.Web.Services.Description.WebReference.cs
5 // Lluis Sanchez (lluis@novell.com)
7 // Copyright (C) Novell, Inc., 2004
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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.
31 using System.Web.Services.Discovery;
32 using System.Collections.Specialized;
35 namespace System.Web.Services.Description
42 sealed class WebReference
44 DiscoveryClientDocumentCollection _documents;
46 CodeNamespace _proxyCode;
48 ServiceDescriptionImportWarnings _warnings;
50 string _appSettingUrlKey;
51 string _appSettingBaseUrl;
52 StringCollection _validationWarnings;
55 public WebReference (DiscoveryClientDocumentCollection documents, CodeNamespace proxyCode)
57 if (documents == null) throw new ArgumentNullException ("documents");
58 if (proxyCode == null) throw new ArgumentNullException ("proxyCode");
60 _documents = documents;
61 _proxyCode = proxyCode;
64 public WebReference (DiscoveryClientDocumentCollection documents, CodeNamespace proxyCode, string protocolName, string appSettingUrlKey, string appSettingBaseUrl)
66 if (documents == null) throw new ArgumentNullException ("documents");
67 if (proxyCode == null) throw new ArgumentNullException ("proxyCode");
69 _documents = documents;
70 _proxyCode = proxyCode;
71 _protocolName = protocolName;
72 _appSettingUrlKey = appSettingUrlKey;
73 _appSettingBaseUrl = appSettingBaseUrl;
76 public string AppSettingBaseUrl {
77 get { return _appSettingBaseUrl; }
80 public string AppSettingUrlKey {
81 get { return _appSettingUrlKey; }
84 public DiscoveryClientDocumentCollection Documents {
85 get { return _documents; }
88 public string ProtocolName {
89 get { return _protocolName; }
90 set { _protocolName = value; }
93 public CodeNamespace ProxyCode {
94 get { return _proxyCode; }
97 public StringCollection ValidationWarnings {
99 if (_validationWarnings == null) _validationWarnings = new StringCollection ();
100 return _validationWarnings;
104 public ServiceDescriptionImportWarnings Warnings {
105 get { return _warnings; }
106 set { _warnings = value; }
109 internal void SetValidationWarnings (StringCollection col)
111 _validationWarnings = col;