merged from trunk.
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 28 Nov 2006 08:36:14 +0000 (08:36 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 28 Nov 2006 08:36:14 +0000 (08:36 -0000)
svn path=/branches/atsushi/mcs/; revision=68566

146 files changed:
mcs/class/System.Web.Services/System.Web.Services.Configuration/XmlFormatExtensionAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Configuration/XmlFormatExtensionPointAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Configuration/XmlFormatExtensionPrefixAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Description/BasicProfileChecker.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Binding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/BindingCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
mcs/class/System.Web.Services/System.Web.Services.Description/DocumentableItem.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ExtensionManager.cs
mcs/class/System.Web.Services/System.Web.Services.Description/FaultBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/FaultBindingCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/HttpAddressBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/HttpBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/HttpOperationBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/HttpUrlEncodedBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/HttpUrlReplacementBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Import.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ImportCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/InputBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Message.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MessageBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MessageCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MessagePart.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MessagePartCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimeMultipartRelatedBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimePart.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimePartCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimeTextBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimeTextMatch.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimeTextMatchCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/MimeXmlBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Operation.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationBindingCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationFault.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationFaultCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationFlow.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationInput.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationMessage.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationMessageCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OperationOutput.cs
mcs/class/System.Web.Services/System.Web.Services.Description/OutputBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Port.cs
mcs/class/System.Web.Services/System.Web.Services.Description/PortCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/PortType.cs
mcs/class/System.Web.Services/System.Web.Services.Description/PortTypeCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Service.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescription.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionBaseCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionFormatExtension.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImportStyle.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImportWarnings.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImporter.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionReflector.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Soap12AddressBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Soap12Binding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapAddressBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapBindingStyle.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapBindingUse.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapBodyBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapExtensionImporter.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapExtensionReflector.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapFaultBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapHeaderBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapHeaderFaultBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/SoapOperationBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Description/Types.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/ContractReference.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/ContractSearchPattern.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryClientDocumentCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryClientReferenceCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryClientResult.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryClientResultCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryDocument.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryDocumentLinksPattern.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryDocumentReference.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryDocumentSearchPattern.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryExceptionDictionary.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryReference.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryReferenceCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoveryRequestHandler.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DiscoverySearchPattern.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/DynamicDiscoveryDocument.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/ExcludePathInfo.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/SchemaReference.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/SoapBinding.cs
mcs/class/System.Web.Services/System.Web.Services.Discovery/XmlSchemaSearchPattern.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/AnyReturnReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HtmlFormParameterReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HtmlFormParameterWriter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpGetClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpMethodAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpPostClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSimpleClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/LogicalMethodInfo.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/LogicalMethodTypes.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/MatchAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/MimeFormatter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/MimeParameterReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/MimeParameterWriter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/MimeReturnReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/MimeReturnWriter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/NopReturnReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/PatternMatcher.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapClientMessage.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapClientMethod.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentMethodAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentServiceAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapException.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapExtension.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapExtensionAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderDirection.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHeaderException.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapMessage.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapMessageStage.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapParameterStyle.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapRpcMethodAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapRpcServiceAttribute.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapServerMessage.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapServiceRoutingStyle.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapUnknownHeader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/TextReturnReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/UrlEncodedParameterWriter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/UrlParameterReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/UrlParameterWriter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/ValueCollectionParameterReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientAsyncResult.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnReader.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnWriter.cs
mcs/class/System.Web.Services/System.Web.Services/WebMethodAttribute.cs
mcs/class/System.Web.Services/System.Web.Services/WebService.cs
mcs/class/System.Web.Services/System.Web.Services/WebServiceAttribute.cs
mcs/class/System.Web.Services/System.Web.Services/WebServiceBindingAttribute.cs
mcs/class/System.Web.Services/System.Web.Services/WebServicesDescriptionAttribute.cs

index ec4f056566a7540062e0509a34e07963d8f9ffe4..4eb0eeb5302f1ace46ed9284b1430ad864db8a9d 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.Configuration.XmlFormatExtensionAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.Configuration.XmlFormatExtensionAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Configuration {\r
-       [AttributeUsage (AttributeTargets.Class, Inherited = true)]\r
-       public sealed class XmlFormatExtensionAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               string elementName;\r
-               string ns;\r
-               Type[] extensionPoints;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public XmlFormatExtensionAttribute ()\r
-               {\r
-               }\r
-\r
-               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1)\r
-                       : this (elementName, ns, new Type[1] {extensionPoint1})\r
-               {\r
-               }\r
-\r
-               public XmlFormatExtensionAttribute (string elementName, string ns, Type[] extensionPoints)\r
-                       : this ()\r
-               {\r
-                       this.elementName = elementName;\r
-                       this.ns = ns;\r
-                       this.extensionPoints = extensionPoints;\r
-               }\r
-\r
-               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1, Type extensionPoint2)\r
-                       : this (elementName, ns, new Type[2] {extensionPoint1, extensionPoint2})\r
-               {\r
-               }\r
-\r
-               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3)\r
-                       : this (elementName, ns, new Type[3] {extensionPoint1, extensionPoint2, extensionPoint3})\r
-               {\r
-               }\r
-\r
-               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3, Type extensionPoint4)\r
-                       : this (elementName, ns, new Type[4] {extensionPoint1, extensionPoint2, extensionPoint3, extensionPoint4})\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string ElementName {\r
-                       get { return elementName; }\r
-                       set { elementName = value; }\r
-               }\r
-\r
-               public Type[] ExtensionPoints {\r
-                       get { return extensionPoints; }\r
-                       set { extensionPoints = value; }\r
-               }\r
-\r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services.Configuration {
+       [AttributeUsage (AttributeTargets.Class, Inherited = true)]
+       public sealed class XmlFormatExtensionAttribute : Attribute {
+
+               #region Fields
+
+               string elementName;
+               string ns;
+               Type[] extensionPoints;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public XmlFormatExtensionAttribute ()
+               {
+               }
+
+               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1)
+                       : this (elementName, ns, new Type[1] {extensionPoint1})
+               {
+               }
+
+               public XmlFormatExtensionAttribute (string elementName, string ns, Type[] extensionPoints)
+                       : this ()
+               {
+                       this.elementName = elementName;
+                       this.ns = ns;
+                       this.extensionPoints = extensionPoints;
+               }
+
+               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1, Type extensionPoint2)
+                       : this (elementName, ns, new Type[2] {extensionPoint1, extensionPoint2})
+               {
+               }
+
+               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3)
+                       : this (elementName, ns, new Type[3] {extensionPoint1, extensionPoint2, extensionPoint3})
+               {
+               }
+
+               public XmlFormatExtensionAttribute (string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3, Type extensionPoint4)
+                       : this (elementName, ns, new Type[4] {extensionPoint1, extensionPoint2, extensionPoint3, extensionPoint4})
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public string ElementName {
+                       get { return elementName; }
+                       set { elementName = value; }
+               }
+
+               public Type[] ExtensionPoints {
+                       get { return extensionPoints; }
+                       set { extensionPoints = value; }
+               }
+
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index 754881f9929af8c852801478e667a8d2ff4d1543..8292f18dedc1dccc94a9be015b2090f34a5fe8d3 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.Configuration.XmlFormatExtensionPointAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.Configuration.XmlFormatExtensionPointAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Configuration {\r
-       [AttributeUsage (AttributeTargets.Class, Inherited = true)]\r
-       public sealed class XmlFormatExtensionPointAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               bool allowElements;\r
-               string memberName;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public XmlFormatExtensionPointAttribute (string memberName)\r
-               {\r
-                       this.memberName = memberName;\r
-                       allowElements = true;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public bool AllowElements {\r
-                       get { return allowElements; }\r
-                       set { allowElements = value; }\r
-               }\r
-\r
-               public string MemberName {      \r
-                       get { return memberName; }\r
-                       set { memberName = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
+
+namespace System.Web.Services.Configuration {
+       [AttributeUsage (AttributeTargets.Class, Inherited = true)]
+       public sealed class XmlFormatExtensionPointAttribute : Attribute {
+
+               #region Fields
+
+               bool allowElements;
+               string memberName;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public XmlFormatExtensionPointAttribute (string memberName)
+               {
+                       this.memberName = memberName;
+                       allowElements = true;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public bool AllowElements {
+                       get { return allowElements; }
+                       set { allowElements = value; }
+               }
+
+               public string MemberName {      
+                       get { return memberName; }
+                       set { memberName = value; }
+               }
+
+               #endregion // Properties
+       }
 }
index 00007929c3cb1c0b0e0dc964eb6e37ef0987a974..4fb5f988da21270e9d13aba0df3c368a7029d052 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.Configuration.XmlFormatExtensionPrefixAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.Configuration.XmlFormatExtensionPrefixAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Configuration {\r
-       [AttributeUsage (AttributeTargets.Class, AllowMultiple = true, Inherited = true)]\r
-       public sealed class XmlFormatExtensionPrefixAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               string prefix;\r
-               string ns;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public XmlFormatExtensionPrefixAttribute ()\r
-               {\r
-               }\r
-\r
-               public XmlFormatExtensionPrefixAttribute (string prefix, string ns)\r
-                       : this ()\r
-               {\r
-                       this.prefix = prefix;\r
-                       this.ns = ns;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Prefix {\r
-                       get { return prefix; }\r
-                       set { prefix = value; }\r
-               }\r
-\r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services.Configuration {
+       [AttributeUsage (AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
+       public sealed class XmlFormatExtensionPrefixAttribute : Attribute {
+
+               #region Fields
+
+               string prefix;
+               string ns;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public XmlFormatExtensionPrefixAttribute ()
+               {
+               }
+
+               public XmlFormatExtensionPrefixAttribute (string prefix, string ns)
+                       : this ()
+               {
+                       this.prefix = prefix;
+                       this.ns = ns;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public string Prefix {
+                       get { return prefix; }
+                       set { prefix = value; }
+               }
+
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index d6497f6c699fd5b8f7faffe30dffeefe8c6f237b..62c4e4e4a6f243450f6b6805d3f2115ef2da65de 100644 (file)
@@ -3,6 +3,7 @@
 //
 // Author:
 //   Lluis Sanchez (lluis@novell.com)
+//   Atsushi Enomoto (atsushi@ximian.com)
 //
 // Copyright (C) Novell, Inc., 2004
 //
@@ -31,6 +32,7 @@
 #if NET_2_0
 
 using System.Xml.Schema;
+using System.Xml.Serialization;
 using System.Xml;
 using System.Collections;
 
@@ -71,7 +73,11 @@ namespace System.Web.Services.Description
                
                public override void Check (ConformanceCheckContext ctx, ServiceDescription value)
                {
-                       
+                       // R4005
+                       if (value.Namespaces != null)
+                               foreach (XmlQualifiedName qname in value.Namespaces.ToArray ())
+                                       if (qname.Namespace == "http://www.w3.org/XML/1998/namespace")
+                                               ctx.ReportRuleViolation (value, BasicProfileRules.R4005);
                }
                
                public override void Check (ConformanceCheckContext ctx, ServiceDescriptionFormatExtension value)
@@ -95,13 +101,16 @@ namespace System.Web.Services.Description
                
                public override void Check (ConformanceCheckContext ctx, Message value)
                {
-                       // TODO: R2113
                }
                
                public override void Check (ConformanceCheckContext ctx, Binding value)
                {
                        SoapBinding sb = (SoapBinding) value.Extensions.Find (typeof(SoapBinding));
-                       if (sb == null || sb.Transport == null || sb.Transport == "") {
+                       if (sb == null) {
+                               ctx.ReportRuleViolation (value, BasicProfileRules.R2401);
+                               return;
+                       }
+                       if (sb.Transport == null || sb.Transport == "") {
                                ctx.ReportRuleViolation (value, BasicProfileRules.R2701);
                                return;
                        }
@@ -402,64 +411,64 @@ namespace System.Web.Services.Description
        
        internal class BasicProfileRules
        {
-       
-       // 3.2 Conformance of Services, Consumers and Registries
-       
+               #region "Basic Profile 1.1 Section 4 (Service Description)"
+
+       // 4.1 Required Description
                // Can't check: R0001
-               
-       // 3.3 Conformance Annotation in Descriptions
-       
-               // Can't check: R0002, R0003
-       
-       // 3.4 Conformance Annotation in Messages
-       
-               // Can't check: R0004, R0005, R0006, R0007
-               
-       // 3.5 Conformance Annotation in Registry Data
-       
-               // UDDI related: R3020, R3030, R3021, R3005, R3004.
-               
-       // 4.1 XML Representation of SOAP Messages
-               
-               // Rules not related to service description
-               
-       // 4.2 SOAP Processing Model
-       
-               // Rules not related to service description
-               
-       // 4.3 Use of SOAP in HTTP
-       
-               // Rules not related to service description
-               
-       // 5.1 Document structure
-       
+
+       // 4.2 Document Structure
+
+               // R2028, R2029: schema conformance, depends on underlying XML
+
                public static readonly ConformanceRule R2001 = new ConformanceRule (
                        "R2001", 
                        "A DESCRIPTION MUST only use the WSDL \"import\" statement to import another WSDL description",
                        "");
-                       
+
+               // FIXME: R2803
+
                public static readonly ConformanceRule R2002 = new ConformanceRule (
                        "R2002", 
                        "To import XML Schema Definitions, a DESCRIPTION MUST use the XML Schema \"import\" statement",
                        "");
-                       
+
+               // R2003: depends on ServiceDescription raw XML.
+               // R2004, R2009, R2010, R2011: requires schema resolution
+
                public static readonly ConformanceRule R2007 = new ConformanceRule (
                        "R2007", 
                        "A DESCRIPTION MUST specify a non-empty location attribute on the wsdl:import element",
                        "");
-                       
+
+               // R2008: denotes a possibility that cannot be verified.
+
+               // R2022, R2023, R4004: depends on underlying XML
+
+               public static readonly ConformanceRule R4005 = new ConformanceRule (
+                       "R4005",
+                       "A DESCRIPTION SHOULD NOT contain the namespace declaration xmlns:xml=\"http://www.w3.org/XML/1998/namespace\"",
+                       "");
+
+               // R4002, R4003: depends on underlying XML
+
                public static readonly ConformanceRule R2005 = new ConformanceRule (
                        "R2005", 
                        "The targetNamespace attribute on the wsdl:definitions element of a description that is being imported MUST have same the value as the namespace attribute on the wsdl:import element in the importing DESCRIPTION",
                        "");
 
+               // R2030: is satisfied by API nature (DocumentableItem).
+
+               // R2025: cannot be checked.
+
                public static readonly ConformanceRule R2026 = new ConformanceRule (
                        "R2026", 
                        "A DESCRIPTION SHOULD NOT include extension elements with a wsdl:required attribute value of \"true\" on any WSDL construct (wsdl:binding,  wsdl:portType, wsdl:message, wsdl:types or wsdl:import) that claims conformance to the Profile",
                        "");
-                       
-       // 5.2 Types
-       
+
+               // R2027: is about the CONSUMER, cannot be checked.
+
+       // 4.3 Types
+
                public static readonly ConformanceRule R2101 = new ConformanceRule (
                        "R2101", 
                        "A DESCRIPTION MUST NOT use QName references to elements in namespaces that have been neither imported, nor defined in the referring WSDL document",
@@ -485,61 +494,69 @@ namespace System.Web.Services.Description
                        "In a DESCRIPTION, array declarations MUST NOT use wsdl:arrayType attribute in the type declaration",
                        "");
                        
-               // R2112: Suggestion.
-               // R2113: Not related to servide description
-               // R2114: Suggestion.
-               
-       // 5.3 Messages
+               // FIXME: R2112
+
+               // R2113: is about ENVELOPE.
+
+               // R2114: is satisfied by our processor.
+
+       // 4.4 Messages
        
                public static readonly ConformanceRule R2201 = new ConformanceRule (
                        "R2201", 
                        "A document-literal binding in a DESCRIPTION MUST, in each of its soapbind:body element(s), have at most one part listed in the parts attribute, if the parts attribute is specified",
                        "");
+
+               public static readonly ConformanceRule R2209 = new ConformanceRule (
+                       "R2209", 
+                       "A wsdl:binding in a DESCRIPTION SHOULD bind every wsdl:part of a wsdl:message in the wsdl:portType to which it refers to one of soapbind:body, soapbind:header, soapbind:fault  or soapbind:headerfault",
+                       "");
                
                public static readonly ConformanceRule R2210 = new ConformanceRule (
                        "R2210", 
                        "If a document-literal binding in a DESCRIPTION does not specify the parts attribute on a soapbind:body element, the corresponding abstract wsdl:message MUST define zero or one wsdl:parts",
                        "");
-               
+
+               // R2202: Suggestion.
+
                public static readonly ConformanceRule R2203 = new ConformanceRule (
                        "R2203", 
                        "An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute",
                        "");
-               
+
+               // R2211: Related to message structure
+               // R2207: Optional
+
                public static readonly ConformanceRule R2204 = new ConformanceRule (
                        "R2204", 
                        "A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute",
                        "");
-               
+
+               // R2208: Optional
+               // FIXME: R2212, R2213, R2214
+
                public static readonly ConformanceRule R2205 = new ConformanceRule (
                        "R2205", 
                        "A wsdl:binding in a DESCRIPTION MUST refer, in each of its soapbind:header, soapbind:headerfault and soapbind:fault elements, only to wsdl:part element(s) that have been defined using the element attribute",
                        "");
-               
-               public static readonly ConformanceRule R2209 = new ConformanceRule (
-                       "R2209", 
-                       "A wsdl:binding in a DESCRIPTION SHOULD bind every wsdl:part of a wsdl:message in the wsdl:portType to which it refers to one of soapbind:body, soapbind:header, soapbind:fault  or soapbind:headerfault",
-                       "");
-               
+
                public static readonly ConformanceRule R2206 = new ConformanceRule (
                        "R2206", 
                        "A wsdl:message in a DESCRIPTION containing a wsdl:part that uses the element attribute MUST refer, in that attribute, to a global element declaration",
                        "");
-               
-               // R2211: Related to message structure
-               // R2202: Suggestion.
-               // R2207: Optional
-               // R2208: Optional
-               
-       // 5.4 Port Types
-       
-               // TODO
-       
-       // 5.5 Bindings
-       
-               // TODO
-                       
-       // 5.6 SOAP Binding
+
+       // 4.5 Port Types
+
+               // FIXME: R2301, R2302, R2303, R2304, R2305, R2306
+
+       // 4.6 Bindings
+
+               public static readonly ConformanceRule R2401 = new ConformanceRule (
+                       "R2401", 
+                       "A wsdl:binding element in a DESCRIPTION MUST use WSDL SOAP Binding as defined in WSDL 1.1 Section 3.",
+                       "");
+
+       // 4.7 SOAP Binding
                
                public static readonly ConformanceRule R2701 = new ConformanceRule (
                        "R2701", 
@@ -561,31 +578,22 @@ namespace System.Web.Services.Description
                        "A wsdl:binding in a DESCRIPTION MUST use the value of \"literal\" for the use attribute in all soapbind:body, soapbind:fault, soapbind:header and soapbind:headerfault elements",
                        "");
                        
-               // R2707: Interpretation rule: A wsdl:binding in a DESCRIPTION that contains one or more  soapbind:body, soapbind:fault, soapbind:header or  soapbind:headerfault elements that do not specify the use attribute MUST be interpreted as though the value "literal" had been specified in each case
                // R2709: Suggestion.
-               
-               // TODO
+
+               // FIXME: R2710, R2711, R2712, R2714, R2750, R2727,
+               // R2716, R2717, R2726, R2718, R2719, R2740, R2741,
+               // R2742, R2743, R2720, R2749, R2721, R2754, R2722,
+               // R2723, R2707, R2724, R2725, R2729, R2735, R2755,
+               // R2737, R2738, R2739, R2753, R2751, R2752, R2744,
+               // R2745, R2747, R2748
+
+       // 4.8 Use of XML Schema
+
+               // R2800: satisfied by API nature.
+               // R2801: ditto.
+
+               #endregion
        }
-       
-       /* 
-               The following rules cannot be checked:
-               R2002, R2003, R4004, R4003, R2022, R2023, R2004, R2010, R2011
-                       There is no access to the unerlying xml 
-                       
-               The following are suggestions:
-               R2008, R2112
-               
-               The following are optional
-               R4002, R2020, R2021, R2024, R2114
-               
-               Can't be checked:
-               R2025
-               
-               Process related
-               R2027
-               
-               TODO: section 5.3
-       */
 }
 
 #endif
index ed48f47fbdab4081032123e181ddee8121071663..2662bc6edbb03e0f70be9fe50c72f9fe7d552ff2 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Binding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Binding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class Binding :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               OperationBindingCollection operations;\r
-               ServiceDescription serviceDescription;\r
-               XmlQualifiedName type;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public Binding ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
-                       operations = new OperationBindingCollection (this);\r
-                       serviceDescription = null;\r
-                       type = XmlQualifiedName.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
+
+using System.Web.Services.Configuration;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description 
+{
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class Binding :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+#if !NET_2_0
+               string name;
+#endif
+               OperationBindingCollection operations;
+               ServiceDescription serviceDescription;
+               XmlQualifiedName type;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public Binding ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+                       operations = new OperationBindingCollection (this);
+                       serviceDescription = null;
+                       type = XmlQualifiedName.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
                public 
 #if NET_2_0
                override
 #endif
-               ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]    \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlElement ("operation")]\r
-               public OperationBindingCollection Operations {\r
-                       get { return operations; }\r
-               }\r
-\r
-               public ServiceDescription ServiceDescription {\r
-                       get { return serviceDescription; }\r
-               }\r
-\r
-               [XmlAttribute ("type")] \r
-               public XmlQualifiedName Type {\r
-                       get { return type; }\r
-                       set { type = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (ServiceDescription serviceDescription)\r
-               {\r
-                       this.serviceDescription = serviceDescription;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+               ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]    
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlElement ("operation")]
+               public OperationBindingCollection Operations {
+                       get { return operations; }
+               }
+
+               public ServiceDescription ServiceDescription {
+                       get { return serviceDescription; }
+               }
+
+               [XmlAttribute ("type")] 
+               public XmlQualifiedName Type {
+                       get { return type; }
+                       set { type = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (ServiceDescription serviceDescription)
+               {
+                       this.serviceDescription = serviceDescription;
+               }
+
+               #endregion // Methods
+       }
+}
index 147a4b5e4d8fbd5afefbeb2d0d2078dd1036377c..5c7c19b39471ed1e64bb12f17fa58318a2234ace 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.BindingCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.BindingCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class BindingCollection : ServiceDescriptionBaseCollection {\r
-               \r
-               #region Fields\r
-\r
-               ServiceDescription serviceDescription;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               internal BindingCollection (ServiceDescription serviceDescription) \r
-                       : base (serviceDescription)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public Binding this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (Binding) List[index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public Binding this [string name] {\r
-                       get { return (Binding) Table[name]; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (Binding binding) \r
-               {\r
-                       Insert (Count, binding);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (Binding binding)\r
-               {\r
-                       return List.Contains (binding);\r
-               }\r
-\r
-               public void CopyTo (Binding[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is Binding))\r
-                               throw new InvalidCastException ();\r
-                       return ((Binding) value).Name;\r
-               }\r
-\r
-               public int IndexOf (Binding binding)\r
-               {\r
-                       return List.IndexOf (binding);\r
-               }\r
-\r
-               public void Insert (int index, Binding binding)\r
-               {\r
-                       List.Insert (index, binding);\r
-               }\r
-       \r
-               public void Remove (Binding binding)\r
-               {\r
-                       List.Remove (binding);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((Binding) value).SetParent ((ServiceDescription) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class BindingCollection : ServiceDescriptionBaseCollection {
+               
+               #region Fields
+
+               ServiceDescription serviceDescription;
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               internal BindingCollection (ServiceDescription serviceDescription) 
+                       : base (serviceDescription)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public Binding this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (Binding) List[index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public Binding this [string name] {
+                       get { return (Binding) Table[name]; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (Binding binding) 
+               {
+                       Insert (Count, binding);
+                       return (Count - 1);
+               }
+
+               public bool Contains (Binding binding)
+               {
+                       return List.Contains (binding);
+               }
+
+               public void CopyTo (Binding[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is Binding))
+                               throw new InvalidCastException ();
+                       return ((Binding) value).Name;
+               }
+
+               public int IndexOf (Binding binding)
+               {
+                       return List.IndexOf (binding);
+               }
+
+               public void Insert (int index, Binding binding)
+               {
+                       List.Insert (index, binding);
+               }
+       
+               public void Remove (Binding binding)
+               {
+                       List.Remove (binding);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((Binding) value).SetParent ((ServiceDescription) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index defbd56f5b97b60256d3484f358240971b4213cb..db827583a7ded2828f994a6aca81169b00d7dccb 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-28  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * BasicProfileChecker.cs : reviewed and updated some of the
+         requirements to Basic Profile 1.1 Final Material.
+
 2006-11-15  Atsushi Enomoto  <atsushi@ximian.com>
 
        * WebReference.cs : added missing .ctor().
index e6ad93e95f2b46d5cc1f8543b9bfb857eae1557e..4f9356c622758b13e0819ee943c037783081e388 100644 (file)
-// \r
-// System.Web.Services.Description.DocumentableItem.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.ComponentModel;\r
-using System.Runtime.InteropServices;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Description {\r
-       public abstract class DocumentableItem {\r
-\r
-               #region Fields\r
-\r
-               XmlElement docElement;\r
-\r
-#if NET_2_0\r
-               XmlAttribute [] extAttributes;\r
-               XmlSerializerNamespaces namespaces;\r
-#endif\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               protected DocumentableItem ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public string Documentation {\r
-                       get { \r
-                               return docElement != null ? docElement.InnerText : ""; \r
-                       }\r
-                       \r
-                       set {\r
-                               if (value == null)\r
-                                       docElement = null;\r
-                               else {\r
-                                       XmlDocument doc = new XmlDocument ();\r
-                                       docElement = doc.CreateElement ("wsdl", "documentation", "http://schemas.xmlsoap.org/wsdl/");\r
-                                       docElement.InnerText = value;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [ComVisible (false)]\r
-               [XmlAnyElement (Name="documentation", Namespace="http://schemas.xmlsoap.org/wsdl/")]\r
-               public XmlElement DocumentationElement\r
-               {\r
-                       get { return docElement; }\r
-                       set { docElement = value; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [XmlAnyAttribute]\r
-               public XmlAttribute [] ExtensibleAttributes {\r
-                       get { return extAttributes; }\r
-                       set { extAttributes = value; }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public abstract ServiceDescriptionFormatExtensionCollection Extensions {\r
-                       get;\r
-               }\r
-\r
-               [XmlNamespaceDeclarations]\r
-               public XmlSerializerNamespaces Namespaces {\r
-                       get { \r
-                               if (namespaces == null)\r
-                                       namespaces = new XmlSerializerNamespaces ();\r
-                               return namespaces;\r
-                       }\r
-                       set { namespaces = value; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+// 
+// System.Web.Services.Description.DocumentableItem.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Xml.Serialization;
+using System.Xml;
+
+namespace System.Web.Services.Description {
+       public abstract class DocumentableItem {
+
+               #region Fields
+
+               XmlElement docElement;
+
+#if NET_2_0
+               XmlAttribute [] extAttributes;
+               XmlSerializerNamespaces namespaces;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+
+               protected DocumentableItem ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public string Documentation {
+                       get { 
+                               return docElement != null ? docElement.InnerText : ""; 
+                       }
+                       
+                       set {
+                               if (value == null)
+                                       docElement = null;
+                               else {
+                                       XmlDocument doc = new XmlDocument ();
+                                       docElement = doc.CreateElement ("wsdl", "documentation", "http://schemas.xmlsoap.org/wsdl/");
+                                       docElement.InnerText = value;
+                               }
+                       }
+               }
+
+               [ComVisible (false)]
+               [XmlAnyElement (Name="documentation", Namespace="http://schemas.xmlsoap.org/wsdl/")]
+               public XmlElement DocumentationElement
+               {
+                       get { return docElement; }
+                       set { docElement = value; }
+               }
+
+#if NET_2_0
+               [XmlAnyAttribute]
+               public XmlAttribute [] ExtensibleAttributes {
+                       get { return extAttributes; }
+                       set { extAttributes = value; }
+               }
+
+               [XmlIgnore]
+               public abstract ServiceDescriptionFormatExtensionCollection Extensions {
+                       get;
+               }
+
+               [XmlNamespaceDeclarations]
+               public XmlSerializerNamespaces Namespaces {
+                       get { 
+                               if (namespaces == null)
+                                       namespaces = new XmlSerializerNamespaces ();
+                               return namespaces;
+                       }
+                       set { namespaces = value; }
+               }
+#endif
+
+               #endregion // Properties
+       }
+}
index 94f2234e3f5ed31e442704a0c7a59ba866f11353..f81c5ec228142ce956959771807f033bde3f9699 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.ExtensionManager.cs\r
-//\r
-// Author:\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) 2003 Ximian, Inc.\r
-//\r
+// 
+// System.Web.Services.Description.ExtensionManager.cs
+//
+// Author:
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) 2003 Ximian, Inc.
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Reflection;\r
-using System.Collections;\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-       internal abstract class ExtensionManager \r
-       {\r
-               static Hashtable extensionsByName;\r
-               static Hashtable extensionsByType;\r
-               static ArrayList maps = new ArrayList ();\r
-               static ArrayList extensions = new ArrayList ();\r
-\r
-               static ExtensionManager ()\r
-               {\r
-                       extensionsByName = new Hashtable ();\r
-                       extensionsByType = new Hashtable ();\r
-\r
-                       RegisterExtensionType (typeof (HttpAddressBinding));\r
-                       RegisterExtensionType (typeof (HttpBinding));\r
-                       RegisterExtensionType (typeof (HttpOperationBinding));\r
-                       RegisterExtensionType (typeof (HttpUrlEncodedBinding));\r
-                       RegisterExtensionType (typeof (HttpUrlReplacementBinding));\r
-                       RegisterExtensionType (typeof (MimeContentBinding));\r
-                       RegisterExtensionType (typeof (MimeMultipartRelatedBinding));\r
-                       RegisterExtensionType (typeof (MimeTextBinding));\r
-                       RegisterExtensionType (typeof (MimeXmlBinding));\r
-                       RegisterExtensionType (typeof (SoapAddressBinding));\r
-                       RegisterExtensionType (typeof (SoapBinding));\r
-                       RegisterExtensionType (typeof (SoapBodyBinding));\r
-                       RegisterExtensionType (typeof (SoapFaultBinding));\r
-                       RegisterExtensionType (typeof (SoapHeaderBinding));\r
-//                     RegisterExtensionType (typeof (SoapHeaderFaultBinding));\r
-                       RegisterExtensionType (typeof (SoapOperationBinding));\r
+
+using System.Reflection;
+using System.Collections;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+using System.Xml;
+
+namespace System.Web.Services.Description 
+{
+       internal abstract class ExtensionManager 
+       {
+               static Hashtable extensionsByName;
+               static Hashtable extensionsByType;
+               static ArrayList maps = new ArrayList ();
+               static ArrayList extensions = new ArrayList ();
+
+               static ExtensionManager ()
+               {
+                       extensionsByName = new Hashtable ();
+                       extensionsByType = new Hashtable ();
+
+                       RegisterExtensionType (typeof (HttpAddressBinding));
+                       RegisterExtensionType (typeof (HttpBinding));
+                       RegisterExtensionType (typeof (HttpOperationBinding));
+                       RegisterExtensionType (typeof (HttpUrlEncodedBinding));
+                       RegisterExtensionType (typeof (HttpUrlReplacementBinding));
+                       RegisterExtensionType (typeof (MimeContentBinding));
+                       RegisterExtensionType (typeof (MimeMultipartRelatedBinding));
+                       RegisterExtensionType (typeof (MimeTextBinding));
+                       RegisterExtensionType (typeof (MimeXmlBinding));
+                       RegisterExtensionType (typeof (SoapAddressBinding));
+                       RegisterExtensionType (typeof (SoapBinding));
+                       RegisterExtensionType (typeof (SoapBodyBinding));
+                       RegisterExtensionType (typeof (SoapFaultBinding));
+                       RegisterExtensionType (typeof (SoapHeaderBinding));
+//                     RegisterExtensionType (typeof (SoapHeaderFaultBinding));
+                       RegisterExtensionType (typeof (SoapOperationBinding));
 #if NET_2_0
                        foreach (TypeElement el in WebServicesSection.Instance.ServiceDescriptionFormatExtensionTypes)
                                RegisterExtensionType (el.Type);
 #else
-                       foreach (Type type in WSConfig.Instance.FormatExtensionTypes)\r
-                               RegisterExtensionType (type);\r
+                       foreach (Type type in WSConfig.Instance.FormatExtensionTypes)
+                               RegisterExtensionType (type);
 #endif
-                               \r
-                       CreateExtensionSerializers ();\r
-               }\r
-       \r
-               static void RegisterExtensionType (Type type)\r
-               {\r
-                       ExtensionInfo ext = new ExtensionInfo();\r
-                       ext.Type = type;\r
-                       \r
-                       object[] ats = type.GetCustomAttributes (typeof(XmlFormatExtensionPrefixAttribute), true);\r
-                       \r
-                       foreach (XmlFormatExtensionPrefixAttribute at in ats)\r
-                               ext.NamespaceDeclarations.Add (new XmlQualifiedName (at.Prefix, at.Namespace));\r
-                       \r
-                       ats = type.GetCustomAttributes (typeof(XmlFormatExtensionAttribute), true);\r
-                       if (ats.Length > 0)\r
-                       {\r
-                               XmlFormatExtensionAttribute at = (XmlFormatExtensionAttribute)ats[0];\r
-                               ext.ElementName = at.ElementName;\r
-                               if (at.Namespace != null) ext.Namespace = at.Namespace;\r
-                       }\r
-\r
-                       XmlRootAttribute root = new XmlRootAttribute ();\r
-                       root.ElementName = ext.ElementName;\r
-                       if (ext.Namespace != null) root.Namespace = ext.Namespace;\r
-\r
-                       XmlReflectionImporter ri = new XmlReflectionImporter ();\r
-                       XmlTypeMapping map = ri.ImportTypeMapping (type, root);\r
-                       \r
-                       if (ext.ElementName == null) throw new InvalidOperationException ("XmlFormatExtensionAttribute must be applied to type " + type);\r
-                       extensionsByName.Add (ext.Namespace + " " + ext.ElementName, ext);\r
-                       extensionsByType.Add (type, ext);\r
-                       \r
-                       maps.Add (map);\r
-                       extensions.Add (ext);\r
-               }\r
-               \r
-               static void CreateExtensionSerializers ()\r
-               {\r
-                       XmlSerializer[] sers = XmlSerializer.FromMappings ((XmlMapping[]) maps.ToArray (typeof(XmlMapping)));\r
-                       for (int n=0; n<sers.Length; n++)\r
-                               ((ExtensionInfo)extensions[n]).Serializer = sers[n];\r
-                       \r
-                       maps = null;\r
-                       extensions = null;\r
-               }\r
-               \r
-               public static ExtensionInfo GetFormatExtensionInfo (string elementName, string namesp)\r
-               {\r
-                       return (ExtensionInfo) extensionsByName [namesp + " " + elementName];\r
-               }\r
-               \r
-               public static ExtensionInfo GetFormatExtensionInfo (Type extType)\r
-               {\r
-                       return (ExtensionInfo) extensionsByType [extType];\r
-               }\r
-               \r
-               public static ICollection GetFormatExtensions ()\r
-               {\r
-                       return extensionsByName.Values;\r
-               }\r
-\r
-               public static ServiceDescriptionFormatExtensionCollection GetExtensionPoint (object ob)\r
-               {\r
-                       Type type = ob.GetType ();\r
-                       object[] ats = type.GetCustomAttributes (typeof(XmlFormatExtensionPointAttribute), true);\r
-                       if (ats.Length == 0) return null;\r
-\r
-                       XmlFormatExtensionPointAttribute at = (XmlFormatExtensionPointAttribute)ats[0];\r
-                       \r
-                       PropertyInfo prop = type.GetProperty (at.MemberName);\r
-                       if (prop != null)\r
-                               return prop.GetValue (ob, null) as ServiceDescriptionFormatExtensionCollection;\r
-                       else {\r
-                               FieldInfo field = type.GetField (at.MemberName);\r
-                               if (field != null)\r
-                                       return field.GetValue (ob) as ServiceDescriptionFormatExtensionCollection;\r
-                               else\r
-                                       throw new InvalidOperationException ("XmlFormatExtensionPointAttribute: Member " + at.MemberName + " not found");\r
-                       }\r
-               }\r
-               \r
-               public static ArrayList BuildExtensionImporters ()\r
-               {\r
+                               
+                       CreateExtensionSerializers ();
+               }
+       
+               static void RegisterExtensionType (Type type)
+               {
+                       ExtensionInfo ext = new ExtensionInfo();
+                       ext.Type = type;
+                       
+                       object[] ats = type.GetCustomAttributes (typeof(XmlFormatExtensionPrefixAttribute), true);
+                       
+                       foreach (XmlFormatExtensionPrefixAttribute at in ats)
+                               ext.NamespaceDeclarations.Add (new XmlQualifiedName (at.Prefix, at.Namespace));
+                       
+                       ats = type.GetCustomAttributes (typeof(XmlFormatExtensionAttribute), true);
+                       if (ats.Length > 0)
+                       {
+                               XmlFormatExtensionAttribute at = (XmlFormatExtensionAttribute)ats[0];
+                               ext.ElementName = at.ElementName;
+                               if (at.Namespace != null) ext.Namespace = at.Namespace;
+                       }
+
+                       XmlRootAttribute root = new XmlRootAttribute ();
+                       root.ElementName = ext.ElementName;
+                       if (ext.Namespace != null) root.Namespace = ext.Namespace;
+
+                       XmlReflectionImporter ri = new XmlReflectionImporter ();
+                       XmlTypeMapping map = ri.ImportTypeMapping (type, root);
+                       
+                       if (ext.ElementName == null) throw new InvalidOperationException ("XmlFormatExtensionAttribute must be applied to type " + type);
+                       extensionsByName.Add (ext.Namespace + " " + ext.ElementName, ext);
+                       extensionsByType.Add (type, ext);
+                       
+                       maps.Add (map);
+                       extensions.Add (ext);
+               }
+               
+               static void CreateExtensionSerializers ()
+               {
+                       XmlSerializer[] sers = XmlSerializer.FromMappings ((XmlMapping[]) maps.ToArray (typeof(XmlMapping)));
+                       for (int n=0; n<sers.Length; n++)
+                               ((ExtensionInfo)extensions[n]).Serializer = sers[n];
+                       
+                       maps = null;
+                       extensions = null;
+               }
+               
+               public static ExtensionInfo GetFormatExtensionInfo (string elementName, string namesp)
+               {
+                       return (ExtensionInfo) extensionsByName [namesp + " " + elementName];
+               }
+               
+               public static ExtensionInfo GetFormatExtensionInfo (Type extType)
+               {
+                       return (ExtensionInfo) extensionsByType [extType];
+               }
+               
+               public static ICollection GetFormatExtensions ()
+               {
+                       return extensionsByName.Values;
+               }
+
+               public static ServiceDescriptionFormatExtensionCollection GetExtensionPoint (object ob)
+               {
+                       Type type = ob.GetType ();
+                       object[] ats = type.GetCustomAttributes (typeof(XmlFormatExtensionPointAttribute), true);
+                       if (ats.Length == 0) return null;
+
+                       XmlFormatExtensionPointAttribute at = (XmlFormatExtensionPointAttribute)ats[0];
+                       
+                       PropertyInfo prop = type.GetProperty (at.MemberName);
+                       if (prop != null)
+                               return prop.GetValue (ob, null) as ServiceDescriptionFormatExtensionCollection;
+                       else {
+                               FieldInfo field = type.GetField (at.MemberName);
+                               if (field != null)
+                                       return field.GetValue (ob) as ServiceDescriptionFormatExtensionCollection;
+                               else
+                                       throw new InvalidOperationException ("XmlFormatExtensionPointAttribute: Member " + at.MemberName + " not found");
+                       }
+               }
+               
+               public static ArrayList BuildExtensionImporters ()
+               {
 #if NET_2_0
                        return BuildExtensionList (WebServicesSection.Instance.SoapExtensionImporterTypes);
 #else
-                       return BuildExtensionList (WSConfig.Instance.ExtensionImporterTypes);\r
+                       return BuildExtensionList (WSConfig.Instance.ExtensionImporterTypes);
 #endif
-               }\r
-               \r
-               public static ArrayList BuildExtensionReflectors ()\r
-               {\r
+               }
+               
+               public static ArrayList BuildExtensionReflectors ()
+               {
 #if NET_2_0
                        return BuildExtensionList (WebServicesSection.Instance.SoapExtensionReflectorTypes);
 #else
-                       return BuildExtensionList (WSConfig.Instance.ExtensionReflectorTypes);\r
+                       return BuildExtensionList (WSConfig.Instance.ExtensionReflectorTypes);
 #endif
-               }\r
-               \r
+               }
+               
 #if NET_2_0
-               public static ArrayList BuildExtensionList (TypeElementCollection exts)\r
+               public static ArrayList BuildExtensionList (TypeElementCollection exts)
 #else
-               public static ArrayList BuildExtensionList (ArrayList exts)\r
+               public static ArrayList BuildExtensionList (ArrayList exts)
 #endif
-               {\r
-                       ArrayList extensionTypes = new ArrayList ();\r
-                       \r
-                       if (exts != null)\r
-                       {\r
+               {
+                       ArrayList extensionTypes = new ArrayList ();
+                       
+                       if (exts != null)
+                       {
 #if NET_2_0
                                foreach (TypeElement econf in exts)
                                {
                                        extensionTypes.Add (econf);
                                }
 #else
-                               foreach (WSExtensionConfig econf in exts)\r
-                               {\r
-                                       bool added = false;\r
-                                       for (int n=0; n<extensionTypes.Count && !added; n++)\r
-                                       {\r
-                                               WSExtensionConfig cureconf = (WSExtensionConfig) extensionTypes [n];\r
-       \r
-                                               if ((econf.Group < cureconf.Group) || ((econf.Group == cureconf.Group) && (econf.Priority < cureconf.Priority))) {\r
-                                                       extensionTypes.Insert (n, econf);\r
-                                                       added = true;\r
-                                               }\r
-                                       }\r
-                                       if (!added) extensionTypes.Add (econf);\r
-                               }\r
+                               foreach (WSExtensionConfig econf in exts)
+                               {
+                                       bool added = false;
+                                       for (int n=0; n<extensionTypes.Count && !added; n++)
+                                       {
+                                               WSExtensionConfig cureconf = (WSExtensionConfig) extensionTypes [n];
+       
+                                               if ((econf.Group < cureconf.Group) || ((econf.Group == cureconf.Group) && (econf.Priority < cureconf.Priority))) {
+                                                       extensionTypes.Insert (n, econf);
+                                                       added = true;
+                                               }
+                                       }
+                                       if (!added) extensionTypes.Add (econf);
+                               }
 #endif
-                       }\r
-\r
-                       ArrayList extensions = new ArrayList (extensionTypes.Count);\r
+                       }
+
+                       ArrayList extensions = new ArrayList (extensionTypes.Count);
 #if NET_2_0
-                       foreach (TypeElement econf in extensionTypes)\r
+                       foreach (TypeElement econf in extensionTypes)
 #else
-                       foreach (WSExtensionConfig econf in extensionTypes)\r
+                       foreach (WSExtensionConfig econf in extensionTypes)
 #endif
-                               extensions.Add (Activator.CreateInstance (econf.Type));\r
-                               \r
-                       return extensions;\r
-               }\r
-       }\r
-       \r
-       internal class ExtensionInfo\r
-       {\r
-               ArrayList _namespaceDeclarations;\r
-               string _namespace;\r
-               string _elementName;\r
-               Type _type;\r
-               XmlSerializer _serializer;\r
-\r
-               public ArrayList NamespaceDeclarations\r
-               {\r
-                       get { \r
-                               if (_namespaceDeclarations == null) _namespaceDeclarations = new ArrayList ();\r
-                               return _namespaceDeclarations; \r
-                       }\r
-               }\r
-               \r
-               public string Namespace\r
-               {\r
-                       get { return _namespace; }\r
-                       set { _namespace = value; }\r
-               }\r
-               \r
-               public string ElementName\r
-               {\r
-                       get { return _elementName; }\r
-                       set { _elementName = value; }\r
-               }\r
-               \r
-               public Type Type\r
-               {\r
-                       get { return _type; }\r
-                       set { _type = value; }\r
-               }\r
-               \r
-               public XmlSerializer Serializer\r
-               {\r
-                       get { return _serializer; }\r
-                       set { _serializer = value; }\r
-               }               \r
-       }\r
+                               extensions.Add (Activator.CreateInstance (econf.Type));
+                               
+                       return extensions;
+               }
+       }
+       
+       internal class ExtensionInfo
+       {
+               ArrayList _namespaceDeclarations;
+               string _namespace;
+               string _elementName;
+               Type _type;
+               XmlSerializer _serializer;
+
+               public ArrayList NamespaceDeclarations
+               {
+                       get { 
+                               if (_namespaceDeclarations == null) _namespaceDeclarations = new ArrayList ();
+                               return _namespaceDeclarations; 
+                       }
+               }
+               
+               public string Namespace
+               {
+                       get { return _namespace; }
+                       set { _namespace = value; }
+               }
+               
+               public string ElementName
+               {
+                       get { return _elementName; }
+                       set { _elementName = value; }
+               }
+               
+               public Type Type
+               {
+                       get { return _type; }
+                       set { _type = value; }
+               }
+               
+               public XmlSerializer Serializer
+               {
+                       get { return _serializer; }
+                       set { _serializer = value; }
+               }               
+       }
 }
index c0459b7cdea6283ee2a42c1b5a85841f9d21cf7d..0efa826ea2fc101e185c2e047a90e8852509f255 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.FaultBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.FaultBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class FaultBinding : MessageBinding {\r
-\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public FaultBinding ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public override ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class FaultBinding : MessageBinding {
+
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public FaultBinding ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public override ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+       
+               #endregion // Properties
+       }
+}
index b6e5b2300426e58ceff5eb88ebb40e4699e0a406..c0daea63fd95cda09e5ba5b3b7839127f5d02eef 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.FaultBindingCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.FaultBindingCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class FaultBindingCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal FaultBindingCollection (OperationBinding operationBinding) \r
-                       : base (operationBinding)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public FaultBinding this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (FaultBinding) List[index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public FaultBinding this [string name] {\r
-                       get { return this [IndexOf ((FaultBinding) Table[name])]; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (FaultBinding bindingOperationFault) \r
-               {\r
-                       Insert (Count, bindingOperationFault);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (FaultBinding bindingOperationFault)\r
-               {\r
-                       return List.Contains (bindingOperationFault);\r
-               }\r
-\r
-               public void CopyTo (FaultBinding[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is FaultBinding))\r
-                               throw new InvalidCastException ();\r
-\r
-                       return ((FaultBinding) value).Name;\r
-               }\r
-\r
-               public int IndexOf (FaultBinding bindingOperationFault)\r
-               {\r
-                       return List.IndexOf (bindingOperationFault);\r
-               }\r
-\r
-               public void Insert (int index, FaultBinding bindingOperationFault)\r
-               {\r
-                       List.Insert (index, bindingOperationFault);\r
-               }\r
-       \r
-               public void Remove (FaultBinding bindingOperationFault)\r
-               {\r
-                       List.Remove (bindingOperationFault);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((FaultBinding) value).SetParent ((OperationBinding) parent);   \r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class FaultBindingCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal FaultBindingCollection (OperationBinding operationBinding) 
+                       : base (operationBinding)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public FaultBinding this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (FaultBinding) List[index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public FaultBinding this [string name] {
+                       get { return this [IndexOf ((FaultBinding) Table[name])]; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (FaultBinding bindingOperationFault) 
+               {
+                       Insert (Count, bindingOperationFault);
+                       return (Count - 1);
+               }
+
+               public bool Contains (FaultBinding bindingOperationFault)
+               {
+                       return List.Contains (bindingOperationFault);
+               }
+
+               public void CopyTo (FaultBinding[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is FaultBinding))
+                               throw new InvalidCastException ();
+
+                       return ((FaultBinding) value).Name;
+               }
+
+               public int IndexOf (FaultBinding bindingOperationFault)
+               {
+                       return List.IndexOf (bindingOperationFault);
+               }
+
+               public void Insert (int index, FaultBinding bindingOperationFault)
+               {
+                       List.Insert (index, bindingOperationFault);
+               }
+       
+               public void Remove (FaultBinding bindingOperationFault)
+               {
+                       List.Remove (bindingOperationFault);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((FaultBinding) value).SetParent ((OperationBinding) parent);   
+               }
+                       
+               #endregion // Methods
+       }
+}
index bf120fb04c01d73b010c8b4ecab79a138aa3c24e..3c7d65257936ecd1c495bb6c680c740c3cbe6b29 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.HttpAddressBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.HttpAddressBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization; \r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("address", "http://schemas.xmlsoap.org/wsdl/http/", typeof (Port))]\r
-       public sealed class HttpAddressBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string location;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public HttpAddressBinding ()\r
-               {\r
-                       location = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("location")]\r
-               public string Location {        \r
-                       get { return location; }\r
-                       set { location = value; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization; 
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("address", "http://schemas.xmlsoap.org/wsdl/http/", typeof (Port))]
+       public sealed class HttpAddressBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string location;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public HttpAddressBinding ()
+               {
+                       location = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("location")]
+               public string Location {        
+                       get { return location; }
+                       set { location = value; }
+               }
+       
+               #endregion // Properties
+       }
+}
index 3c1bbd76507039265c17d1d84f3ede305fb29be2..3de68a5dc85c68b85bb610c5a3323a9eb00ed1ce 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.HttpBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.HttpBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/http/", typeof (Binding))]\r
-       [XmlFormatExtensionPrefix ("http", "http://schemas.xmlsoap.org/wsdl/http/")]\r
-       public sealed class HttpBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               public const string Namespace = "http://schemas.xmlsoap.org/wsdl/http/";\r
-               string verb;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public HttpBinding ()\r
-               {\r
-                       verb = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("verb", DataType = "NMTOKEN")]\r
-               public string Verb {    \r
-                       get { return verb; }\r
-                       set { verb = value; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/http/", typeof (Binding))]
+       [XmlFormatExtensionPrefix ("http", "http://schemas.xmlsoap.org/wsdl/http/")]
+       public sealed class HttpBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               public const string Namespace = "http://schemas.xmlsoap.org/wsdl/http/";
+               string verb;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public HttpBinding ()
+               {
+                       verb = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("verb", DataType = "NMTOKEN")]
+               public string Verb {    
+                       get { return verb; }
+                       set { verb = value; }
+               }
+       
+               #endregion // Properties
+       }
+}
index d713b8ee08868482289f903a80f305cf455eaec9..4aa6234b8b3c3644f05044cac2094249e171c05d 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.HttpOperationBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.HttpOperationBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("operation", "http://schemas.xmlsoap.org/wsdl/http/", typeof (OperationBinding))]\r
-       public sealed class HttpOperationBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string location;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public HttpOperationBinding ()\r
-               {\r
-                       location = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("location")]\r
-               public string Location {        \r
-                       get { return location; }\r
-                       set { location = value; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("operation", "http://schemas.xmlsoap.org/wsdl/http/", typeof (OperationBinding))]
+       public sealed class HttpOperationBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string location;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public HttpOperationBinding ()
+               {
+                       location = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("location")]
+               public string Location {        
+                       get { return location; }
+                       set { location = value; }
+               }
+       
+               #endregion // Properties
+       }
+}
index 80622474163a85cd2082ef93bf4edde36ea6cd8a..4a51978d5b3b309883512dd08939c3612b5d4898 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.HttpUrlEncodedBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.HttpUrlEncodedBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("urlEncoded", "http://schemas.xmlsoap.org/wsdl/http/", typeof (InputBinding))]\r
-       public sealed class HttpUrlEncodedBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Constructors\r
-               \r
-               public HttpUrlEncodedBinding ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("urlEncoded", "http://schemas.xmlsoap.org/wsdl/http/", typeof (InputBinding))]
+       public sealed class HttpUrlEncodedBinding : ServiceDescriptionFormatExtension {
+
+               #region Constructors
+               
+               public HttpUrlEncodedBinding ()
+               {
+               }
+               
+               #endregion // Constructors
+       }
+}
index 08393a3cdfb0a417a0f53ce1081aa2d338a8ca34..99c29074ece464b5493bc2d50208a414dbf05d11 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.HttpUrlReplacementBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.HttpUrlReplacementBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("urlReplacement", "http://schemas.xmlsoap.org/wsdl/http/", typeof (InputBinding))]\r
-       public sealed class HttpUrlReplacementBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Constructors\r
-               \r
-               public HttpUrlReplacementBinding ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("urlReplacement", "http://schemas.xmlsoap.org/wsdl/http/", typeof (InputBinding))]
+       public sealed class HttpUrlReplacementBinding : ServiceDescriptionFormatExtension {
+
+               #region Constructors
+               
+               public HttpUrlReplacementBinding ()
+               {
+               }
+               
+               #endregion // Constructors
+       }
+}
index 3cf8b3f123be0088970470d546137296bcf9692d..504164af7515a0df1872df9a42f99cf546cf2308 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Import.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Import.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml.Serialization;\r
+
+using System.Xml.Serialization;
 using System.Web.Services.Configuration;
-\r
-namespace System.Web.Services.Description {\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class Import : DocumentableItem {\r
-\r
-               #region Fields\r
-\r
-               string location;\r
-               string ns;\r
-               ServiceDescription serviceDescription;\r
+
+namespace System.Web.Services.Description {
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class Import : DocumentableItem {
+
+               #region Fields
+
+               string location;
+               string ns;
+               ServiceDescription serviceDescription;
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+               ServiceDescriptionFormatExtensionCollection extensions;
 #endif
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public Import ()\r
-               {\r
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public Import ()
+               {
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
 #endif
-                       location = String.Empty;\r
-                       ns = String.Empty;\r
-                       serviceDescription = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("location")]\r
-               public string Location {\r
-                       get { return location; }\r
-                       set { location = value; }\r
-               }\r
-\r
-               [XmlAttribute ("namespace")]\r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-       \r
-//             [XmlIgnore]\r
-               public ServiceDescription ServiceDescription {\r
-                       get { return serviceDescription; }\r
-               }\r
+                       location = String.Empty;
+                       ns = String.Empty;
+                       serviceDescription = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("location")]
+               public string Location {
+                       get { return location; }
+                       set { location = value; }
+               }
+
+               [XmlAttribute ("namespace")]
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+       
+//             [XmlIgnore]
+               public ServiceDescription ServiceDescription {
+                       get { return serviceDescription; }
+               }
 
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions { 
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (ServiceDescription serviceDescription)\r
-               {\r
-                       this.serviceDescription = serviceDescription;\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (ServiceDescription serviceDescription)
+               {
+                       this.serviceDescription = serviceDescription;
+               }
+
+               #endregion
+       }
+}
index 0299ac0030c4f887e80b8b895a5c65d75fd5c8fb..661ff1de0777d5b1c208ed6e00b4be00f7a67598 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.ImportCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ImportCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class ImportCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-               \r
-               internal ImportCollection (ServiceDescription serviceDescription)\r
-                       : base (serviceDescription)\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public Import this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (Import) List[index]; \r
-                       }\r
-                       set { List [index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (Import import) \r
-               {\r
-                       Insert (Count, import);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (Import import)\r
-               {\r
-                       return List.Contains (import);\r
-               }\r
-\r
-               public void CopyTo (Import[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (Import import)\r
-               {\r
-                       return List.IndexOf (import);\r
-               }\r
-\r
-               public void Insert (int index, Import import)\r
-               {\r
-                       List.Insert (index, import);\r
-               }\r
-       \r
-               public void Remove (Import import)\r
-               {\r
-                       List.Remove (import);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((Import) value).SetParent ((ServiceDescription) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class ImportCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+               
+               internal ImportCollection (ServiceDescription serviceDescription)
+                       : base (serviceDescription)
+               {
+               }
+
+               #endregion
+
+               #region Properties
+
+               public Import this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (Import) List[index]; 
+                       }
+                       set { List [index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (Import import) 
+               {
+                       Insert (Count, import);
+                       return (Count - 1);
+               }
+
+               public bool Contains (Import import)
+               {
+                       return List.Contains (import);
+               }
+
+               public void CopyTo (Import[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (Import import)
+               {
+                       return List.IndexOf (import);
+               }
+
+               public void Insert (int index, Import import)
+               {
+                       List.Insert (index, import);
+               }
+       
+               public void Remove (Import import)
+               {
+                       List.Remove (import);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((Import) value).SetParent ((ServiceDescription) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index d2df51ec16ef7b446f734a3c9caf5bf0129180ab..d29ddf4e968d69316afd4336aec90c4269611da0 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.InputBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.InputBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class InputBinding : MessageBinding {\r
-\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public InputBinding ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public override ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class InputBinding : MessageBinding {
+
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public InputBinding ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public override ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+       
+               #endregion // Properties
+       }
+}
index 376dc9f350288bc25aab0bf7c2e0914d283e3009..0e1e37e7980f5fb04f30aaff41ebb6fe9e9c52c1 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Message.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Message.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-using System.Web.Services;\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class Message :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               MessagePartCollection parts;\r
-               ServiceDescription serviceDescription;\r
+
+using System.Collections;
+using System.Web.Services;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description 
+{
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+       [XmlFormatExtensionPoint ("Extensions")]
 #endif
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public Message ()\r
-               {\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
+       public sealed class Message :
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+               NamedItem
+#else
+               DocumentableItem 
 #endif
-                       parts = new MessagePartCollection (this);\r
-                       serviceDescription = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlElement ("part")]\r
-               public MessagePartCollection Parts {\r
-                       get { return parts; }\r
-               }\r
-\r
-//             [XmlIgnore]\r
-               public ServiceDescription ServiceDescription {\r
-                       get { return serviceDescription; }\r
-               }\r
+       {
+               #region Fields
+
+#if !NET_2_0
+               string name;
+#endif
+               MessagePartCollection parts;
+               ServiceDescription serviceDescription;
+#if NET_2_0
+               ServiceDescriptionFormatExtensionCollection extensions;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public Message ()
+               {
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+#if NET_2_0
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#endif
+                       parts = new MessagePartCollection (this);
+                       serviceDescription = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlElement ("part")]
+               public MessagePartCollection Parts {
+                       get { return parts; }
+               }
+
+//             [XmlIgnore]
+               public ServiceDescription ServiceDescription {
+                       get { return serviceDescription; }
+               }
 
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public MessagePart FindPartByName (string partName)\r
-               {\r
-                       return parts [partName];\r
-               }\r
-\r
-               public MessagePart[] FindPartsByName (string[] partNames) \r
-               {\r
-                       ArrayList searchResults = new ArrayList ();\r
-\r
-                       foreach (string partName in partNames)\r
-                               searchResults.Add (FindPartByName (partName));\r
-\r
-                       int count = searchResults.Count;\r
-\r
-                       if (count == 0)\r
-                               throw new ArgumentException ();\r
-\r
-                       MessagePart[] returnValue = new MessagePart[count];\r
-                       searchResults.CopyTo (returnValue);\r
-                       return returnValue;\r
-               }\r
-\r
-               internal void SetParent (ServiceDescription serviceDescription)\r
-               {\r
-                       this.serviceDescription = serviceDescription;\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
+               #endregion // Properties
+
+               #region Methods
+
+               public MessagePart FindPartByName (string partName)
+               {
+                       return parts [partName];
+               }
+
+               public MessagePart[] FindPartsByName (string[] partNames) 
+               {
+                       ArrayList searchResults = new ArrayList ();
+
+                       foreach (string partName in partNames)
+                               searchResults.Add (FindPartByName (partName));
+
+                       int count = searchResults.Count;
+
+                       if (count == 0)
+                               throw new ArgumentException ();
+
+                       MessagePart[] returnValue = new MessagePart[count];
+                       searchResults.CopyTo (returnValue);
+                       return returnValue;
+               }
+
+               internal void SetParent (ServiceDescription serviceDescription)
+               {
+                       this.serviceDescription = serviceDescription;
+               }
+
+               #endregion
+       }
+}
index d75c70d774e4fe17ec665179dfa352448903ff19..daa1aae59b47574f3b0aaeb97fbdf8ecbe0e3942 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MessageBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MessageBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description\r
-{\r
-       public abstract class MessageBinding :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-\r
-               #region Fields\r
-\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               OperationBinding operationBinding;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               protected MessageBinding ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-#if !NET_2_0\r
-               [XmlIgnore]\r
-               public abstract ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get;\r
-               }\r
-\r
-//             [DefaultValue (null)]\r
-               [XmlAttribute ("name", DataType = "NMTOKEN")]   \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-//             [XmlIgnore]\r
-               public OperationBinding OperationBinding {\r
-                       get { return operationBinding; }\r
-               }\r
-               \r
-               internal void SetParent (OperationBinding ob)\r
-               {\r
-                       operationBinding = ob;\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
+
+using System.ComponentModel;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description
+{
+       public abstract class MessageBinding :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+
+               #region Fields
+
+#if !NET_2_0
+               string name;
+#endif
+               OperationBinding operationBinding;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               protected MessageBinding ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+#if !NET_2_0
+               [XmlIgnore]
+               public abstract ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get;
+               }
+
+//             [DefaultValue (null)]
+               [XmlAttribute ("name", DataType = "NMTOKEN")]   
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+//             [XmlIgnore]
+               public OperationBinding OperationBinding {
+                       get { return operationBinding; }
+               }
+               
+               internal void SetParent (OperationBinding ob)
+               {
+                       operationBinding = ob;
+               }
+
+               #endregion // Properties
+       }
 }
index 6a3b9e9d7e6a75c6bba3ceec30b2caed7768d52a..355da201604e9c78849f5e11c1dd1f2d57aca850 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MessageCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MessageCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class MessageCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-               \r
-               internal MessageCollection (ServiceDescription serviceDescription)\r
-                       : base (serviceDescription)\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public Message this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (Message) List [index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public Message this [string name] {\r
-                       get { return this [IndexOf ((Message) Table [name])]; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (Message message) \r
-               {\r
-                       Insert (Count, message);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (Message message)\r
-               {\r
-                       return List.Contains (message);\r
-               }\r
-\r
-               public void CopyTo (Message[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is Message))\r
-                               throw new InvalidCastException ();\r
-\r
-                       return ((Message) value).Name;\r
-               }\r
-\r
-               public int IndexOf (Message message)\r
-               {\r
-                       return List.IndexOf (message);\r
-               }\r
-\r
-               public void Insert (int index, Message message)\r
-               {\r
-                       List.Insert (index, message);\r
-               }\r
-       \r
-               public void Remove (Message message)\r
-               {\r
-                       List.Remove (message);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((Message) value).SetParent ((ServiceDescription) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class MessageCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+               
+               internal MessageCollection (ServiceDescription serviceDescription)
+                       : base (serviceDescription)
+               {
+               }
+
+               #endregion
+
+               #region Properties
+
+               public Message this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (Message) List [index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public Message this [string name] {
+                       get { return this [IndexOf ((Message) Table [name])]; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (Message message) 
+               {
+                       Insert (Count, message);
+                       return (Count - 1);
+               }
+
+               public bool Contains (Message message)
+               {
+                       return List.Contains (message);
+               }
+
+               public void CopyTo (Message[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is Message))
+                               throw new InvalidCastException ();
+
+                       return ((Message) value).Name;
+               }
+
+               public int IndexOf (Message message)
+               {
+                       return List.IndexOf (message);
+               }
+
+               public void Insert (int index, Message message)
+               {
+                       List.Insert (index, message);
+               }
+       
+               public void Remove (Message message)
+               {
+                       List.Remove (message);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((Message) value).SetParent ((ServiceDescription) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 3afd00853c580bac3062bd335eb49748724cd442..d87b0d11e92b4aaf3d2d40beade1abaadfd628cd 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MessagePart.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MessagePart.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
+
+using System.Xml;
+using System.Xml.Serialization;
 using System.Web.Services.Configuration;
-\r
-namespace System.Web.Services.Description \r
-{\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class MessagePart :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-\r
-               #region Fields\r
-\r
-               XmlQualifiedName element;\r
-               Message message;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               XmlQualifiedName type;\r
+
+namespace System.Web.Services.Description 
+{
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+       [XmlFormatExtensionPoint ("Extensions")]
 #endif
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public MessagePart ()\r
-               {\r
-                       element = XmlQualifiedName.Empty;\r
-                       message = null;\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
-                       type = XmlQualifiedName.Empty;\r
+       public sealed class MessagePart :
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+               NamedItem
+#else
+               DocumentableItem 
 #endif
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("element")]\r
-               public XmlQualifiedName Element {\r
-                       get { return element; }\r
-                       set { element = value; }\r
-               }\r
-               \r
-//             [XmlIgnore]\r
-               public Message Message {\r
-                       get { return message; }\r
-               }\r
-       \r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NMTOKEN")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlAttribute ("type")]\r
-               public XmlQualifiedName Type {\r
-                       get { return type; }\r
-                       set { type = value; }\r
-               }\r
-               \r
-               internal bool DefinedByType {\r
-                       get { return type != null && type != XmlQualifiedName.Empty; }\r
-               }\r
-\r
-               internal bool DefinedByElement {\r
-                       get { return element != null && element != XmlQualifiedName.Empty; }\r
-               }\r
+       {
+
+               #region Fields
+
+               XmlQualifiedName element;
+               Message message;
+#if !NET_2_0
+               string name;
+#endif
+               XmlQualifiedName type;
+#if NET_2_0
+               ServiceDescriptionFormatExtensionCollection extensions;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public MessagePart ()
+               {
+                       element = XmlQualifiedName.Empty;
+                       message = null;
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+                       type = XmlQualifiedName.Empty;
+#if NET_2_0
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#endif
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("element")]
+               public XmlQualifiedName Element {
+                       get { return element; }
+                       set { element = value; }
+               }
+               
+//             [XmlIgnore]
+               public Message Message {
+                       get { return message; }
+               }
+       
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NMTOKEN")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlAttribute ("type")]
+               public XmlQualifiedName Type {
+                       get { return type; }
+                       set { type = value; }
+               }
+               
+               internal bool DefinedByType {
+                       get { return type != null && type != XmlQualifiedName.Empty; }
+               }
+
+               internal bool DefinedByElement {
+                       get { return element != null && element != XmlQualifiedName.Empty; }
+               }
 
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (Message message)\r
-               {\r
-                       this.message = message; \r
-               }\r
-\r
-               #endregion // Methods\r
-\r
-       }\r
-}\r
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (Message message)
+               {
+                       this.message = message; 
+               }
+
+               #endregion // Methods
+
+       }
+}
index 18714a720516312b53f5c529f4d2413211bb9dca..02a486344a7216cac8a3974e9703897f06f9da19 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MessagePartCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MessagePartCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class MessagePartCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal MessagePartCollection (Message message)\r
-                       : base (message)\r
-               {\r
-               }       \r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public MessagePart this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (MessagePart) List[index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public MessagePart this [string name] {\r
-                       get { return this [IndexOf ((MessagePart) Table[name])]; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (MessagePart messagePart) \r
-               {\r
-                       Insert (Count, messagePart);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (MessagePart messagePart)\r
-               {\r
-                       return List.Contains (messagePart);\r
-               }\r
-\r
-               public void CopyTo (MessagePart[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is MessagePart))\r
-                               throw new InvalidCastException ();\r
-                       return ((MessagePart) value).Name;\r
-               }\r
-\r
-               public int IndexOf (MessagePart messagePart)\r
-               {\r
-                       return List.IndexOf (messagePart);\r
-               }\r
-\r
-               public void Insert (int index, MessagePart messagePart)\r
-               {\r
-                       List.Insert (index, messagePart);\r
-               }\r
-       \r
-               public void Remove (MessagePart messagePart)\r
-               {\r
-                       List.Remove (messagePart);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((MessagePart) value).SetParent ((Message) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class MessagePartCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal MessagePartCollection (Message message)
+                       : base (message)
+               {
+               }       
+
+               #endregion
+
+               #region Properties
+
+               public MessagePart this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (MessagePart) List[index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public MessagePart this [string name] {
+                       get { return this [IndexOf ((MessagePart) Table[name])]; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (MessagePart messagePart) 
+               {
+                       Insert (Count, messagePart);
+                       return (Count - 1);
+               }
+
+               public bool Contains (MessagePart messagePart)
+               {
+                       return List.Contains (messagePart);
+               }
+
+               public void CopyTo (MessagePart[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is MessagePart))
+                               throw new InvalidCastException ();
+                       return ((MessagePart) value).Name;
+               }
+
+               public int IndexOf (MessagePart messagePart)
+               {
+                       return List.IndexOf (messagePart);
+               }
+
+               public void Insert (int index, MessagePart messagePart)
+               {
+                       List.Insert (index, messagePart);
+               }
+       
+               public void Remove (MessagePart messagePart)
+               {
+                       List.Remove (messagePart);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((MessagePart) value).SetParent ((Message) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 346dce0c45fc2516e8d2c298c065e333fe178911..c64ab8de92086f656f77c4c9863d770cd16e2f94 100644 (file)
@@ -1,62 +1,62 @@
-// \r
-// System.Web.Services.Description.MimeMultipartRelatedBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("multipartRelated", "http://schemas.xmlsoap.org/wsdl/mime/", typeof (InputBinding), typeof (OutputBinding))]\r
-       public sealed class MimeMultipartRelatedBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               MimePartCollection parts;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public MimeMultipartRelatedBinding ()\r
-               {\r
-                       parts = new MimePartCollection ();\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlElement ("part")]\r
-               public MimePartCollection Parts {\r
-                       get { return parts; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+// 
+// System.Web.Services.Description.MimeMultipartRelatedBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("multipartRelated", "http://schemas.xmlsoap.org/wsdl/mime/", typeof (InputBinding), typeof (OutputBinding))]
+       public sealed class MimeMultipartRelatedBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               MimePartCollection parts;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public MimeMultipartRelatedBinding ()
+               {
+                       parts = new MimePartCollection ();
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlElement ("part")]
+               public MimePartCollection Parts {
+                       get { return parts; }
+               }
+
+               #endregion // Properties
+       }
+}
index 4857d44bf3caad324ceae80f97ec00093f14dcbe..3aeb066ba7da7e6f6f2ccc617af40f03500976b5 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MimePart.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MimePart.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class MimePart : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public MimePart ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]     \r
-               public ServiceDescriptionFormatExtensionCollection Extensions {\r
-                       get { return extensions; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class MimePart : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public MimePart ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]     
+               public ServiceDescriptionFormatExtensionCollection Extensions {
+                       get { return extensions; }
+               }
+
+               #endregion // Properties
+       }
+}
index f1fd0d08b8104ec3e3a4ce61be4ed3afd79bc316..e8d539cbf19d3e61f1e949ca16167bb811c239b9 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MimePartCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MimePartCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class MimePartCollection : CollectionBase {\r
-\r
-               #region Properties\r
-\r
-               public MimePart this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (MimePart) List[index]; \r
-                       }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (MimePart mimePart) \r
-               {\r
-                       Insert (Count, mimePart);       \r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (MimePart mimePart)\r
-               {\r
-                       return List.Contains (mimePart);\r
-               }\r
-\r
-               public void CopyTo (MimePart[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (MimePart mimePart)\r
-               {\r
-                       return List.IndexOf (mimePart);\r
-               }\r
-\r
-               public void Insert (int index, MimePart mimePart)\r
-               {\r
-                       List.Insert (index, mimePart);\r
-               }\r
-       \r
-               public void Remove (MimePart mimePart)\r
-               {\r
-                       List.Remove (mimePart);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Description {
+       public sealed class MimePartCollection : CollectionBase {
+
+               #region Properties
+
+               public MimePart this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (MimePart) List[index]; 
+                       }
+                       set { List[index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (MimePart mimePart) 
+               {
+                       Insert (Count, mimePart);       
+                       return (Count - 1);
+               }
+
+               public bool Contains (MimePart mimePart)
+               {
+                       return List.Contains (mimePart);
+               }
+
+               public void CopyTo (MimePart[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (MimePart mimePart)
+               {
+                       return List.IndexOf (mimePart);
+               }
+
+               public void Insert (int index, MimePart mimePart)
+               {
+                       List.Insert (index, mimePart);
+               }
+       
+               public void Remove (MimePart mimePart)
+               {
+                       List.Remove (mimePart);
+               }
+                       
+               #endregion // Methods
+       }
+}
index b42258645dda966cda9793fa7f0aa0a876ad58dd..29ced7bb564b020265b00472a51fa4e3b093ded8 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MimeTextBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MimeTextBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("text", "http://microsoft.com/wsdl/mime/textMatching/", typeof (InputBinding), typeof (OutputBinding), typeof (MimePart))]\r
-       [XmlFormatExtensionPrefix ("tm", "http://microsoft.com/wsdl/mime/textMatching/")]\r
-       public sealed class MimeTextBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               public const string Namespace = "http://microsoft.com/wsdl/mime/textMatching/";\r
-               MimeTextMatchCollection matches;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public MimeTextBinding ()\r
-               {\r
-                       matches = new MimeTextMatchCollection ();\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlElement ("match", typeof (MimeTextMatch))]  \r
-               public MimeTextMatchCollection Matches {\r
-                       get { return matches; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("text", "http://microsoft.com/wsdl/mime/textMatching/", typeof (InputBinding), typeof (OutputBinding), typeof (MimePart))]
+       [XmlFormatExtensionPrefix ("tm", "http://microsoft.com/wsdl/mime/textMatching/")]
+       public sealed class MimeTextBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               public const string Namespace = "http://microsoft.com/wsdl/mime/textMatching/";
+               MimeTextMatchCollection matches;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public MimeTextBinding ()
+               {
+                       matches = new MimeTextMatchCollection ();
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlElement ("match", typeof (MimeTextMatch))]  
+               public MimeTextMatchCollection Matches {
+                       get { return matches; }
+               }
+
+               #endregion // Properties
+       }
+}
index 83383ed964f1b53a32bcc78c5076c57cf9207a16..065c9450b5c494348e267d82405acc1b61d8967d 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MimeTextMatch.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MimeTextMatch.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class MimeTextMatch {\r
-\r
-               #region Fields\r
-\r
-               int capture;\r
-               int group;\r
-               bool ignoreCase;\r
-               MimeTextMatchCollection matches;\r
-               string name;\r
-               string pattern;\r
-               int repeats;\r
-               string type;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public MimeTextMatch ()\r
-               {\r
-                       capture = 0;\r
-                       group = 1;\r
-                       ignoreCase = false;\r
-                       matches = null;\r
-                       name = String.Empty;\r
-                       pattern = String.Empty;\r
-                       repeats = 1;\r
-                       type = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue (0)]\r
-               [XmlAttribute ("capture")]\r
-               public int Capture {\r
-                       get { return capture; }\r
-                       set {\r
-                               if (value < 0)\r
-                                       throw new ArgumentException ();\r
-                               capture = value; \r
-                       }\r
-               }\r
-       \r
-               [DefaultValue (1)]      \r
-               [XmlAttribute ("group")]\r
-               public int Group {\r
-                       get { return group; }\r
-                       set {\r
-                               if (value < 0)\r
-                                       throw new ArgumentException ();\r
-                               group = value; \r
-                       }\r
-               }\r
-\r
-               [XmlAttribute ("ignoreCase")]\r
-               public bool IgnoreCase {\r
-                       get { return ignoreCase; }\r
-                       set { ignoreCase = value; }\r
-               }\r
-\r
-               [XmlElement ("match")]\r
-               public MimeTextMatchCollection Matches {\r
-                       get { return matches; }\r
-               }\r
-\r
-               [XmlAttribute ("name")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-\r
-               [XmlAttribute ("pattern")]\r
-               public string Pattern {\r
-                       get { return pattern; }\r
-                       set { pattern = value; }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public int Repeats {\r
-                       get { return repeats; }\r
-                       set {\r
-                               if (value < 0)\r
-                                       throw new ArgumentException ();\r
-                               repeats = value; \r
-                       }\r
-               }\r
-\r
-               [DefaultValue ("1")]\r
-               [XmlAttribute ("repeats")]\r
-               public string RepeatsString {\r
-                       get { return Repeats.ToString (); }\r
-                       set { Repeats = Int32.Parse (value); }\r
-               }\r
-\r
-               [XmlAttribute ("type")]\r
-               public string Type {\r
-                       get { return type; }\r
-                       set { type = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (MimeTextMatchCollection matches) \r
-               {\r
-                       this.matches = matches;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.ComponentModel;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       public sealed class MimeTextMatch {
+
+               #region Fields
+
+               int capture;
+               int group;
+               bool ignoreCase;
+               MimeTextMatchCollection matches;
+               string name;
+               string pattern;
+               int repeats;
+               string type;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public MimeTextMatch ()
+               {
+                       capture = 0;
+                       group = 1;
+                       ignoreCase = false;
+                       matches = null;
+                       name = String.Empty;
+                       pattern = String.Empty;
+                       repeats = 1;
+                       type = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue (0)]
+               [XmlAttribute ("capture")]
+               public int Capture {
+                       get { return capture; }
+                       set {
+                               if (value < 0)
+                                       throw new ArgumentException ();
+                               capture = value; 
+                       }
+               }
+       
+               [DefaultValue (1)]      
+               [XmlAttribute ("group")]
+               public int Group {
+                       get { return group; }
+                       set {
+                               if (value < 0)
+                                       throw new ArgumentException ();
+                               group = value; 
+                       }
+               }
+
+               [XmlAttribute ("ignoreCase")]
+               public bool IgnoreCase {
+                       get { return ignoreCase; }
+                       set { ignoreCase = value; }
+               }
+
+               [XmlElement ("match")]
+               public MimeTextMatchCollection Matches {
+                       get { return matches; }
+               }
+
+               [XmlAttribute ("name")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+
+               [XmlAttribute ("pattern")]
+               public string Pattern {
+                       get { return pattern; }
+                       set { pattern = value; }
+               }
+
+               [XmlIgnore]
+               public int Repeats {
+                       get { return repeats; }
+                       set {
+                               if (value < 0)
+                                       throw new ArgumentException ();
+                               repeats = value; 
+                       }
+               }
+
+               [DefaultValue ("1")]
+               [XmlAttribute ("repeats")]
+               public string RepeatsString {
+                       get { return Repeats.ToString (); }
+                       set { Repeats = Int32.Parse (value); }
+               }
+
+               [XmlAttribute ("type")]
+               public string Type {
+                       get { return type; }
+                       set { type = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (MimeTextMatchCollection matches) 
+               {
+                       this.matches = matches;
+               }
+
+               #endregion // Methods
+       }
+}
index 849f6a8f7154ebdbc55ce0c74fe82c2080706d4a..06b817c61b893045367a674b5a1a418a19db118d 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MimeTextMatchCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MimeTextMatchCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class MimeTextMatchCollection : CollectionBase {\r
-\r
-               #region Properties\r
-\r
-               public MimeTextMatch this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (MimeTextMatch) List [index]; \r
-                       }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (MimeTextMatch match) \r
-               {\r
-                       Insert (Count, match);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (MimeTextMatch match)\r
-               {\r
-                       return List.Contains (match);\r
-               }\r
-\r
-               public void CopyTo (MimeTextMatch[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (MimeTextMatch match)\r
-               {\r
-                       return List.IndexOf (match);\r
-               }\r
-\r
-               public void Insert (int index, MimeTextMatch match)\r
-               {\r
-                       SetParent (match, this);\r
-                       List.Insert (index, match);\r
-               }\r
-       \r
-               public void Remove (MimeTextMatch match)\r
-               {\r
-                       List.Remove (match);\r
-               }\r
-\r
-               private void SetParent (object value, object parent)\r
-               {\r
-                       ((MimeTextMatch) value).SetParent ((MimeTextMatchCollection) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Description {
+       public sealed class MimeTextMatchCollection : CollectionBase {
+
+               #region Properties
+
+               public MimeTextMatch this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (MimeTextMatch) List [index]; 
+                       }
+                       set { List[index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (MimeTextMatch match) 
+               {
+                       Insert (Count, match);
+                       return (Count - 1);
+               }
+
+               public bool Contains (MimeTextMatch match)
+               {
+                       return List.Contains (match);
+               }
+
+               public void CopyTo (MimeTextMatch[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (MimeTextMatch match)
+               {
+                       return List.IndexOf (match);
+               }
+
+               public void Insert (int index, MimeTextMatch match)
+               {
+                       SetParent (match, this);
+                       List.Insert (index, match);
+               }
+       
+               public void Remove (MimeTextMatch match)
+               {
+                       List.Remove (match);
+               }
+
+               private void SetParent (object value, object parent)
+               {
+                       ((MimeTextMatch) value).SetParent ((MimeTextMatchCollection) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 9f3b43e54aac36977e9d4024e458246375bda1da..48ce0c5c37407850d5355b42844396ff6c9e3356 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.MimeXmlBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.MimeXmlBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("mimeXml", "http://schemas.xmlsoap.org/wsdl/mime/", typeof (MimePart), typeof (InputBinding), typeof (OutputBinding))]\r
-       public sealed class MimeXmlBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string part;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public MimeXmlBinding ()\r
-               {\r
-                       part = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("part", DataType = "NMTOKEN")]\r
-               public string Part {\r
-                       get { return part; }\r
-                       set { part = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("mimeXml", "http://schemas.xmlsoap.org/wsdl/mime/", typeof (MimePart), typeof (InputBinding), typeof (OutputBinding))]
+       public sealed class MimeXmlBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string part;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public MimeXmlBinding ()
+               {
+                       part = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("part", DataType = "NMTOKEN")]
+               public string Part {
+                       get { return part; }
+                       set { part = value; }
+               }
+               
+               #endregion // Properties
+       }
+}
index cd5d002d5c6266c3069e2238d3a86f13a798e683..9ee175be4619c59dffbd60fa866fe39d8354871e 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Operation.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Operation.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
+
+using System.ComponentModel;
+using System.Xml;
+using System.Xml.Serialization;
 using System.Web.Services.Configuration;
-\r
-namespace System.Web.Services.Description \r
-{\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class Operation :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-               OperationFaultCollection faults;\r
-               OperationMessageCollection messages;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               string[] parameterOrder;\r
-               PortType portType;\r
+
+namespace System.Web.Services.Description 
+{
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class Operation :
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+               OperationFaultCollection faults;
+               OperationMessageCollection messages;
+#if !NET_2_0
+               string name;
+#endif
+               string[] parameterOrder;
+               PortType portType;
+#if NET_2_0
+               ServiceDescriptionFormatExtensionCollection extensions;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public Operation ()
+               {
+                       faults = new OperationFaultCollection (this);
+                       messages = new OperationMessageCollection (this);
+#if !NET_2_0
+                       name = String.Empty;
 #endif
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public Operation ()\r
-               {\r
-                       faults = new OperationFaultCollection (this);\r
-                       messages = new OperationMessageCollection (this);\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
-                       parameterOrder = null;\r
-                       portType = null;\r
+                       parameterOrder = null;
+                       portType = null;
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
 #endif
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlElement ("fault")]\r
-               public OperationFaultCollection Faults {\r
-                       get { return faults; }\r
-               }\r
-\r
-               [XmlElement ("output", typeof (OperationOutput))]\r
-               [XmlElement ("input", typeof (OperationInput))]\r
-               public OperationMessageCollection Messages {\r
-                       get { return messages; }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlIgnore]\r
-               public string[] ParameterOrder {\r
-                       get { return parameterOrder; }\r
-                       set { parameterOrder = value; }\r
-               }\r
-\r
-               [DefaultValue ("")]\r
-               [XmlAttribute ("parameterOrder")]\r
-               public string ParameterOrderString {\r
-                       get { \r
-                               if (parameterOrder == null)\r
-                                       return String.Empty;\r
-                               return String.Join (" ", parameterOrder); \r
-                       }\r
-                       set { ParameterOrder = value.Split (' '); }\r
-               }\r
-\r
-//             [XmlIgnore]\r
-               public PortType PortType {\r
-                       get { return portType; }\r
-               }\r
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlElement ("fault")]
+               public OperationFaultCollection Faults {
+                       get { return faults; }
+               }
+
+               [XmlElement ("output", typeof (OperationOutput))]
+               [XmlElement ("input", typeof (OperationInput))]
+               public OperationMessageCollection Messages {
+                       get { return messages; }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlIgnore]
+               public string[] ParameterOrder {
+                       get { return parameterOrder; }
+                       set { parameterOrder = value; }
+               }
+
+               [DefaultValue ("")]
+               [XmlAttribute ("parameterOrder")]
+               public string ParameterOrderString {
+                       get { 
+                               if (parameterOrder == null)
+                                       return String.Empty;
+                               return String.Join (" ", parameterOrder); 
+                       }
+                       set { ParameterOrder = value.Split (' '); }
+               }
+
+//             [XmlIgnore]
+               public PortType PortType {
+                       get { return portType; }
+               }
 
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public bool IsBoundBy (OperationBinding operationBinding)\r
-               {\r
-                       return (operationBinding.Name == Name);\r
-               }\r
-\r
-               internal void SetParent (PortType portType)\r
-               {\r
-                       this.portType = portType;\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
+               #endregion // Properties
+
+               #region Methods
+
+               public bool IsBoundBy (OperationBinding operationBinding)
+               {
+                       return (operationBinding.Name == Name);
+               }
+
+               internal void SetParent (PortType portType)
+               {
+                       this.portType = portType;
+               }
+
+               #endregion
+       }
+}
index 4bdf4741ff6e2e3d64b1f8218b6abf2fbcc047cf..0e19225c3cafa862eb1afbc578dafb2467f6c918 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OperationBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OperationBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class OperationBinding :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-               Binding binding;\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-               FaultBindingCollection faults;\r
-               InputBinding input;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               OutputBinding output;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public OperationBinding ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-                       faults = new FaultBindingCollection (this);\r
-                       input = null;\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
-                       output = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-       \r
-//             [XmlIgnore]\r
-               public Binding Binding {\r
-                       get { return binding; }\r
-               }\r
-\r
-               [XmlIgnore]\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class OperationBinding :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+               Binding binding;
+               ServiceDescriptionFormatExtensionCollection extensions;
+               FaultBindingCollection faults;
+               InputBinding input;
+#if !NET_2_0
+               string name;
+#endif
+               OutputBinding output;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public OperationBinding ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+                       faults = new FaultBindingCollection (this);
+                       input = null;
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+                       output = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+       
+//             [XmlIgnore]
+               public Binding Binding {
+                       get { return binding; }
+               }
+
+               [XmlIgnore]
                public 
 #if NET_2_0
                override
 #endif
-               ServiceDescriptionFormatExtensionCollection Extensions {\r
-                       get { return extensions; }\r
-               }\r
-\r
-               [XmlElement ("fault")]\r
-               public FaultBindingCollection Faults {\r
-                       get { return faults; }\r
-               }\r
-\r
-               [XmlElement ("input")]\r
-               public InputBinding Input {\r
-                       get { return input; }\r
-                       set {\r
-                               input = value; \r
-                               if (input != null)\r
-                                       input.SetParent (this);\r
-                       }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlElement ("output")]\r
-               public OutputBinding Output {\r
-                       get { return output; }\r
-                       set {\r
-                               output = value; \r
-                               if (output != null)\r
-                                       output.SetParent (this);\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (Binding binding) \r
-               {\r
-                       this.binding = binding; \r
-               } \r
-\r
-               #endregion\r
-       }\r
-}\r
+               ServiceDescriptionFormatExtensionCollection Extensions {
+                       get { return extensions; }
+               }
+
+               [XmlElement ("fault")]
+               public FaultBindingCollection Faults {
+                       get { return faults; }
+               }
+
+               [XmlElement ("input")]
+               public InputBinding Input {
+                       get { return input; }
+                       set {
+                               input = value; 
+                               if (input != null)
+                                       input.SetParent (this);
+                       }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlElement ("output")]
+               public OutputBinding Output {
+                       get { return output; }
+                       set {
+                               output = value; 
+                               if (output != null)
+                                       output.SetParent (this);
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (Binding binding) 
+               {
+                       this.binding = binding; 
+               } 
+
+               #endregion
+       }
+}
index 3606a49f0b2fb25c816617f1f1e8496d7f74ac65..7b6de2bdbeaa4d5b36624bbb5e57319e21940ac1 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OperationBindingCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OperationBindingCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class OperationBindingCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal OperationBindingCollection (Binding binding)\r
-                       : base (binding)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public OperationBinding this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (OperationBinding) List[index]; \r
-                       }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (OperationBinding bindingOperation) \r
-               {\r
-                       Insert (Count, bindingOperation);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (OperationBinding bindingOperation)\r
-               {\r
-                       return List.Contains (bindingOperation);\r
-               }\r
-\r
-               public void CopyTo (OperationBinding[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (OperationBinding bindingOperation)\r
-               {\r
-                       return List.IndexOf (bindingOperation);\r
-               }\r
-\r
-               public void Insert (int index, OperationBinding bindingOperation)\r
-               {\r
-                       List.Insert (index, bindingOperation);\r
-               }\r
-       \r
-               public void Remove (OperationBinding bindingOperation)\r
-               {\r
-                       List.Remove (bindingOperation);\r
-               }\r
-\r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((OperationBinding) value).SetParent ((Binding) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class OperationBindingCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal OperationBindingCollection (Binding binding)
+                       : base (binding)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public OperationBinding this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (OperationBinding) List[index]; 
+                       }
+                       set { List[index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (OperationBinding bindingOperation) 
+               {
+                       Insert (Count, bindingOperation);
+                       return (Count - 1);
+               }
+
+               public bool Contains (OperationBinding bindingOperation)
+               {
+                       return List.Contains (bindingOperation);
+               }
+
+               public void CopyTo (OperationBinding[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (OperationBinding bindingOperation)
+               {
+                       return List.IndexOf (bindingOperation);
+               }
+
+               public void Insert (int index, OperationBinding bindingOperation)
+               {
+                       List.Insert (index, bindingOperation);
+               }
+       
+               public void Remove (OperationBinding bindingOperation)
+               {
+                       List.Remove (bindingOperation);
+               }
+
+               protected override void SetParent (object value, object parent)
+               {
+                       ((OperationBinding) value).SetParent ((Binding) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index cf7ac35814076cde0856afed5736a774198144d6..d0c5b6686a1888a1386396750740ee3461994970 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OperationCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OperationCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class OperationCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal OperationCollection (PortType portType) \r
-                       : base (portType)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public Operation this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (Operation) List[index]; \r
-                       }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (Operation operation) \r
-               {\r
-                       Insert (Count, operation);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (Operation operation)\r
-               {\r
-                       return List.Contains (operation);\r
-               }\r
-\r
-               public void CopyTo (Operation[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (Operation operation)\r
-               {\r
-                       return List.IndexOf (operation);\r
-               }\r
-\r
-               public void Insert (int index, Operation operation)\r
-               {\r
-                       List.Insert (index, operation);\r
-               }\r
-       \r
-               public void Remove (Operation operation)\r
-               {\r
-                       List.Remove (operation);\r
-               }\r
-\r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((Operation) value).SetParent ((PortType) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class OperationCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal OperationCollection (PortType portType) 
+                       : base (portType)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public Operation this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (Operation) List[index]; 
+                       }
+                       set { List[index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (Operation operation) 
+               {
+                       Insert (Count, operation);
+                       return (Count - 1);
+               }
+
+               public bool Contains (Operation operation)
+               {
+                       return List.Contains (operation);
+               }
+
+               public void CopyTo (Operation[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (Operation operation)
+               {
+                       return List.IndexOf (operation);
+               }
+
+               public void Insert (int index, Operation operation)
+               {
+                       List.Insert (index, operation);
+               }
+       
+               public void Remove (Operation operation)
+               {
+                       List.Remove (operation);
+               }
+
+               protected override void SetParent (object value, object parent)
+               {
+                       ((Operation) value).SetParent ((PortType) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index c09ddb657ad25b70b397bb228bee497edaed2b90..696a9ffa9b738468e22733ed5bd73b2c9760fcf6 100644 (file)
@@ -1,13 +1,13 @@
-// \r
-// System.Web.Services.Description.OperationFault.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
+// 
+// System.Web.Services.Description.OperationFault.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
 //   Ankit Jain (jankit@novell.com)
-//\r
-// Copyright (C) Tim Coleman, 2002\r
+//
+// Copyright (C) Tim Coleman, 2002
 // Copyright (C) 2006 Novell, Inc.  http://www.novell.com
-//\r
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Web.Services.Configuration;\r
+
+using System.Web.Services;
+using System.Web.Services.Configuration;
 using System.Xml.Serialization;
-\r
-namespace System.Web.Services.Description {\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class OperationFault : OperationMessage {\r
+
+namespace System.Web.Services.Description {
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class OperationFault : OperationMessage {
                
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+               ServiceDescriptionFormatExtensionCollection extensions;
 #endif
 
                public OperationFault ()
                {
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
 #endif
                }
                
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-       }\r
-}\r
+       }
+}
index 0cc944f89483d9bbd71971c0009aaedb02777b27..f3968bb2d9abd42b1d1998d49443aa1470450ff8 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OperationFaultCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OperationFaultCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class OperationFaultCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal OperationFaultCollection (Operation operation) \r
-                       : base (operation)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public OperationFault this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (OperationFault) List[index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public OperationFault this [string name] {\r
-                       get { return this [IndexOf ((OperationFault) Table[name])]; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (OperationFault operationFaultMessage) \r
-               {\r
-                       Insert (Count, operationFaultMessage);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (OperationFault operationFaultMessage)\r
-               {\r
-                       return List.Contains (operationFaultMessage);\r
-               }\r
-\r
-               public void CopyTo (OperationFault[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value)\r
-               {\r
-                       if (!(value is OperationFault))\r
-                               throw new InvalidCastException ();\r
-\r
-                       return ((OperationFault) value).Name;\r
-               }\r
-\r
-               public int IndexOf (OperationFault operationFaultMessage)\r
-               {\r
-                       return List.IndexOf (operationFaultMessage);\r
-               }\r
-\r
-               public void Insert (int index, OperationFault operationFaultMessage)\r
-               {\r
-                       List.Insert (index, operationFaultMessage);\r
-               }\r
-       \r
-               public void Remove (OperationFault operationFaultMessage)\r
-               {\r
-                       List.Remove (operationFaultMessage);\r
-               }\r
-\r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((OperationFault) value).SetParent ((Operation) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class OperationFaultCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal OperationFaultCollection (Operation operation) 
+                       : base (operation)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public OperationFault this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (OperationFault) List[index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public OperationFault this [string name] {
+                       get { return this [IndexOf ((OperationFault) Table[name])]; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (OperationFault operationFaultMessage) 
+               {
+                       Insert (Count, operationFaultMessage);
+                       return (Count - 1);
+               }
+
+               public bool Contains (OperationFault operationFaultMessage)
+               {
+                       return List.Contains (operationFaultMessage);
+               }
+
+               public void CopyTo (OperationFault[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value)
+               {
+                       if (!(value is OperationFault))
+                               throw new InvalidCastException ();
+
+                       return ((OperationFault) value).Name;
+               }
+
+               public int IndexOf (OperationFault operationFaultMessage)
+               {
+                       return List.IndexOf (operationFaultMessage);
+               }
+
+               public void Insert (int index, OperationFault operationFaultMessage)
+               {
+                       List.Insert (index, operationFaultMessage);
+               }
+       
+               public void Remove (OperationFault operationFaultMessage)
+               {
+                       List.Remove (operationFaultMessage);
+               }
+
+               protected override void SetParent (object value, object parent)
+               {
+                       ((OperationFault) value).SetParent ((Operation) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 738b750070e777e1c8d6b542e104b31aec5c739f..812554f0e0e1ca940eeee6ca1f165cce074d5dd9 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OperationFlow.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OperationFlow.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public enum OperationFlow {\r
-               None = 0x0,\r
-               Notification = 0x2,\r
-               OneWay = 0x1,\r
-               RequestResponse = 0x3,\r
-               SolicitResponse = 0x4\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public enum OperationFlow {
+               None = 0x0,
+               Notification = 0x2,
+               OneWay = 0x1,
+               RequestResponse = 0x3,
+               SolicitResponse = 0x4
+       }
+}
index 7d6071cb92442725cd335ad2ac27cc9f329a37a1..5f88637b6a5f292dba81b782b9ebe52f11bf3618 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Description.OperationInput.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
+// 
+// System.Web.Services.Description.OperationInput.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
 //   Ankit Jain (jankit@novell.com)
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Web.Services.Configuration;\r
+
+using System.Web.Services;
+using System.Web.Services.Configuration;
 using System.Xml.Serialization;
-\r
-namespace System.Web.Services.Description {\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class OperationInput : OperationMessage {\r
+
+namespace System.Web.Services.Description {
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class OperationInput : OperationMessage {
                
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+               ServiceDescriptionFormatExtensionCollection extensions;
 #endif
 
                public OperationInput ()
                {
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
 #endif
                }
                
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-       }\r
-}\r
+       }
+}
index 660fabae49886ce47b20c0b37341371f33d45f77..b5ccec9c0fb15cda660554ddfaf31673a0d44410 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OperationMessage.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OperationMessage.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description\r
-{\r
-       public abstract class OperationMessage :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-               XmlQualifiedName message;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               Operation operation;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               protected OperationMessage ()\r
-               {\r
-                       message = XmlQualifiedName.Empty;\r
-                       operation = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("message")]\r
-               public XmlQualifiedName Message {\r
-                       get { return message; }\r
-                       set { message = value; }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NMTOKEN")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-//             [XmlIgnore]\r
-               public Operation Operation {\r
-                       get { return operation; }\r
-               }\r
 
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (Operation operation)\r
-               {\r
-                       this.operation = operation;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+using System.Web.Services;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description
+{
+       public abstract class OperationMessage :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+               XmlQualifiedName message;
+#if !NET_2_0
+               string name;
+#endif
+               Operation operation;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               protected OperationMessage ()
+               {
+                       message = XmlQualifiedName.Empty;
+                       operation = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("message")]
+               public XmlQualifiedName Message {
+                       get { return message; }
+                       set { message = value; }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NMTOKEN")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+//             [XmlIgnore]
+               public Operation Operation {
+                       get { return operation; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (Operation operation)
+               {
+                       this.operation = operation;
+               }
+
+               #endregion // Methods
+       }
+}
index fe1823431ab5606cc505364f2957e4956eb71ecf..8e074be5a7a6e0a6a90a1876c7b9ccb6b5ebf7ca 100644 (file)
-// \r
-// System.Web.Services.Description.OperationMessageCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class OperationMessageCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal OperationMessageCollection (Operation operation)\r
-                       : base (operation)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public OperationFlow Flow {\r
-                       get { \r
-                               switch (Count) {\r
-                               case 1: \r
-                                       if (this[0] is OperationInput)\r
-                                               return OperationFlow.OneWay;\r
-                                       else\r
-                                               return OperationFlow.Notification;\r
-                               case 2:\r
-                                       if (this[0] is OperationInput)\r
-                                               return OperationFlow.RequestResponse;\r
-                                       else\r
-                                               return OperationFlow.SolicitResponse;\r
-                               }\r
-                               return OperationFlow.None;\r
-                       }\r
-               }\r
-\r
-               public OperationInput Input {\r
-                       get { \r
-                               foreach (object message in List)\r
-                                       if (message is OperationInput)\r
-                                               return (OperationInput) message;\r
-                               return null;\r
-                       }\r
-               }\r
-       \r
-               public OperationMessage this [int index] {\r
-                       get { return (OperationMessage) List[index]; }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               public OperationOutput Output {\r
-                       get { \r
-                               foreach (object message in List)\r
-                                       if (message is OperationOutput)\r
-                                               return (OperationOutput) message;\r
-                               return null;\r
-                       }\r
-               }\r
-\r
-               internal OperationFault Fault {\r
-                       get { \r
-                               foreach (object message in List)\r
-                                       if (message is OperationFault)\r
-                                               return (OperationFault) message;\r
-                               return null;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (OperationMessage operationMessage) \r
-               {\r
-                       Insert (Count, operationMessage);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (OperationMessage operationMessage)\r
-               {\r
-                       return List.Contains (operationMessage);\r
-               }\r
-\r
-               public void CopyTo (OperationMessage[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (OperationMessage operationMessage)\r
-               {\r
-                       return List.IndexOf (operationMessage);\r
-               }\r
-\r
-               public void Insert (int index, OperationMessage operationMessage)\r
-               {\r
-                       List.Insert (index, operationMessage);\r
-               }\r
-\r
-               protected override void OnInsert (int index, object value)\r
-               {\r
-                       if (Count == 0)\r
-                               return;\r
-                       \r
-                       if (Count == 1 && value.GetType() != this[0].GetType())\r
-                               return;\r
-\r
-                               throw new InvalidOperationException ("The operation object can only contain one input and one output message.");\r
-               }\r
-\r
-               protected override void OnSet (int index, object oldValue, object newValue)\r
-               {\r
-                       if (oldValue.GetType () != newValue.GetType ())\r
-                               throw new InvalidOperationException ("The message types of the old and new value are not the same.");\r
-                       base.OnSet (index, oldValue, newValue);\r
-               }\r
-\r
-               protected override void OnValidate (object value)\r
-               {\r
-                       if (value == null)\r
-                               throw new ArgumentException("The message object is a null reference.");\r
-                       if (!(value is OperationInput || value is OperationOutput))\r
-                               throw new ArgumentException ("The message object is not an input or an output message.");\r
-               }\r
-       \r
-               public void Remove (OperationMessage operationMessage)\r
-               {\r
-                       List.Remove (operationMessage);\r
-               }\r
-\r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((OperationMessage) value).SetParent ((Operation) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+// 
+// System.Web.Services.Description.OperationMessageCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Web.Services;
+
+namespace System.Web.Services.Description {
+       public sealed class OperationMessageCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal OperationMessageCollection (Operation operation)
+                       : base (operation)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public OperationFlow Flow {
+                       get { 
+                               switch (Count) {
+                               case 1: 
+                                       if (this[0] is OperationInput)
+                                               return OperationFlow.OneWay;
+                                       else
+                                               return OperationFlow.Notification;
+                               case 2:
+                                       if (this[0] is OperationInput)
+                                               return OperationFlow.RequestResponse;
+                                       else
+                                               return OperationFlow.SolicitResponse;
+                               }
+                               return OperationFlow.None;
+                       }
+               }
+
+               public OperationInput Input {
+                       get { 
+                               foreach (object message in List)
+                                       if (message is OperationInput)
+                                               return (OperationInput) message;
+                               return null;
+                       }
+               }
+       
+               public OperationMessage this [int index] {
+                       get { return (OperationMessage) List[index]; }
+                       set { List[index] = value; }
+               }
+
+               public OperationOutput Output {
+                       get { 
+                               foreach (object message in List)
+                                       if (message is OperationOutput)
+                                               return (OperationOutput) message;
+                               return null;
+                       }
+               }
+
+               internal OperationFault Fault {
+                       get { 
+                               foreach (object message in List)
+                                       if (message is OperationFault)
+                                               return (OperationFault) message;
+                               return null;
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (OperationMessage operationMessage) 
+               {
+                       Insert (Count, operationMessage);
+                       return (Count - 1);
+               }
+
+               public bool Contains (OperationMessage operationMessage)
+               {
+                       return List.Contains (operationMessage);
+               }
+
+               public void CopyTo (OperationMessage[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (OperationMessage operationMessage)
+               {
+                       return List.IndexOf (operationMessage);
+               }
+
+               public void Insert (int index, OperationMessage operationMessage)
+               {
+                       List.Insert (index, operationMessage);
+               }
+
+               protected override void OnInsert (int index, object value)
+               {
+                       if (Count == 0)
+                               return;
+                       
+                       if (Count == 1 && value.GetType() != this[0].GetType())
+                               return;
+
+                               throw new InvalidOperationException ("The operation object can only contain one input and one output message.");
+               }
+
+               protected override void OnSet (int index, object oldValue, object newValue)
+               {
+                       if (oldValue.GetType () != newValue.GetType ())
+                               throw new InvalidOperationException ("The message types of the old and new value are not the same.");
+                       base.OnSet (index, oldValue, newValue);
+               }
+
+               protected override void OnValidate (object value)
+               {
+                       if (value == null)
+                               throw new ArgumentException("The message object is a null reference.");
+                       if (!(value is OperationInput || value is OperationOutput))
+                               throw new ArgumentException ("The message object is not an input or an output message.");
+               }
+       
+               public void Remove (OperationMessage operationMessage)
+               {
+                       List.Remove (operationMessage);
+               }
+
+               protected override void SetParent (object value, object parent)
+               {
+                       ((OperationMessage) value).SetParent ((Operation) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index d0540b45b3bd9a58d41d3db9cf57d55f97a19436..bc6d34f36745041200dde0530e247e769650e306 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Description.OperationOutput.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
+// 
+// System.Web.Services.Description.OperationOutput.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
 //   Ankit Jain (jankit@novell.com)
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
+
+using System.Web.Services.Configuration;
 using System.Xml.Serialization;
 
-namespace System.Web.Services.Description {\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class OperationOutput : OperationMessage {\r
+namespace System.Web.Services.Description {
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class OperationOutput : OperationMessage {
 
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+               ServiceDescriptionFormatExtensionCollection extensions;
 #endif
 
                public OperationOutput ()
                {
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
 #endif
                }
                
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-       }\r
-}\r
+       }
+}
index 3df29059c48bb83d6f0d0a511c2f2262dea6cc50..43f70c59acd5526ee2cfc757a2554f9abcde77c3 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.OutputBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.OutputBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class OutputBinding : MessageBinding {\r
-\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public OutputBinding ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public override ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class OutputBinding : MessageBinding {
+
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public OutputBinding ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public override ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+       
+               #endregion // Properties
+       }
+}
index ddd51f8784ae41abcaa03f41a3e783af4043bd0e..c647c06d6be9870eba1ff0e2b085ce3d3e0b79da 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Port.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Port.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class Port :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-               XmlQualifiedName binding;\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               Service service;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public Port ()\r
-               {\r
-                       binding = null;\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
-                       service = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("binding")]\r
-               public XmlQualifiedName Binding {\r
-                       get { return binding; }\r
-                       set { binding = value; }\r
-               }\r
-\r
-               [XmlIgnore]\r
+
+using System.Web.Services.Configuration;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description 
+{
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class Port :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+               XmlQualifiedName binding;
+               ServiceDescriptionFormatExtensionCollection extensions;
+#if !NET_2_0
+               string name;
+#endif
+               Service service;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public Port ()
+               {
+                       binding = null;
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+                       service = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("binding")]
+               public XmlQualifiedName Binding {
+                       get { return binding; }
+                       set { binding = value; }
+               }
+
+               [XmlIgnore]
                public 
 #if NET_2_0
                override
 #endif
-               ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]    \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-//             [XmlIgnore]\r
-               public Service Service {\r
-                       get { return service; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (Service service) \r
-               {\r
-                       this.service = service;\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
+               ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]    
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+//             [XmlIgnore]
+               public Service Service {
+                       get { return service; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (Service service) 
+               {
+                       this.service = service;
+               }
+
+               #endregion
+       }
+}
index 79e51ec978c63b747fb65fcdc360c5f60563766b..fec4593f90df6b04d5f674dc898b4376cceee4b1 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.PortCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.PortCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class PortCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal PortCollection (Service service)\r
-                       : base (service)\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public Port this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (Port) List[index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public Port this [string name] {\r
-                       get { \r
-                               int index = IndexOf ((Port) Table[name]);\r
-                               if (index >= 0)\r
-                                       return this[index]; \r
-                               return null;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (Port port) \r
-               {\r
-                       Insert (Count, port);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (Port port)\r
-               {\r
-                       return List.Contains (port);\r
-               }\r
-\r
-               public void CopyTo (Port[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is Port))\r
-                               throw new InvalidCastException ();\r
-\r
-                       return ((Port) value).Name;\r
-               }\r
-\r
-               public int IndexOf (Port port)\r
-               {\r
-                       return List.IndexOf (port);\r
-               }\r
-\r
-               public void Insert (int index, Port port)\r
-               {\r
-                       List.Insert (index, port);\r
-               }\r
-       \r
-               public void Remove (Port port)\r
-               {\r
-                       List.Remove (port);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((Port) value).SetParent ((Service) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class PortCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal PortCollection (Service service)
+                       : base (service)
+               {
+               }
+
+               #endregion
+
+               #region Properties
+
+               public Port this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (Port) List[index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public Port this [string name] {
+                       get { 
+                               int index = IndexOf ((Port) Table[name]);
+                               if (index >= 0)
+                                       return this[index]; 
+                               return null;
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (Port port) 
+               {
+                       Insert (Count, port);
+                       return (Count - 1);
+               }
+
+               public bool Contains (Port port)
+               {
+                       return List.Contains (port);
+               }
+
+               public void CopyTo (Port[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is Port))
+                               throw new InvalidCastException ();
+
+                       return ((Port) value).Name;
+               }
+
+               public int IndexOf (Port port)
+               {
+                       return List.IndexOf (port);
+               }
+
+               public void Insert (int index, Port port)
+               {
+                       List.Insert (index, port);
+               }
+       
+               public void Remove (Port port)
+               {
+                       List.Remove (port);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((Port) value).SetParent ((Service) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 9007a65c64a7668448d95d1ccd88f6c8799a614d..6267be4c150b4b81d1eada865da3b03fbe869743 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.PortType.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.PortType.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml.Serialization;\r
+
+using System.Xml.Serialization;
 using System.Web.Services.Configuration;
-\r
-namespace System.Web.Services.Description\r
-{\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class PortType :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               OperationCollection operations;\r
-               ServiceDescription serviceDescription;\r
+
+namespace System.Web.Services.Description
+{
 #if NET_2_0
-               ServiceDescriptionFormatExtensionCollection extensions;\r
+       [XmlFormatExtensionPoint ("Extensions")]
 #endif
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public PortType ()\r
-               {\r
-                       operations = new OperationCollection (this);\r
-                       serviceDescription = null;\r
+       public sealed class PortType :
 #if NET_2_0
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
+               NamedItem
+#else
+               DocumentableItem 
 #endif
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlElement ("operation")]\r
-               public OperationCollection Operations {\r
-                       get { return operations; }\r
-               }\r
-       \r
-//             [XmlIgnore]\r
-               public ServiceDescription ServiceDescription {\r
-                       get { return serviceDescription; }\r
-               }\r
+       {
+               #region Fields
+
+#if !NET_2_0
+               string name;
+#endif
+               OperationCollection operations;
+               ServiceDescription serviceDescription;
+#if NET_2_0
+               ServiceDescriptionFormatExtensionCollection extensions;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public PortType ()
+               {
+                       operations = new OperationCollection (this);
+                       serviceDescription = null;
+#if NET_2_0
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#endif
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlElement ("operation")]
+               public OperationCollection Operations {
+                       get { return operations; }
+               }
+       
+//             [XmlIgnore]
+               public ServiceDescription ServiceDescription {
+                       get { return serviceDescription; }
+               }
 
 #if NET_2_0
                [XmlIgnore]
                public override ServiceDescriptionFormatExtensionCollection Extensions {
-                       get { return extensions; }\r
-               }\r
+                       get { return extensions; }
+               }
 #endif
 
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (ServiceDescription serviceDescription)\r
-               {\r
-                       this.serviceDescription = serviceDescription;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (ServiceDescription serviceDescription)
+               {
+                       this.serviceDescription = serviceDescription;
+               }
+
+               #endregion // Methods
+       }
+}
index 8c176b874e6a8655613db9b8bc1aa9ab28e00f83..43fd98aed9a4499e040ae16eb9cb205e615c7146 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.PortTypeCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.PortTypeCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class PortTypeCollection : ServiceDescriptionBaseCollection {\r
-\r
-               #region Constructors\r
-\r
-               internal PortTypeCollection (ServiceDescription serviceDescription)\r
-                       : base (serviceDescription)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public PortType this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (PortType) List[index]; \r
-                       }\r
-                        set { List [index] = value; }\r
-               }\r
-\r
-               public PortType this [string name] {\r
-                       get { \r
-                               int index = IndexOf ((PortType) Table[name]);\r
-                               if (index >= 0)\r
-                                       return this[index]; \r
-                               return null;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (PortType portType) \r
-               {\r
-                       Insert (Count, portType);       \r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (PortType portType)\r
-               {\r
-                       return List.Contains (portType);\r
-               }\r
-\r
-               public void CopyTo (PortType[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is PortType))\r
-                               throw new InvalidCastException ();\r
-                       return ((PortType) value).Name;\r
-               }\r
-\r
-               public int IndexOf (PortType portType)\r
-               {\r
-                       return List.IndexOf (portType);\r
-               }\r
-\r
-               public void Insert (int index, PortType portType)\r
-               {\r
-                       List.Insert (index, portType);\r
-               }\r
-       \r
-               public void Remove (PortType portType)\r
-               {\r
-                       List.Remove (portType);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((PortType) value).SetParent ((ServiceDescription) parent); \r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public sealed class PortTypeCollection : ServiceDescriptionBaseCollection {
+
+               #region Constructors
+
+               internal PortTypeCollection (ServiceDescription serviceDescription)
+                       : base (serviceDescription)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public PortType this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (PortType) List[index]; 
+                       }
+                        set { List [index] = value; }
+               }
+
+               public PortType this [string name] {
+                       get { 
+                               int index = IndexOf ((PortType) Table[name]);
+                               if (index >= 0)
+                                       return this[index]; 
+                               return null;
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (PortType portType) 
+               {
+                       Insert (Count, portType);       
+                       return (Count - 1);
+               }
+
+               public bool Contains (PortType portType)
+               {
+                       return List.Contains (portType);
+               }
+
+               public void CopyTo (PortType[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is PortType))
+                               throw new InvalidCastException ();
+                       return ((PortType) value).Name;
+               }
+
+               public int IndexOf (PortType portType)
+               {
+                       return List.IndexOf (portType);
+               }
+
+               public void Insert (int index, PortType portType)
+               {
+                       List.Insert (index, portType);
+               }
+       
+               public void Remove (PortType portType)
+               {
+                       List.Remove (portType);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((PortType) value).SetParent ((ServiceDescription) parent); 
+               }
+                       
+               #endregion // Methods
+       }
+}
index 9092bb3d4cf96043b6a9684abb2f8b6289a7f2b1..3729cfb1340ebffe9e339b12c378504c7649807b 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Service.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Service.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml.Serialization;\r
+
+using System.Xml.Serialization;
 using System.Web.Services.Configuration;
-\r
-namespace System.Web.Services.Description\r
-{\r
-#if NET_2_0\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-#endif\r
-       public sealed class Service :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               PortCollection ports;\r
-               ServiceDescription serviceDescription;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               public Service ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-#if !NET_2_0\r
-                       name = String.Empty;\r
-#endif\r
-                       ports = new PortCollection (this);\r
-                       serviceDescription = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
+
+namespace System.Web.Services.Description
+{
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class Service :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+#if !NET_2_0
+               string name;
+#endif
+               PortCollection ports;
+               ServiceDescription serviceDescription;
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               public Service ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+                       ports = new PortCollection (this);
+                       serviceDescription = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
                public
 #if NET_2_0
                override
 #endif
-               ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NCName")]    \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlElement ("port")]   \r
-               public PortCollection Ports {\r
-                       get { return ports; }\r
-               }\r
-\r
-//             [XmlIgnore]\r
-               public ServiceDescription ServiceDescription {\r
-                       get { return serviceDescription; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (ServiceDescription serviceDescription) \r
-               {\r
-                       this.serviceDescription = serviceDescription;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+               ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]    
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlElement ("port")]   
+               public PortCollection Ports {
+                       get { return ports; }
+               }
+
+//             [XmlIgnore]
+               public ServiceDescription ServiceDescription {
+                       get { return serviceDescription; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (ServiceDescription serviceDescription) 
+               {
+                       this.serviceDescription = serviceDescription;
+               }
+
+               #endregion // Methods
+       }
+}
index 996011ac826457d6c08f6e564042ecf0339fcff4..844cbee6d679afee6ff8e0a06d2ce1da8113728f 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.ServiceCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class ServiceCollection : ServiceDescriptionBaseCollection {\r
-               \r
-               #region Constructors\r
-       \r
-               internal ServiceCollection (ServiceDescription serviceDescription)\r
-                       : base (serviceDescription)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public Service this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (Service) List[index]; \r
-                       }\r
-                       set { List [index] = value; }\r
-               }\r
-\r
-               public Service this [string name] {\r
-                       get { \r
-                               int index = IndexOf ((Service) Table[name]);\r
-                               if (index >= 0)\r
-                                       return this[index]; \r
-                               return null;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (Service service) \r
-               {\r
-                       Insert (Count, service);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (Service service)\r
-               {\r
-                       return List.Contains (service);\r
-               }\r
-\r
-               public void CopyTo (Service[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       if (!(value is Service))\r
-                               throw new InvalidCastException ();\r
-\r
-                       return ((Service) value).Name;\r
-               }\r
-\r
-               public int IndexOf (Service service)\r
-               {\r
-                       return List.IndexOf (service);\r
-               }\r
-\r
-               public void Insert (int index, Service service)\r
-               {\r
-                       List.Insert (index, service);\r
-               }\r
-       \r
-               public void Remove (Service service)\r
-               {\r
-                       List.Remove (service);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
-                       ((Service) value).SetParent ((ServiceDescription) parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Web.Services;
+
+namespace System.Web.Services.Description {
+       public sealed class ServiceCollection : ServiceDescriptionBaseCollection {
+               
+               #region Constructors
+       
+               internal ServiceCollection (ServiceDescription serviceDescription)
+                       : base (serviceDescription)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public Service this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (Service) List[index]; 
+                       }
+                       set { List [index] = value; }
+               }
+
+               public Service this [string name] {
+                       get { 
+                               int index = IndexOf ((Service) Table[name]);
+                               if (index >= 0)
+                                       return this[index]; 
+                               return null;
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (Service service) 
+               {
+                       Insert (Count, service);
+                       return (Count - 1);
+               }
+
+               public bool Contains (Service service)
+               {
+                       return List.Contains (service);
+               }
+
+               public void CopyTo (Service[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       if (!(value is Service))
+                               throw new InvalidCastException ();
+
+                       return ((Service) value).Name;
+               }
+
+               public int IndexOf (Service service)
+               {
+                       return List.IndexOf (service);
+               }
+
+               public void Insert (int index, Service service)
+               {
+                       List.Insert (index, service);
+               }
+       
+               public void Remove (Service service)
+               {
+                       List.Remove (service);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
+                       ((Service) value).SetParent ((ServiceDescription) parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 100165218254a477139db5d03eaa889edeab8105..7c3af1e1732e2f997e571ded490a6d79b2761693 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Description.ServiceDescription.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescription.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Reflection;\r
-using System.Web.Services;\r
-using System.Web.Services.Configuration;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
+
+using System.IO;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Reflection;
+using System.Web.Services;
+using System.Web.Services.Configuration;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
 
 #if NET_2_0
 using System.Collections.Generic;
 #endif
-\r
-namespace System.Web.Services.Description\r
-{\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       [XmlRoot ("definitions", Namespace = "http://schemas.xmlsoap.org/wsdl/")]\r
-       public sealed class ServiceDescription :\r
-#if NET_2_0\r
-               NamedItem\r
-#else\r
-               DocumentableItem \r
-#endif\r
-       {\r
-               #region Fields\r
-\r
-               public const string Namespace = "http://schemas.xmlsoap.org/wsdl/";\r
-\r
-               BindingCollection bindings;\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-               ImportCollection imports;\r
-               MessageCollection messages;\r
-#if !NET_2_0\r
-               string name;\r
-#endif\r
-               PortTypeCollection portTypes;\r
-               string retrievalUrl;\r
-               ServiceDescriptionCollection serviceDescriptions;\r
-               ServiceCollection services;\r
-               string targetNamespace;\r
-               Types types;\r
-               static ServiceDescriptionSerializer serializer;\r
-#if NET_2_0\r
-               StringCollection validationWarnings;\r
-\r
-               static XmlSchema schema;\r
-#endif\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               static ServiceDescription ()\r
-               {\r
-                       serializer = new ServiceDescriptionSerializer ();\r
-               }\r
-\r
-               public ServiceDescription ()\r
-               {\r
-                       bindings = new BindingCollection (this);\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-                       imports = new ImportCollection (this);\r
-                       messages = new MessageCollection (this);\r
-#if !NET_2_0\r
-//                     name = String.Empty;            \r
-#endif\r
-                       portTypes = new PortTypeCollection (this);\r
-\r
-                       serviceDescriptions = null;\r
-                       services = new ServiceCollection (this);\r
+
+namespace System.Web.Services.Description
+{
+       [XmlFormatExtensionPoint ("Extensions")]
+       [XmlRoot ("definitions", Namespace = "http://schemas.xmlsoap.org/wsdl/")]
+       public sealed class ServiceDescription :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+               public const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
+
+               BindingCollection bindings;
+               ServiceDescriptionFormatExtensionCollection extensions;
+               ImportCollection imports;
+               MessageCollection messages;
+#if !NET_2_0
+               string name;
+#endif
+               PortTypeCollection portTypes;
+               string retrievalUrl;
+               ServiceDescriptionCollection serviceDescriptions;
+               ServiceCollection services;
+               string targetNamespace;
+               Types types;
+               static ServiceDescriptionSerializer serializer;
+#if NET_2_0
+               StringCollection validationWarnings;
+
+               static XmlSchema schema;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+
+               static ServiceDescription ()
+               {
+                       serializer = new ServiceDescriptionSerializer ();
+               }
+
+               public ServiceDescription ()
+               {
+                       bindings = new BindingCollection (this);
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+                       imports = new ImportCollection (this);
+                       messages = new MessageCollection (this);
+#if !NET_2_0
+//                     name = String.Empty;            
+#endif
+                       portTypes = new PortTypeCollection (this);
+
+                       serviceDescriptions = null;
+                       services = new ServiceCollection (this);
                        targetNamespace = null;
-                       types = new Types ();\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-#if NET_2_0\r
-               public static XmlSchema Schema {\r
-                       get {\r
-                               if (schema == null) {\r
-                                       schema = XmlSchema.Read (typeof (ServiceDescription).Assembly.GetManifestResourceStream ("wsdl-1.1.xsd"), null);\r
-                               }\r
-                               return schema;\r
-                       }\r
-               }\r
-#endif\r
-\r
-               [XmlElement ("import")]\r
-               public ImportCollection Imports {\r
-                       get { return imports; }\r
-               }\r
-\r
-               [XmlElement ("types")]\r
-               public Types Types {\r
-                       get { return types; }\r
-                       set { types = value; }\r
-               }\r
-\r
-               [XmlElement ("message")]\r
-               public MessageCollection Messages {\r
-                       get { return messages; }\r
-               }\r
-\r
-               [XmlElement ("portType")]       \r
-               public PortTypeCollection PortTypes {\r
-                       get { return portTypes; }\r
-               }\r
-       \r
-               [XmlElement ("binding")]\r
-               public BindingCollection Bindings {\r
-                       get { return bindings; }\r
-               }\r
-\r
-               [XmlIgnore]\r
+                       types = new Types ();
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+#if NET_2_0
+               public static XmlSchema Schema {
+                       get {
+                               if (schema == null) {
+                                       schema = XmlSchema.Read (typeof (ServiceDescription).Assembly.GetManifestResourceStream ("wsdl-1.1.xsd"), null);
+                               }
+                               return schema;
+                       }
+               }
+#endif
+
+               [XmlElement ("import")]
+               public ImportCollection Imports {
+                       get { return imports; }
+               }
+
+               [XmlElement ("types")]
+               public Types Types {
+                       get { return types; }
+                       set { types = value; }
+               }
+
+               [XmlElement ("message")]
+               public MessageCollection Messages {
+                       get { return messages; }
+               }
+
+               [XmlElement ("portType")]       
+               public PortTypeCollection PortTypes {
+                       get { return portTypes; }
+               }
+       
+               [XmlElement ("binding")]
+               public BindingCollection Bindings {
+                       get { return bindings; }
+               }
+
+               [XmlIgnore]
                public 
 #if NET_2_0
                override
 #endif
-               ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-\r
-#if !NET_2_0\r
-               [XmlAttribute ("name", DataType = "NMTOKEN")]   \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-\r
-               [XmlIgnore]     \r
-               public string RetrievalUrl {\r
-                       get { return retrievalUrl; }\r
-                       set { retrievalUrl = value; }\r
-               }\r
-       \r
-               [XmlIgnore]     \r
-               public static XmlSerializer Serializer {\r
-                       get { return serializer; }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public ServiceDescriptionCollection ServiceDescriptions {\r
-                       get { \r
-                               return serviceDescriptions; \r
-                       }\r
-               }\r
-\r
-               [XmlElement ("service")]\r
-               public ServiceCollection Services {\r
-                       get { return services; }\r
-               }\r
-\r
-               [XmlAttribute ("targetNamespace")]\r
-               public string TargetNamespace {\r
-                       get { return targetNamespace; }\r
-                       set { targetNamespace = value; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [XmlIgnore]\r
-               public StringCollection ValidationWarnings {\r
-                       get { return validationWarnings; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public static bool CanRead (XmlReader reader)\r
-               {\r
-                       reader.MoveToContent ();\r
-                       return reader.LocalName == "definitions" && \r
-                               reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/";\r
-               }\r
-\r
-#if NET_2_0\r
-               public static ServiceDescription Read (string fileName, bool validate)\r
-               {\r
-                       if (validate)\r
-                               using (XmlReader reader = XmlReader.Create (fileName)) {\r
-                                       return Read (reader, true);\r
-                               }\r
-                       else\r
-                               return Read (fileName);\r
-               }\r
-\r
-               public static ServiceDescription Read (Stream stream, bool validate)\r
-               {\r
-                       if (validate)\r
-                               return Read (XmlReader.Create (stream), true);\r
-                       else\r
-                               return Read (stream);\r
-               }\r
-\r
-               public static ServiceDescription Read (TextReader reader, bool validate)\r
-               {\r
-                       if (validate)\r
-                               return Read (XmlReader.Create (reader), true);\r
-                       else\r
-                               return Read (reader);\r
-               }\r
-\r
-               public static ServiceDescription Read (XmlReader reader, bool validate)\r
-               {\r
-                       if (validate) {\r
-                               StringCollection sc = new StringCollection ();\r
-                               XmlReaderSettings s = new XmlReaderSettings ();\r
-                               s.ValidationType = ValidationType.Schema;\r
-                               s.Schemas.Add (Schema);\r
-                               s.ValidationEventHandler += delegate (object o, ValidationEventArgs e) {\r
-                                       sc.Add (e.Message);\r
-                               };\r
-\r
-                               ServiceDescription ret = Read (XmlReader.Create (reader, s));\r
-                               ret.validationWarnings = sc;\r
-                               return ret;\r
-                       }\r
-                       else\r
-                               return Read (reader);\r
-               }\r
-#endif\r
-\r
-               public static ServiceDescription Read (Stream stream)\r
-               {\r
-                       return (ServiceDescription) serializer.Deserialize (stream);\r
-               }\r
-\r
-               public static ServiceDescription Read (string fileName)\r
-               {\r
-                       return Read (new FileStream (fileName, FileMode.Open));\r
-               }\r
-\r
-               public static ServiceDescription Read (TextReader textReader)\r
-               {\r
-                       return (ServiceDescription) serializer.Deserialize (textReader);\r
-               }\r
-\r
-               public static ServiceDescription Read (XmlReader reader)\r
-               {\r
-                       return (ServiceDescription) serializer.Deserialize (reader);\r
-               }\r
-\r
-               public void Write (Stream stream)\r
-               {\r
-                       serializer.Serialize (stream, this, GetNamespaceList ());\r
-               }\r
-\r
-               public void Write (string fileName)\r
-               {\r
-                       Write (new FileStream (fileName, FileMode.Create));\r
-               }\r
-\r
-               public void Write (TextWriter writer)\r
-               {\r
-                       serializer.Serialize (writer, this, GetNamespaceList ());\r
-               }\r
-\r
-               public void Write (XmlWriter writer)\r
-               {\r
-                       serializer.Serialize (writer, this, GetNamespaceList ());\r
-               }\r
-\r
-               internal void SetParent (ServiceDescriptionCollection serviceDescriptions)\r
-               {\r
-                       this.serviceDescriptions = serviceDescriptions; \r
-               }\r
-               \r
-               XmlSerializerNamespaces GetNamespaceList ()\r
-               {\r
-                       XmlSerializerNamespaces ns;\r
-                       ns = new XmlSerializerNamespaces ();\r
-                       ns.Add ("soap", SoapBinding.Namespace);\r
-                       ns.Add ("soapenc", "http://schemas.xmlsoap.org/soap/encoding/");\r
-                       ns.Add ("s", XmlSchema.Namespace);\r
-                       ns.Add ("http", HttpBinding.Namespace);\r
-                       ns.Add ("mime", MimeContentBinding.Namespace);\r
-                       ns.Add ("tm", MimeTextBinding.Namespace);\r
-                       ns.Add ("s0", TargetNamespace);\r
-                       \r
-                       AddExtensionNamespaces (ns, Extensions);\r
-                       \r
-                       if (Types != null) AddExtensionNamespaces (ns, Types.Extensions);\r
-                       \r
-                       foreach (Service ser in Services)\r
-                               foreach (Port port in ser.Ports)\r
-                                       AddExtensionNamespaces (ns, port.Extensions);\r
-\r
-                       foreach (Binding bin in Bindings)\r
-                       {\r
-                               AddExtensionNamespaces (ns, bin.Extensions);\r
-                               foreach (OperationBinding op in bin.Operations)\r
-                               {\r
-                                       AddExtensionNamespaces (ns, op.Extensions);\r
-                                       if (op.Input != null) AddExtensionNamespaces (ns, op.Input.Extensions);\r
-                                       if (op.Output != null) AddExtensionNamespaces (ns, op.Output.Extensions);\r
-                               }\r
-                       }\r
-                       return ns;\r
-               }\r
-               \r
-               void AddExtensionNamespaces (XmlSerializerNamespaces ns, ServiceDescriptionFormatExtensionCollection extensions)\r
-               {\r
-                       foreach (ServiceDescriptionFormatExtension ext in extensions)\r
-                       {\r
-                               ExtensionInfo einf = ExtensionManager.GetFormatExtensionInfo (ext.GetType ());\r
-                               foreach (XmlQualifiedName qname in einf.NamespaceDeclarations)\r
-                                       ns.Add (qname.Name, qname.Namespace);\r
-                       }\r
-               }\r
-               \r
-               internal static void WriteExtensions (XmlWriter writer, object ob)\r
-               {\r
-                       ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint (ob);\r
-                       if (extensions != null)\r
-                       {\r
-                               foreach (ServiceDescriptionFormatExtension ext in extensions)\r
-                                       WriteExtension (writer, ext);\r
-                       }\r
-               }\r
-               \r
-               static void WriteExtension (XmlWriter writer, ServiceDescriptionFormatExtension ext)\r
-               {\r
-                       Type type = ext.GetType ();\r
-                       ExtensionInfo info = ExtensionManager.GetFormatExtensionInfo (type);\r
-                       \r
-//                             if (prefix != null && prefix != "")\r
-//                                     Writer.WriteStartElement (prefix, info.ElementName, info.Namespace);\r
-//                             else\r
-//                                     WriteStartElement (info.ElementName, info.Namespace, false);\r
-\r
-                       XmlSerializerNamespaces ns = new XmlSerializerNamespaces ();\r
-                       ns.Add ("","");\r
-                       info.Serializer.Serialize (writer, ext, ns);\r
-               }\r
-               \r
-               internal static void ReadExtension (XmlDocument doc, XmlReader reader, object ob)\r
-               {\r
-                       ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint (ob);\r
-                       if (extensions != null)\r
-                       {\r
-                               ExtensionInfo info = ExtensionManager.GetFormatExtensionInfo (reader.LocalName, reader.NamespaceURI);\r
-                               if (info != null)\r
-                               {\r
-                                       object extension = info.Serializer.Deserialize (reader);\r
-                                       extensions.Add ((ServiceDescriptionFormatExtension)extension);\r
+               ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NMTOKEN")]   
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlIgnore]     
+               public string RetrievalUrl {
+                       get { return retrievalUrl; }
+                       set { retrievalUrl = value; }
+               }
+       
+               [XmlIgnore]     
+               public static XmlSerializer Serializer {
+                       get { return serializer; }
+               }
+
+               [XmlIgnore]
+               public ServiceDescriptionCollection ServiceDescriptions {
+                       get { 
+                               return serviceDescriptions; 
+                       }
+               }
+
+               [XmlElement ("service")]
+               public ServiceCollection Services {
+                       get { return services; }
+               }
+
+               [XmlAttribute ("targetNamespace")]
+               public string TargetNamespace {
+                       get { return targetNamespace; }
+                       set { targetNamespace = value; }
+               }
+
+#if NET_2_0
+               [XmlIgnore]
+               public StringCollection ValidationWarnings {
+                       get { return validationWarnings; }
+               }
+#endif
+
+               #endregion // Properties
+
+               #region Methods
+
+               public static bool CanRead (XmlReader reader)
+               {
+                       reader.MoveToContent ();
+                       return reader.LocalName == "definitions" && 
+                               reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/";
+               }
+
+#if NET_2_0
+               public static ServiceDescription Read (string fileName, bool validate)
+               {
+                       if (validate)
+                               using (XmlReader reader = XmlReader.Create (fileName)) {
+                                       return Read (reader, true);
+                               }
+                       else
+                               return Read (fileName);
+               }
+
+               public static ServiceDescription Read (Stream stream, bool validate)
+               {
+                       if (validate)
+                               return Read (XmlReader.Create (stream), true);
+                       else
+                               return Read (stream);
+               }
+
+               public static ServiceDescription Read (TextReader reader, bool validate)
+               {
+                       if (validate)
+                               return Read (XmlReader.Create (reader), true);
+                       else
+                               return Read (reader);
+               }
+
+               public static ServiceDescription Read (XmlReader reader, bool validate)
+               {
+                       if (validate) {
+                               StringCollection sc = new StringCollection ();
+                               XmlReaderSettings s = new XmlReaderSettings ();
+                               s.ValidationType = ValidationType.Schema;
+                               s.Schemas.Add (Schema);
+                               s.ValidationEventHandler += delegate (object o, ValidationEventArgs e) {
+                                       sc.Add (e.Message);
+                               };
+
+                               ServiceDescription ret = Read (XmlReader.Create (reader, s));
+                               ret.validationWarnings = sc;
+                               return ret;
+                       }
+                       else
+                               return Read (reader);
+               }
+#endif
+
+               public static ServiceDescription Read (Stream stream)
+               {
+                       return (ServiceDescription) serializer.Deserialize (stream);
+               }
+
+               public static ServiceDescription Read (string fileName)
+               {
+                       return Read (new FileStream (fileName, FileMode.Open));
+               }
+
+               public static ServiceDescription Read (TextReader textReader)
+               {
+                       return (ServiceDescription) serializer.Deserialize (textReader);
+               }
+
+               public static ServiceDescription Read (XmlReader reader)
+               {
+                       return (ServiceDescription) serializer.Deserialize (reader);
+               }
+
+               public void Write (Stream stream)
+               {
+                       serializer.Serialize (stream, this, GetNamespaceList ());
+               }
+
+               public void Write (string fileName)
+               {
+                       Write (new FileStream (fileName, FileMode.Create));
+               }
+
+               public void Write (TextWriter writer)
+               {
+                       serializer.Serialize (writer, this, GetNamespaceList ());
+               }
+
+               public void Write (XmlWriter writer)
+               {
+                       serializer.Serialize (writer, this, GetNamespaceList ());
+               }
+
+               internal void SetParent (ServiceDescriptionCollection serviceDescriptions)
+               {
+                       this.serviceDescriptions = serviceDescriptions; 
+               }
+               
+               XmlSerializerNamespaces GetNamespaceList ()
+               {
+                       XmlSerializerNamespaces ns;
+                       ns = new XmlSerializerNamespaces ();
+                       ns.Add ("soap", SoapBinding.Namespace);
+                       ns.Add ("soapenc", "http://schemas.xmlsoap.org/soap/encoding/");
+                       ns.Add ("s", XmlSchema.Namespace);
+                       ns.Add ("http", HttpBinding.Namespace);
+                       ns.Add ("mime", MimeContentBinding.Namespace);
+                       ns.Add ("tm", MimeTextBinding.Namespace);
+                       ns.Add ("s0", TargetNamespace);
+                       
+                       AddExtensionNamespaces (ns, Extensions);
+                       
+                       if (Types != null) AddExtensionNamespaces (ns, Types.Extensions);
+                       
+                       foreach (Service ser in Services)
+                               foreach (Port port in ser.Ports)
+                                       AddExtensionNamespaces (ns, port.Extensions);
+
+                       foreach (Binding bin in Bindings)
+                       {
+                               AddExtensionNamespaces (ns, bin.Extensions);
+                               foreach (OperationBinding op in bin.Operations)
+                               {
+                                       AddExtensionNamespaces (ns, op.Extensions);
+                                       if (op.Input != null) AddExtensionNamespaces (ns, op.Input.Extensions);
+                                       if (op.Output != null) AddExtensionNamespaces (ns, op.Output.Extensions);
+                               }
+                       }
+                       return ns;
+               }
+               
+               void AddExtensionNamespaces (XmlSerializerNamespaces ns, ServiceDescriptionFormatExtensionCollection extensions)
+               {
+                       foreach (ServiceDescriptionFormatExtension ext in extensions)
+                       {
+                               ExtensionInfo einf = ExtensionManager.GetFormatExtensionInfo (ext.GetType ());
+                               foreach (XmlQualifiedName qname in einf.NamespaceDeclarations)
+                                       ns.Add (qname.Name, qname.Namespace);
+                       }
+               }
+               
+               internal static void WriteExtensions (XmlWriter writer, object ob)
+               {
+                       ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint (ob);
+                       if (extensions != null)
+                       {
+                               foreach (ServiceDescriptionFormatExtension ext in extensions)
+                                       WriteExtension (writer, ext);
+                       }
+               }
+               
+               static void WriteExtension (XmlWriter writer, ServiceDescriptionFormatExtension ext)
+               {
+                       Type type = ext.GetType ();
+                       ExtensionInfo info = ExtensionManager.GetFormatExtensionInfo (type);
+                       
+//                             if (prefix != null && prefix != "")
+//                                     Writer.WriteStartElement (prefix, info.ElementName, info.Namespace);
+//                             else
+//                                     WriteStartElement (info.ElementName, info.Namespace, false);
+
+                       XmlSerializerNamespaces ns = new XmlSerializerNamespaces ();
+                       ns.Add ("","");
+                       info.Serializer.Serialize (writer, ext, ns);
+               }
+               
+               internal static void ReadExtension (XmlDocument doc, XmlReader reader, object ob)
+               {
+                       ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint (ob);
+                       if (extensions != null)
+                       {
+                               ExtensionInfo info = ExtensionManager.GetFormatExtensionInfo (reader.LocalName, reader.NamespaceURI);
+                               if (info != null)
+                               {
+                                       object extension = info.Serializer.Deserialize (reader);
+                                       extensions.Add ((ServiceDescriptionFormatExtension)extension);
                                        return;
-                               }\r
-                       }\r
+                               }
+                       }
 
                        //No XmlFormatExtensionPoint attribute found
 
@@ -397,33 +397,33 @@ namespace System.Web.Services.Description
 #else
                        reader.Skip ();
 #endif
-               }\r
-\r
-               #endregion\r
-\r
-               internal class ServiceDescriptionSerializer : XmlSerializer \r
-               {\r
-                       protected override void Serialize (object o, XmlSerializationWriter writer)\r
-                       {\r
-                               ServiceDescriptionWriterBase xsWriter = writer as ServiceDescriptionWriterBase;\r
-                               xsWriter.WriteRoot_ServiceDescription (o);\r
-                       }\r
-                       \r
-                       protected override object Deserialize (XmlSerializationReader reader)\r
-                       {\r
-                               ServiceDescriptionReaderBase xsReader = reader as ServiceDescriptionReaderBase;\r
+               }
+
+               #endregion
+
+               internal class ServiceDescriptionSerializer : XmlSerializer 
+               {
+                       protected override void Serialize (object o, XmlSerializationWriter writer)
+                       {
+                               ServiceDescriptionWriterBase xsWriter = writer as ServiceDescriptionWriterBase;
+                               xsWriter.WriteRoot_ServiceDescription (o);
+                       }
+                       
+                       protected override object Deserialize (XmlSerializationReader reader)
+                       {
+                               ServiceDescriptionReaderBase xsReader = reader as ServiceDescriptionReaderBase;
                                return xsReader.ReadRoot_ServiceDescription ();
-                       }\r
-                       \r
-                       protected override XmlSerializationWriter CreateWriter ()\r
-                       {\r
-                               return new ServiceDescriptionWriterBase ();\r
-                       }\r
-                       \r
-                       protected override XmlSerializationReader CreateReader ()\r
-                       {\r
-                               return new ServiceDescriptionReaderBase ();\r
-                       }\r
-               }               \r
-       }\r
+                       }
+                       
+                       protected override XmlSerializationWriter CreateWriter ()
+                       {
+                               return new ServiceDescriptionWriterBase ();
+                       }
+                       
+                       protected override XmlSerializationReader CreateReader ()
+                       {
+                               return new ServiceDescriptionReaderBase ();
+                       }
+               }               
+       }
 }
index ebc2e7b416a1438477f4b5da48060432c4dbe27f..6406d36eeb39b65897dc41664256457de8808a6b 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionBaseCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescriptionBaseCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Description {\r
-       public abstract class ServiceDescriptionBaseCollection : CollectionBase {\r
-               \r
-               #region Fields\r
-\r
-               Hashtable table = new Hashtable ();\r
-               object parent;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               internal ServiceDescriptionBaseCollection (object parent)\r
-               {\r
-                       this.parent = parent;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               protected virtual IDictionary Table {\r
-                       get { return table; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               protected virtual string GetKey (object value) \r
-               {\r
-                       return null; \r
-               }\r
-\r
-               protected override void OnClear ()\r
-               {\r
-                       Table.Clear ();\r
-               }\r
-\r
-               protected override void OnInsertComplete (int index, object value)\r
-               {\r
-                       if (GetKey (value) != null)\r
-                               Table [GetKey (value)] = value;\r
-                       SetParent (value, parent);\r
-               }\r
-\r
-               protected override void OnRemove (int index, object value)\r
-               {\r
-                       if (GetKey (value) != null)\r
-                               Table.Remove (GetKey (value));\r
-               }\r
-\r
-               protected override void OnSet (int index, object oldValue, object newValue)\r
-               {\r
-                       if (GetKey (oldValue) != null) \r
-                               Table.Remove (GetKey (oldValue));\r
-                       if (GetKey (newValue) != null)\r
-                               Table [GetKey (newValue)] = newValue;\r
-                       SetParent (newValue, parent);\r
-               }\r
-\r
-               protected virtual void SetParent (object value, object parent)\r
-               {\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+using System.Web.Services;
+
+namespace System.Web.Services.Description {
+       public abstract class ServiceDescriptionBaseCollection : CollectionBase {
+               
+               #region Fields
+
+               Hashtable table = new Hashtable ();
+               object parent;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               internal ServiceDescriptionBaseCollection (object parent)
+               {
+                       this.parent = parent;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               protected virtual IDictionary Table {
+                       get { return table; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               protected virtual string GetKey (object value) 
+               {
+                       return null; 
+               }
+
+               protected override void OnClear ()
+               {
+                       Table.Clear ();
+               }
+
+               protected override void OnInsertComplete (int index, object value)
+               {
+                       if (GetKey (value) != null)
+                               Table [GetKey (value)] = value;
+                       SetParent (value, parent);
+               }
+
+               protected override void OnRemove (int index, object value)
+               {
+                       if (GetKey (value) != null)
+                               Table.Remove (GetKey (value));
+               }
+
+               protected override void OnSet (int index, object oldValue, object newValue)
+               {
+                       if (GetKey (oldValue) != null) 
+                               Table.Remove (GetKey (oldValue));
+                       if (GetKey (newValue) != null)
+                               Table [GetKey (newValue)] = newValue;
+                       SetParent (newValue, parent);
+               }
+
+               protected virtual void SetParent (object value, object parent)
+               {
+               }
+                       
+               #endregion // Methods
+       }
+}
index ee00590bf861a6592ae0db27a964fa4cc84a549f..a80271e22afd69c51483decc59f231c9da684586 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescriptionCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {\r
+
+using System.Web.Services;
+using System.Xml;
+
+namespace System.Web.Services.Description {
+       public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {
 
 #if !TARGET_JVM //code generation is not supported
                ServiceDescriptionImporter importer;
 #endif
-               \r
-               #region Constructors\r
-       \r
-               public ServiceDescriptionCollection () \r
-                       : base (null)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public ServiceDescription this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return (ServiceDescription) List[index]; \r
-                       }\r
-                       set { List [index] = value; }\r
-               }\r
-\r
-               public ServiceDescription this [string ns] {\r
-                       get { \r
-                               return (ServiceDescription) Table[ns];\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
+               
+               #region Constructors
+       
+               public ServiceDescriptionCollection () 
+                       : base (null)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public ServiceDescription this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return (ServiceDescription) List[index]; 
+                       }
+                       set { List [index] = value; }
+               }
+
+               public ServiceDescription this [string ns] {
+                       get { 
+                               return (ServiceDescription) Table[ns];
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
 #if !TARGET_JVM //code generation is not supported
                internal void SetImporter (ServiceDescriptionImporter i)
                {
                        importer = i;
-               }\r
-#endif\r
-               public int Add (ServiceDescription serviceDescription) \r
-               {\r
-                       return Add (serviceDescription, null, null);\r
-               }\r
-\r
-               internal int Add (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)\r
+               }
+#endif
+               public int Add (ServiceDescription serviceDescription) 
+               {
+                       return Add (serviceDescription, null, null);
+               }
+
+               internal int Add (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)
                {
 #if !TARGET_JVM
-                       if (importer != null)\r
+                       if (importer != null)
                                importer.OnServiceDescriptionAdded (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
 #endif
                        Insert (Count, serviceDescription);
-                       return (Count - 1);\r
-               }
-               \r
-               public bool Contains (ServiceDescription serviceDescription)\r
-               {\r
-                       return List.Contains (serviceDescription);\r
-               }\r
-\r
-               public void CopyTo (ServiceDescription[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public Binding GetBinding (XmlQualifiedName name)\r
-               {\r
-                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];\r
-                       if (desc != null) {\r
-                               foreach (Binding binding in desc.Bindings) \r
-                                       if (binding.Name == name.Name)\r
-                                               return binding;\r
-                       }\r
-                       throw new InvalidOperationException ("Binding '" + name + "' not found");\r
-               }\r
-\r
-               protected override string GetKey (object value) \r
-               {\r
-                       return ((ServiceDescription) value).TargetNamespace;\r
-               }\r
-\r
-               public Message GetMessage (XmlQualifiedName name)\r
-               {\r
-                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];\r
-                       if (desc != null) {\r
-                               foreach (Message message in desc.Messages) \r
-                                       if (message.Name == name.Name)\r
-                                               return message;\r
-                       }\r
-                       throw new InvalidOperationException ("Message '" + name + "' not found");\r
-               }\r
-\r
-               public PortType GetPortType (XmlQualifiedName name)\r
-               {\r
-                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];\r
-                       if (desc != null) {\r
-                               foreach (PortType portType in desc.PortTypes) \r
-                                       if (portType.Name == name.Name)\r
-                                               return portType;\r
-                       }\r
-                       throw new InvalidOperationException ("Port type '" + name + "' not found");\r
-               }\r
-\r
-               public Service GetService (XmlQualifiedName name)\r
-               {\r
-                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];\r
-                       if (desc != null) {\r
-                               foreach (Service service in desc.Services) \r
-                                       if (service.Name == name.Name)\r
-                                               return service;\r
-                       }\r
-                       throw new InvalidOperationException ("Service '" + name + "' not found");\r
-               }\r
-\r
-               public int IndexOf (ServiceDescription serviceDescription)\r
-               {\r
-                       return List.IndexOf (serviceDescription);\r
-               }\r
-\r
-               public void Insert (int index, ServiceDescription serviceDescription)\r
-               {\r
-                       List.Insert (index, serviceDescription);\r
-               }\r
-       \r
-               public void Remove (ServiceDescription serviceDescription)\r
-               {\r
-                       List.Remove (serviceDescription);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+                       return (Count - 1);
+               }
+               
+               public bool Contains (ServiceDescription serviceDescription)
+               {
+                       return List.Contains (serviceDescription);
+               }
+
+               public void CopyTo (ServiceDescription[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public Binding GetBinding (XmlQualifiedName name)
+               {
+                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];
+                       if (desc != null) {
+                               foreach (Binding binding in desc.Bindings) 
+                                       if (binding.Name == name.Name)
+                                               return binding;
+                       }
+                       throw new InvalidOperationException ("Binding '" + name + "' not found");
+               }
+
+               protected override string GetKey (object value) 
+               {
+                       return ((ServiceDescription) value).TargetNamespace;
+               }
+
+               public Message GetMessage (XmlQualifiedName name)
+               {
+                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];
+                       if (desc != null) {
+                               foreach (Message message in desc.Messages) 
+                                       if (message.Name == name.Name)
+                                               return message;
+                       }
+                       throw new InvalidOperationException ("Message '" + name + "' not found");
+               }
+
+               public PortType GetPortType (XmlQualifiedName name)
+               {
+                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];
+                       if (desc != null) {
+                               foreach (PortType portType in desc.PortTypes) 
+                                       if (portType.Name == name.Name)
+                                               return portType;
+                       }
+                       throw new InvalidOperationException ("Port type '" + name + "' not found");
+               }
+
+               public Service GetService (XmlQualifiedName name)
+               {
+                       ServiceDescription desc = (ServiceDescription) Table[name.Namespace];
+                       if (desc != null) {
+                               foreach (Service service in desc.Services) 
+                                       if (service.Name == name.Name)
+                                               return service;
+                       }
+                       throw new InvalidOperationException ("Service '" + name + "' not found");
+               }
+
+               public int IndexOf (ServiceDescription serviceDescription)
+               {
+                       return List.IndexOf (serviceDescription);
+               }
+
+               public void Insert (int index, ServiceDescription serviceDescription)
+               {
+                       List.Insert (index, serviceDescription);
+               }
+       
+               public void Remove (ServiceDescription serviceDescription)
+               {
+                       List.Remove (serviceDescription);
+               }
+
+               #endregion // Methods
+       }
 }
index f1175e24617a8ad5a81ef14caa81d4baaf5c34c2..6a29c00e0233de6bb2bbf0fe4e89edfb40859d82 100644 (file)
@@ -1,86 +1,86 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionFormatExtension.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.ComponentModel;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       public abstract class ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-               \r
-               bool handled;\r
-               object parent;\r
-               bool required;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               protected ServiceDescriptionFormatExtension () \r
-               {\r
-                       handled = false;\r
-                       parent = null;\r
-                       required = false;       \r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public bool Handled {\r
-                       get { return handled; }\r
-                       set { handled = value; }\r
-               }\r
-\r
-               public object Parent {\r
-                       get { return parent; }\r
-               }\r
-\r
-               [DefaultValue (false)]\r
-               [XmlAttribute ("required", Namespace = "http://schemas.xmlsoap.org/wsdl/")]\r
-               public bool Required {  \r
-                       get { return required; }\r
-                       set { required = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal void SetParent (object value)\r
-               {\r
-                       parent = value; \r
-               }\r
-               \r
-               #endregion // Methods\r
-       }\r
-}\r
+// 
+// System.Web.Services.Description.ServiceDescriptionFormatExtension.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       public abstract class ServiceDescriptionFormatExtension {
+
+               #region Fields
+               
+               bool handled;
+               object parent;
+               bool required;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               protected ServiceDescriptionFormatExtension () 
+               {
+                       handled = false;
+                       parent = null;
+                       required = false;       
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public bool Handled {
+                       get { return handled; }
+                       set { handled = value; }
+               }
+
+               public object Parent {
+                       get { return parent; }
+               }
+
+               [DefaultValue (false)]
+               [XmlAttribute ("required", Namespace = "http://schemas.xmlsoap.org/wsdl/")]
+               public bool Required {  
+                       get { return required; }
+                       set { required = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal void SetParent (object value)
+               {
+                       parent = value; 
+               }
+               
+               #endregion // Methods
+       }
+}
index 575b59f78a67eb669206be4d9f8778ac5ddaee53..d162d0bbb0712a36f37209a0ec674eecf15272d5 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-using System.Web.Services;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class ServiceDescriptionFormatExtensionCollection : ServiceDescriptionBaseCollection {\r
-               \r
-               #region Constructors\r
-       \r
-               public ServiceDescriptionFormatExtensionCollection (object parent) \r
-                       : base (parent)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public object this [int index] {\r
-                       get { \r
-                               if (index < 0 || index > Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-\r
-                               return List[index]; \r
-                       }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (object extension) \r
-               {\r
-                       Insert (Count, extension);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (object extension)\r
-               {\r
-                       return List.Contains (extension);\r
-               }\r
-\r
-               public void CopyTo (object[] array, int index) \r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public object Find (Type type)\r
-               {\r
-                       foreach (object value in List)\r
-                               if (type.IsInstanceOfType (value))\r
-                                       return value;\r
-                       return null;\r
-               }\r
-\r
-               public XmlElement Find (string name, string ns)\r
-               {\r
-                       XmlElement xmlElement;\r
-                       foreach (object value in List) \r
-                               if (value is XmlElement) {\r
-                                       xmlElement = (value as XmlElement);\r
-                                       if (xmlElement.Name == name && xmlElement.NamespaceURI == ns)\r
-                                               return xmlElement;\r
-                               }\r
-                       return null;\r
-               }\r
-\r
-               public object[] FindAll (Type type)\r
-               {\r
-                       ArrayList searchResults = new ArrayList ();\r
-                       foreach (object value in List)\r
-                               if (value.GetType () == type)\r
-                                       searchResults.Add (value);\r
-                       object[] returnValue = new object [searchResults.Count];\r
-\r
-                       if (searchResults.Count > 0)\r
-                               searchResults.CopyTo (returnValue);\r
-\r
-                       return returnValue;\r
-               }\r
-\r
-               public XmlElement[] FindAll (string name, string ns)\r
-               {\r
-                       ArrayList searchResults = new ArrayList ();\r
-                       XmlElement xmlElement;\r
-\r
-                       foreach (object value in List)\r
-                               if (value is XmlElement) {\r
-                                       xmlElement = (value as XmlElement);\r
-                                       if (xmlElement.Name == name && xmlElement.NamespaceURI == ns)\r
-                                               searchResults.Add (xmlElement);\r
-                               }\r
-\r
-                       XmlElement[] returnValue = new XmlElement [searchResults.Count];\r
-\r
-                       if (searchResults.Count > 0)\r
-                               searchResults.CopyTo (returnValue);\r
-\r
-                       return returnValue;\r
-               }\r
-\r
-               public int IndexOf (object extension)\r
-               {\r
-                       return List.IndexOf (extension);\r
-               }\r
-\r
-               public void Insert (int index, object extension)\r
-               {\r
-                       List.Insert (index, extension);\r
-               }\r
-\r
-               [MonoTODO]\r
-               public bool IsHandled (object item)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public bool IsRequired (object item)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-       \r
-               protected override void OnValidate (object value)\r
-               {\r
-                       if (value == null)\r
-                               throw new ArgumentNullException ();\r
-                       if (!(value is XmlElement || value is ServiceDescriptionFormatExtension))\r
-                               throw new ArgumentException ();\r
-               }\r
-       \r
-               public void Remove (object extension)\r
-               {\r
-                       List.Remove (extension);\r
-               }\r
-                       \r
-               protected override void SetParent (object value, object parent)\r
-               {\r
+
+using System.Collections;
+using System.Web.Services;
+using System.Xml;
+
+namespace System.Web.Services.Description {
+       public sealed class ServiceDescriptionFormatExtensionCollection : ServiceDescriptionBaseCollection {
+               
+               #region Constructors
+       
+               public ServiceDescriptionFormatExtensionCollection (object parent) 
+                       : base (parent)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public object this [int index] {
+                       get { 
+                               if (index < 0 || index > Count)
+                                       throw new ArgumentOutOfRangeException ();
+
+                               return List[index]; 
+                       }
+                       set { List[index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (object extension) 
+               {
+                       Insert (Count, extension);
+                       return (Count - 1);
+               }
+
+               public bool Contains (object extension)
+               {
+                       return List.Contains (extension);
+               }
+
+               public void CopyTo (object[] array, int index) 
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public object Find (Type type)
+               {
+                       foreach (object value in List)
+                               if (type.IsInstanceOfType (value))
+                                       return value;
+                       return null;
+               }
+
+               public XmlElement Find (string name, string ns)
+               {
+                       XmlElement xmlElement;
+                       foreach (object value in List) 
+                               if (value is XmlElement) {
+                                       xmlElement = (value as XmlElement);
+                                       if (xmlElement.Name == name && xmlElement.NamespaceURI == ns)
+                                               return xmlElement;
+                               }
+                       return null;
+               }
+
+               public object[] FindAll (Type type)
+               {
+                       ArrayList searchResults = new ArrayList ();
+                       foreach (object value in List)
+                               if (value.GetType () == type)
+                                       searchResults.Add (value);
+                       object[] returnValue = new object [searchResults.Count];
+
+                       if (searchResults.Count > 0)
+                               searchResults.CopyTo (returnValue);
+
+                       return returnValue;
+               }
+
+               public XmlElement[] FindAll (string name, string ns)
+               {
+                       ArrayList searchResults = new ArrayList ();
+                       XmlElement xmlElement;
+
+                       foreach (object value in List)
+                               if (value is XmlElement) {
+                                       xmlElement = (value as XmlElement);
+                                       if (xmlElement.Name == name && xmlElement.NamespaceURI == ns)
+                                               searchResults.Add (xmlElement);
+                               }
+
+                       XmlElement[] returnValue = new XmlElement [searchResults.Count];
+
+                       if (searchResults.Count > 0)
+                               searchResults.CopyTo (returnValue);
+
+                       return returnValue;
+               }
+
+               public int IndexOf (object extension)
+               {
+                       return List.IndexOf (extension);
+               }
+
+               public void Insert (int index, object extension)
+               {
+                       List.Insert (index, extension);
+               }
+
+               [MonoTODO]
+               public bool IsHandled (object item)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public bool IsRequired (object item)
+               {
+                       throw new NotImplementedException ();
+               }
+       
+               protected override void OnValidate (object value)
+               {
+                       if (value == null)
+                               throw new ArgumentNullException ();
+                       if (!(value is XmlElement || value is ServiceDescriptionFormatExtension))
+                               throw new ArgumentException ();
+               }
+       
+               public void Remove (object extension)
+               {
+                       List.Remove (extension);
+               }
+                       
+               protected override void SetParent (object value, object parent)
+               {
                        ServiceDescriptionFormatExtension extension = value as ServiceDescriptionFormatExtension;
                        if (extension == null)
                                return;
-                       extension.SetParent (parent);\r
-               }\r
-                       \r
-               #endregion // Methods\r
-       }\r
-}\r
+                       extension.SetParent (parent);
+               }
+                       
+               #endregion // Methods
+       }
+}
index 2e32fb86c0eb85e083e6a42eb3dad704f78d2292..cef9569c7f56e6f33c586df6946798bc2c47eccf 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionImportStyle.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescriptionImportStyle.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 using System.Xml.Serialization;
-\r
-namespace System.Web.Services.Description {\r
-       public enum ServiceDescriptionImportStyle {\r
+
+namespace System.Web.Services.Description {
+       public enum ServiceDescriptionImportStyle {
 #if NET_2_0
                [XmlEnum ("client")]
-               Client,\r
+               Client,
                [XmlEnum ("server")]
                Server,
                [XmlEnum ("serverInterface")]
-               ServerInterface,\r
+               ServerInterface,
 #else
                Client,
                Server
 #endif
-       }\r
-}\r
+       }
+}
index ad5364baa7a7600b3644653455d3ed2f5237b829..5e019906f3d9665f4d1eb63571c0011d8fb577bc 100644 (file)
@@ -1,48 +1,48 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionImportWarnings.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-#if NET_2_0\r
-       [Flags]\r
-#endif\r
-       public enum ServiceDescriptionImportWarnings {\r
-               NoCodeGenerated = 0x1,\r
-               NoMethodsGenerated = 0x20,\r
-               OptionalExtensionsIgnored = 0x2,\r
-               RequiredExtensionsIgnored = 0x4,\r
-               UnsupportedBindingsIgnored = 0x10,\r
-               UnsupportedOperationsIgnored = 0x8,\r
-#if NET_2_0\r
-               SchemaValidation = 0x40,\r
-               WsiConformance = 0x80\r
-#endif\r
-       }\r
-}\r
+// 
+// System.Web.Services.Description.ServiceDescriptionImportWarnings.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Web.Services.Description 
+{
+#if NET_2_0
+       [Flags]
+#endif
+       public enum ServiceDescriptionImportWarnings {
+               NoCodeGenerated = 0x1,
+               NoMethodsGenerated = 0x20,
+               OptionalExtensionsIgnored = 0x2,
+               RequiredExtensionsIgnored = 0x4,
+               UnsupportedBindingsIgnored = 0x10,
+               UnsupportedOperationsIgnored = 0x8,
+#if NET_2_0
+               SchemaValidation = 0x40,
+               WsiConformance = 0x80
+#endif
+       }
+}
index 885121d6f5402b8f476402e0b42e8a4b8f1a7a23..1cbb69e5a35dc6a2dd35bfc9927434d36aa8fded 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionImporter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescriptionImporter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System;\r
-using System.CodeDom;\r
-using System.CodeDom.Compiler;\r
-using System.Web.Services;\r
-using System.Web.Services.Protocols;\r
-using System.Web.Services.Description;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Configuration;\r
-\r
-namespace System.Web.Services.Description {\r
-       public class ServiceDescriptionImporter {\r
-\r
-               #region Fields\r
-\r
-               string protocolName;\r
-               XmlSchemas schemas;\r
-               ServiceDescriptionCollection serviceDescriptions;\r
-               ServiceDescriptionImportStyle style;\r
-               \r
-#if NET_2_0\r
-               CodeGenerationOptions options;\r
-               CodeDomProvider codeGenerator;\r
-               ImportContext context;\r
-#endif\r
-\r
-               ArrayList importInfo = new ArrayList ();\r
-               \r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               public ServiceDescriptionImporter ()\r
-               {\r
-                       protocolName = String.Empty;\r
-                       schemas = new XmlSchemas ();\r
+
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using System.Web.Services;
+using System.Web.Services.Protocols;
+using System.Web.Services.Description;
+using System.Xml.Serialization;
+using System.Xml;
+using System.Xml.Schema;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Configuration;
+
+namespace System.Web.Services.Description {
+       public class ServiceDescriptionImporter {
+
+               #region Fields
+
+               string protocolName;
+               XmlSchemas schemas;
+               ServiceDescriptionCollection serviceDescriptions;
+               ServiceDescriptionImportStyle style;
+               
+#if NET_2_0
+               CodeGenerationOptions options;
+               CodeDomProvider codeGenerator;
+               ImportContext context;
+#endif
+
+               ArrayList importInfo = new ArrayList ();
+               
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               public ServiceDescriptionImporter ()
+               {
+                       protocolName = String.Empty;
+                       schemas = new XmlSchemas ();
                        serviceDescriptions = new ServiceDescriptionCollection ();
-                       serviceDescriptions.SetImporter (this);\r
-                       style = ServiceDescriptionImportStyle.Client;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string ProtocolName {\r
-                       get { return protocolName; }\r
-                       set { protocolName = value; }\r
-               }\r
-\r
-               public XmlSchemas Schemas {\r
-                       get { return schemas; }\r
-               }\r
-\r
-               public ServiceDescriptionCollection ServiceDescriptions {\r
-                       get { return serviceDescriptions; }\r
-               }\r
-\r
-               public ServiceDescriptionImportStyle Style {\r
-                       get { return style; }\r
-                       set { style = value; }\r
-               }\r
-               \r
-#if NET_2_0\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public CodeGenerationOptions CodeGenerationOptions {\r
-                       get { return options; }\r
-                       set { options = value; }\r
-               }\r
-               \r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public CodeDomProvider CodeGenerator {\r
-                       get { return codeGenerator; }\r
-                       set { codeGenerator = value; }\r
-               }\r
-               \r
-               \r
-               internal ImportContext Context {\r
-                       get { return context; }\r
-                       set { context = value; }\r
-               }\r
-#endif\r
-       \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void AddServiceDescription (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)\r
-               {\r
-                       if (appSettingUrlKey != null && appSettingUrlKey == string.Empty && style == ServiceDescriptionImportStyle.Server)\r
-                               throw new InvalidOperationException ("Cannot set appSettingUrlKey if Style is Server");\r
+                       serviceDescriptions.SetImporter (this);
+                       style = ServiceDescriptionImportStyle.Client;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public string ProtocolName {
+                       get { return protocolName; }
+                       set { protocolName = value; }
+               }
+
+               public XmlSchemas Schemas {
+                       get { return schemas; }
+               }
+
+               public ServiceDescriptionCollection ServiceDescriptions {
+                       get { return serviceDescriptions; }
+               }
+
+               public ServiceDescriptionImportStyle Style {
+                       get { return style; }
+                       set { style = value; }
+               }
+               
+#if NET_2_0
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public CodeGenerationOptions CodeGenerationOptions {
+                       get { return options; }
+                       set { options = value; }
+               }
+               
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public CodeDomProvider CodeGenerator {
+                       get { return codeGenerator; }
+                       set { codeGenerator = value; }
+               }
+               
+               
+               internal ImportContext Context {
+                       get { return context; }
+                       set { context = value; }
+               }
+#endif
+       
+               #endregion // Properties
+
+               #region Methods
+
+               public void AddServiceDescription (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)
+               {
+                       if (appSettingUrlKey != null && appSettingUrlKey == string.Empty && style == ServiceDescriptionImportStyle.Server)
+                               throw new InvalidOperationException ("Cannot set appSettingUrlKey if Style is Server");
+
+                       serviceDescriptions.Add (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
+               }
+
+               internal void OnServiceDescriptionAdded (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)
+               {
+                       ImportInfo info = new ImportInfo (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
+                       importInfo.Add (info);
+                       
+                       if (serviceDescription.Types != null)
+                               schemas.Add (serviceDescription.Types.Schemas);
+               }
+
+               public ServiceDescriptionImportWarnings Import (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)
+               {
+                       ProtocolImporter importer = GetImporter ();
+                       
+                       if (!importer.Import (this, codeNamespace, codeCompileUnit, importInfo))
+                               throw new Exception ("None of the supported bindings was found");
+                               
+                       return importer.Warnings;
+               }
+               
+               ProtocolImporter GetImporter ()
+               {
+                       ArrayList importers = GetSupportedImporters ();
+                       if (protocolName == null || protocolName == "") protocolName = "Soap";
+                       foreach (ProtocolImporter importer in importers) {
+                               if (importer.ProtocolName == protocolName)
+                                       return importer;
+                       }
+                       
+                       throw new Exception ("Protocol " + protocolName + " not supported");
+               }
+               
+               ArrayList GetSupportedImporters ()
+               {
+                       ArrayList list = new ArrayList ();
+                       list.Add (new SoapProtocolImporter ());
+                       list.Add (new HttpGetProtocolImporter ());
+                       list.Add (new HttpPostProtocolImporter ());
+                       return list;
+               }
+               
+#if NET_2_0
+
+               [MonoTODO] // where to use Verbose and Extensions in options?
+               public static StringCollection GenerateWebReferences (
+                       WebReferenceCollection webReferences, 
+                       CodeDomProvider codeGenerator, 
+                       CodeCompileUnit codeCompileUnit, 
+                       WebReferenceOptions options)
+               {
+                       StringCollection allWarnings = new StringCollection ();
+                       ImportContext context = new ImportContext (new CodeIdentifiers(), true);
+                       
+                       foreach (WebReference reference in webReferences) 
+                       {
+                               ServiceDescriptionImporter importer = new ServiceDescriptionImporter ();
+                               importer.CodeGenerator = codeGenerator;
+                               importer.CodeGenerationOptions = options.CodeGenerationOptions;
+                               importer.Context = context;
+                               importer.Style = options.Style;
+                               importer.ProtocolName = reference.ProtocolName;
+                               
+                               importer.AddReference (reference);
+                               
+                               reference.Warnings = importer.Import (reference.ProxyCode, codeCompileUnit);
+                               reference.SetValidationWarnings (context.Warnings);
+                               foreach (string s in context.Warnings)
+                                       allWarnings.Add (s);
+
+                               context.Warnings.Clear ();
+                       }
+
+                       return allWarnings;
+               }
+               
+               internal void AddReference (WebReference reference)
+               {
+                       foreach (object doc in reference.Documents.Values)
+                       {
+                               if (doc is ServiceDescription) {
+                                       ServiceDescription service = (ServiceDescription) doc;
+                                       ImportInfo info = new ImportInfo (service, reference);
+                                       importInfo.Add (info);
+                                       serviceDescriptions.Add (service);
+                                       
+                                       if (service.Types != null)
+                                               schemas.Add (service.Types.Schemas);
+                               }
+                               else if (doc is XmlSchema) {
+                                       schemas.Add ((XmlSchema) doc);
+                               }
+                       }
+               }
+               
+#endif
+
+#endregion
+       }
+
+       internal class ImportInfo
+       {
+               string _appSettingUrlKey;
+               string _appSettingBaseUrl;
+               ServiceDescription _serviceDescription;
+               
+               public WebReference _reference;
+               
+               public ImportInfo (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)
+               {
+                       _serviceDescription = serviceDescription;
+                       _appSettingUrlKey = appSettingUrlKey;
+                       _appSettingBaseUrl = appSettingBaseUrl;
+               }
+               
+               public ImportInfo (ServiceDescription serviceDescription, WebReference reference)
+               {
+                       _reference = reference;
+                       _serviceDescription = serviceDescription;
+               }
+               
+               public WebReference Reference {
+                       get { return _reference; }
+               }
+               
+               public ServiceDescription ServiceDescription {
+                       get { return _serviceDescription; }
+               }
+               
+               public string AppSettingUrlKey {
+                       get {
+                               if (_reference != null) return _reference.AppSettingUrlKey;
+                               else return _appSettingUrlKey;
+                       }
+                       set {
+                               _appSettingUrlKey = value;
+                       }
+               }
+               
+               public string AppSettingBaseUrl {
+                       get {
+                               if (_reference != null) return _reference.AppSettingBaseUrl;
+                               else return _appSettingBaseUrl;
+                       }
+                       set {
+                               _appSettingBaseUrl = value;
+                       }
+               }
+       }
 
-                       serviceDescriptions.Add (serviceDescription, appSettingUrlKey, appSettingBaseUrl);\r
-               }\r
-\r
-               internal void OnServiceDescriptionAdded (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)\r
-               {\r
-                       ImportInfo info = new ImportInfo (serviceDescription, appSettingUrlKey, appSettingBaseUrl);\r
-                       importInfo.Add (info);\r
-                       \r
-                       if (serviceDescription.Types != null)\r
-                               schemas.Add (serviceDescription.Types.Schemas);\r
-               }\r
-\r
-               public ServiceDescriptionImportWarnings Import (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)\r
-               {\r
-                       ProtocolImporter importer = GetImporter ();\r
-                       \r
-                       if (!importer.Import (this, codeNamespace, codeCompileUnit, importInfo))\r
-                               throw new Exception ("None of the supported bindings was found");\r
-                               \r
-                       return importer.Warnings;\r
-               }\r
-               \r
-               ProtocolImporter GetImporter ()\r
-               {\r
-                       ArrayList importers = GetSupportedImporters ();\r
-                       if (protocolName == null || protocolName == "") protocolName = "Soap";\r
-                       foreach (ProtocolImporter importer in importers) {\r
-                               if (importer.ProtocolName == protocolName)\r
-                                       return importer;\r
-                       }\r
-                       \r
-                       throw new Exception ("Protocol " + protocolName + " not supported");\r
-               }\r
-               \r
-               ArrayList GetSupportedImporters ()\r
-               {\r
-                       ArrayList list = new ArrayList ();\r
-                       list.Add (new SoapProtocolImporter ());\r
-                       list.Add (new HttpGetProtocolImporter ());\r
-                       list.Add (new HttpPostProtocolImporter ());\r
-                       return list;\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               [MonoTODO] // where to use Verbose and Extensions in options?\r
-               public static StringCollection GenerateWebReferences (\r
-                       WebReferenceCollection webReferences, \r
-                       CodeDomProvider codeGenerator, \r
-                       CodeCompileUnit codeCompileUnit, \r
-                       WebReferenceOptions options)\r
-               {\r
-                       StringCollection allWarnings = new StringCollection ();\r
-                       ImportContext context = new ImportContext (new CodeIdentifiers(), true);\r
-                       \r
-                       foreach (WebReference reference in webReferences) \r
-                       {\r
-                               ServiceDescriptionImporter importer = new ServiceDescriptionImporter ();\r
-                               importer.CodeGenerator = codeGenerator;\r
-                               importer.CodeGenerationOptions = options.CodeGenerationOptions;\r
-                               importer.Context = context;\r
-                               importer.Style = options.Style;\r
-                               importer.ProtocolName = reference.ProtocolName;\r
-                               \r
-                               importer.AddReference (reference);\r
-                               \r
-                               reference.Warnings = importer.Import (reference.ProxyCode, codeCompileUnit);\r
-                               reference.SetValidationWarnings (context.Warnings);\r
-                               foreach (string s in context.Warnings)\r
-                                       allWarnings.Add (s);\r
-\r
-                               context.Warnings.Clear ();\r
-                       }\r
-\r
-                       return allWarnings;\r
-               }\r
-               \r
-               internal void AddReference (WebReference reference)\r
-               {\r
-                       foreach (object doc in reference.Documents.Values)\r
-                       {\r
-                               if (doc is ServiceDescription) {\r
-                                       ServiceDescription service = (ServiceDescription) doc;\r
-                                       ImportInfo info = new ImportInfo (service, reference);\r
-                                       importInfo.Add (info);\r
-                                       serviceDescriptions.Add (service);\r
-                                       \r
-                                       if (service.Types != null)\r
-                                               schemas.Add (service.Types.Schemas);\r
-                               }\r
-                               else if (doc is XmlSchema) {\r
-                                       schemas.Add ((XmlSchema) doc);\r
-                               }\r
-                       }\r
-               }\r
-               \r
-#endif\r
-\r
-#endregion\r
-       }\r
-\r
-       internal class ImportInfo\r
-       {\r
-               string _appSettingUrlKey;\r
-               string _appSettingBaseUrl;\r
-               ServiceDescription _serviceDescription;\r
-               \r
-               public WebReference _reference;\r
-               \r
-               public ImportInfo (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)\r
-               {\r
-                       _serviceDescription = serviceDescription;\r
-                       _appSettingUrlKey = appSettingUrlKey;\r
-                       _appSettingBaseUrl = appSettingBaseUrl;\r
-               }\r
-               \r
-               public ImportInfo (ServiceDescription serviceDescription, WebReference reference)\r
-               {\r
-                       _reference = reference;\r
-                       _serviceDescription = serviceDescription;\r
-               }\r
-               \r
-               public WebReference Reference {\r
-                       get { return _reference; }\r
-               }\r
-               \r
-               public ServiceDescription ServiceDescription {\r
-                       get { return _serviceDescription; }\r
-               }\r
-               \r
-               public string AppSettingUrlKey {\r
-                       get {\r
-                               if (_reference != null) return _reference.AppSettingUrlKey;\r
-                               else return _appSettingUrlKey;\r
-                       }\r
-                       set {\r
-                               _appSettingUrlKey = value;\r
-                       }\r
-               }\r
-               \r
-               public string AppSettingBaseUrl {\r
-                       get {\r
-                               if (_reference != null) return _reference.AppSettingBaseUrl;\r
-                               else return _appSettingBaseUrl;\r
-                       }\r
-                       set {\r
-                               _appSettingBaseUrl = value;\r
-                       }\r
-               }\r
-       }\r
-\r
 }
index b35e8b749ffdc035711e8cabfb8850e0fe035d39..6be9daa627d716d52b37b31f11439dc2dc86a50d 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Description.ServiceDescriptionReflector.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.ServiceDescriptionReflector.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Web.Services.Protocols;\r
-using System.Web.Services.Configuration;\r
+
+using System.Web.Services;
+using System.Xml.Serialization;
+using System.Xml;
+using System.Xml.Schema;
+using System.Web.Services.Protocols;
+using System.Web.Services.Configuration;
 #if NET_2_0
 using WSConfig = System.Web.Services.Configuration.WebServicesSection;
 using WSProtocol = System.Web.Services.Configuration.WebServiceProtocols;
 #endif
-\r
-namespace System.Web.Services.Description {\r
-       public class ServiceDescriptionReflector \r
-       {\r
-               ServiceDescriptionCollection serviceDescriptions;\r
-               Types types;\r
-\r
-               #region Constructors\r
-       \r
-               public ServiceDescriptionReflector ()\r
-               {\r
-                       types = new Types ();\r
-                       serviceDescriptions = new ServiceDescriptionCollection ();\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public XmlSchemas Schemas {\r
-                       get { return types.Schemas; }\r
-               }\r
-\r
-               public ServiceDescriptionCollection ServiceDescriptions {\r
-                       get { return serviceDescriptions; }\r
-               }\r
-\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void Reflect (Type type, string url)\r
-               {\r
-                       XmlSchemaExporter schemaExporter = new XmlSchemaExporter (Schemas);\r
-                       SoapSchemaExporter soapSchemaExporter = new SoapSchemaExporter (Schemas);\r
-                       \r
-                       new SoapProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);\r
-                       \r
-                       if (WSConfig.IsSupported (WSProtocol.HttpGet))\r
-                               new HttpGetProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);\r
-                       \r
-#if NET_1_1\r
-                       if (WSConfig.IsSupported (WSProtocol.HttpPost) || WSConfig.IsSupported (WSProtocol.HttpPostLocalhost))\r
-#else\r
-                       if (WSConfig.IsSupported (WSProtocol.HttpPost))\r
-#endif\r
-                               new HttpPostProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);\r
-                               \r
-                       int i=0;\r
-                       while (i < types.Schemas.Count) {\r
-                               if (types.Schemas[i].Items.Count == 0) types.Schemas.RemoveAt (i);\r
-                               else i++;\r
-                       }\r
-                       \r
-                       if (serviceDescriptions.Count == 1)\r
-                               serviceDescriptions[0].Types = types;\r
-                       else\r
-                       {\r
-                               foreach (ServiceDescription d in serviceDescriptions)\r
-                               {\r
-                                       d.Types = new Types();\r
-                                       for (int n=0; n<types.Schemas.Count; n++)\r
-                                               ProtocolReflector.AddImport (d, types.Schemas[n].TargetNamespace, GetSchemaUrl (url, n));\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               string GetSchemaUrl (string baseUrl, int id)\r
-               {\r
-                       return baseUrl + "?schema=" + id;\r
-               }\r
-               \r
-               \r
-               #endregion\r
-       }\r
+
+namespace System.Web.Services.Description {
+       public class ServiceDescriptionReflector 
+       {
+               ServiceDescriptionCollection serviceDescriptions;
+               Types types;
+
+               #region Constructors
+       
+               public ServiceDescriptionReflector ()
+               {
+                       types = new Types ();
+                       serviceDescriptions = new ServiceDescriptionCollection ();
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public XmlSchemas Schemas {
+                       get { return types.Schemas; }
+               }
+
+               public ServiceDescriptionCollection ServiceDescriptions {
+                       get { return serviceDescriptions; }
+               }
+
+
+               #endregion // Properties
+
+               #region Methods
+
+               public void Reflect (Type type, string url)
+               {
+                       XmlSchemaExporter schemaExporter = new XmlSchemaExporter (Schemas);
+                       SoapSchemaExporter soapSchemaExporter = new SoapSchemaExporter (Schemas);
+                       
+                       new SoapProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);
+                       
+                       if (WSConfig.IsSupported (WSProtocol.HttpGet))
+                               new HttpGetProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);
+                       
+#if NET_1_1
+                       if (WSConfig.IsSupported (WSProtocol.HttpPost) || WSConfig.IsSupported (WSProtocol.HttpPostLocalhost))
+#else
+                       if (WSConfig.IsSupported (WSProtocol.HttpPost))
+#endif
+                               new HttpPostProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);
+                               
+                       int i=0;
+                       while (i < types.Schemas.Count) {
+                               if (types.Schemas[i].Items.Count == 0) types.Schemas.RemoveAt (i);
+                               else i++;
+                       }
+                       
+                       if (serviceDescriptions.Count == 1)
+                               serviceDescriptions[0].Types = types;
+                       else
+                       {
+                               foreach (ServiceDescription d in serviceDescriptions)
+                               {
+                                       d.Types = new Types();
+                                       for (int n=0; n<types.Schemas.Count; n++)
+                                               ProtocolReflector.AddImport (d, types.Schemas[n].TargetNamespace, GetSchemaUrl (url, n));
+                               }
+                       }
+               }
+               
+               string GetSchemaUrl (string baseUrl, int id)
+               {
+                       return baseUrl + "?schema=" + id;
+               }
+               
+               
+               #endregion
+       }
 }
index 0964c9dac9c8f245a66e2148e8a69aa57dda1b9e..c452cb5af033697474acbfe698e209a4e6d639c0 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Soap12AddressBinding.cs\r
-//\r
-// Author:\r
-//   Lluis Sanchez (lluis@novell.com)\r
-//\r
-// Copyright (C) Novell, Inc., 2004\r
-//\r
+// 
+// System.Web.Services.Description.Soap12AddressBinding.cs
+//
+// Author:
+//   Lluis Sanchez (lluis@novell.com)
+//
+// Copyright (C) Novell, Inc., 2004
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 //
 
 #if NET_2_0
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-       [XmlFormatExtension ("address", "http://schemas.xmlsoap.org/wsdl/soap12/", typeof (Port))]\r
-       public sealed class Soap12AddressBinding : SoapAddressBinding \r
-       {\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description 
+{
+       [XmlFormatExtension ("address", "http://schemas.xmlsoap.org/wsdl/soap12/", typeof (Port))]
+       public sealed class Soap12AddressBinding : SoapAddressBinding 
+       {
+       }
+}
 
 #endif
index e27f8a1e7c6f8e6c80a49d0342efe874eaccd28d..6aaebe915db85b2506dceef18485771181501791 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Soap12Binding.cs\r
-//\r
-// Author:\r
-//   Lluis Sanchez (lluis@novell.com)\r
-//\r
-// Copyright (C) Novell, Inc., 2004\r
-//\r
+// 
+// System.Web.Services.Description.Soap12Binding.cs
+//
+// Author:
+//   Lluis Sanchez (lluis@novell.com)
+//
+// Copyright (C) Novell, Inc., 2004
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-#if NET_2_0\r
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description \r
-{\r
-       [XmlFormatExtensionPrefix ("soap12", "http://schemas.xmlsoap.org/wsdl/soap12/")]\r
-       [XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/soap12/", typeof (Binding))]\r
-       public sealed class Soap12Binding : SoapBinding \r
-       {\r
-               public new const string HttpTransport = "http://schemas.xmlsoap.org/soap/http";\r
-               public new const string Namespace = "http://schemas.xmlsoap.org/wsdl/soap12/";\r
-       }\r
-}\r
-\r
-#endif\r
+
+#if NET_2_0
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description 
+{
+       [XmlFormatExtensionPrefix ("soap12", "http://schemas.xmlsoap.org/wsdl/soap12/")]
+       [XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/soap12/", typeof (Binding))]
+       public sealed class Soap12Binding : SoapBinding 
+       {
+               public new const string HttpTransport = "http://schemas.xmlsoap.org/soap/http";
+               public new const string Namespace = "http://schemas.xmlsoap.org/wsdl/soap12/";
+       }
+}
+
+#endif
index e3c763069098299a2af9fa9858419f94de048f24..c046f18d7494c205a9aa5406773bc6fb67c54fff 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapAddressBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapAddressBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("address", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (Port))]\r
-       public class SoapAddressBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string location;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public SoapAddressBinding ()\r
-               {\r
-                       location = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("location")]\r
-               public string Location {        \r
-                       get { return location; }\r
-                       set { location = value; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("address", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (Port))]
+       public class SoapAddressBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string location;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public SoapAddressBinding ()
+               {
+                       location = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("location")]
+               public string Location {        
+                       get { return location; }
+                       set { location = value; }
+               }
+       
+               #endregion // Properties
+       }
+}
index b88f593c3782d8cadfb2bf89d6255d919eee02dc..8914234c0fe64a285d9c9f4ac96f322cccb7f239 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPrefix ("soap", "http://schemas.xmlsoap.org/wsdl/soap/")]\r
-       [XmlFormatExtensionPrefix ("soapenc", "http://schemas.xmlsoap.org/soap/encoding/")]\r
-       [XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (Binding))]\r
-       public class SoapBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               public const string HttpTransport = "http://schemas.xmlsoap.org/soap/http";\r
-               public const string Namespace = "http://schemas.xmlsoap.org/wsdl/soap/";\r
-\r
-               SoapBindingStyle style;\r
-               string transport;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public SoapBinding ()\r
-               {\r
-                       style = SoapBindingStyle.Document;\r
-                       transport = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               // LAMESPEC: .NET says that the default value is SoapBindingStyle.Document but\r
-               // reflection shows this attribute is SoapBindingStyle.Default\r
-\r
-               [DefaultValue (SoapBindingStyle.Default)]\r
-               [XmlAttribute ("style")]\r
-               public SoapBindingStyle Style {\r
-                       get { return style; }\r
-                       set { style = value; }\r
-               }\r
-\r
-               [XmlAttribute ("transport")]\r
-               public string Transport {\r
-                       get { return transport; }\r
-                       set { transport = value; }\r
-               }\r
-       \r
-               #endregion // Properties\r
-       }\r
+
+using System.ComponentModel;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPrefix ("soap", "http://schemas.xmlsoap.org/wsdl/soap/")]
+       [XmlFormatExtensionPrefix ("soapenc", "http://schemas.xmlsoap.org/soap/encoding/")]
+       [XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (Binding))]
+       public class SoapBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               public const string HttpTransport = "http://schemas.xmlsoap.org/soap/http";
+               public const string Namespace = "http://schemas.xmlsoap.org/wsdl/soap/";
+
+               SoapBindingStyle style;
+               string transport;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public SoapBinding ()
+               {
+                       style = SoapBindingStyle.Document;
+                       transport = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               // LAMESPEC: .NET says that the default value is SoapBindingStyle.Document but
+               // reflection shows this attribute is SoapBindingStyle.Default
+
+               [DefaultValue (SoapBindingStyle.Default)]
+               [XmlAttribute ("style")]
+               public SoapBindingStyle Style {
+                       get { return style; }
+                       set { style = value; }
+               }
+
+               [XmlAttribute ("transport")]
+               public string Transport {
+                       get { return transport; }
+                       set { transport = value; }
+               }
+       
+               #endregion // Properties
+       }
 }
index 0e40dab125ff629062c830138b6d72b695459e2a..e03601f877ce24caddca3163a2cecadec1794019 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapBindingStyle.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapBindingStyle.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       public enum SoapBindingStyle {\r
-               [XmlIgnore]\r
-               Default,\r
-               [XmlEnum ("document")]\r
-               Document,\r
-               [XmlEnum ("rpc")]\r
-               Rpc\r
-       }\r
-}\r
+
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       public enum SoapBindingStyle {
+               [XmlIgnore]
+               Default,
+               [XmlEnum ("document")]
+               Document,
+               [XmlEnum ("rpc")]
+               Rpc
+       }
+}
index 906b65150cb0856fc38deeb68c745d052be6ae11..d019164a9f51d027039d6ca9200658fe856ae43d 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapBindingUse.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapBindingUse.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       public enum SoapBindingUse {\r
-               [XmlIgnore]\r
-               Default,\r
-               [XmlEnum ("encoded")]\r
-               Encoded,\r
-               [XmlEnum ("literal")]\r
-               Literal\r
-       }\r
-}\r
+
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       public enum SoapBindingUse {
+               [XmlIgnore]
+               Default,
+               [XmlEnum ("encoded")]
+               Encoded,
+               [XmlEnum ("literal")]
+               Literal
+       }
+}
index f034b6918d9ed7ddcc7a635aa8f6d9027a4bc9d6..42bd3e33e5b01e20c6fdf2f7dca74cfc095fa0db 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapBodyBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapBodyBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("body", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (InputBinding), typeof (OutputBinding), typeof (MimePart))]\r
-       public class SoapBodyBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-               \r
-               string encoding;\r
-               string ns;\r
-               string[] parts;\r
-               string partsString;\r
-               SoapBindingUse use;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public SoapBodyBinding ()\r
-               {\r
-                       encoding = String.Empty;\r
-                       ns = String.Empty;\r
-                       parts = null;\r
-                       partsString = null;\r
-                       use = SoapBindingUse.Default;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue ("")]\r
-               [XmlAttribute ("encodingStyle")]\r
-               public string Encoding {\r
-                       get { return encoding; }\r
-                       set { encoding = value; }\r
-               }\r
-\r
-               [DefaultValue ("")]\r
-               [XmlAttribute ("namespace")]\r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public string[] Parts {\r
-                       get { return parts; }\r
-                       set {\r
-                               parts = value;\r
-                               if (value == null)\r
-                                       partsString = null;\r
-                               else\r
-                                       partsString = String.Join(" ", value);\r
-                       }\r
-               }\r
-\r
-               [XmlAttribute ("parts", DataType = "NMTOKENS")]\r
-               public string PartsString {\r
-                       get { return partsString; }\r
-                       set {\r
-                               partsString = value;\r
-                               if (value == null)\r
-                                       parts = null;\r
-                               else\r
-                                       parts = value.Split(' ');\r
-                       }\r
-               }\r
-\r
-               [DefaultValue (SoapBindingUse.Default)]\r
-               [XmlAttribute ("use")]\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
+
+using System.ComponentModel;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("body", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (InputBinding), typeof (OutputBinding), typeof (MimePart))]
+       public class SoapBodyBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+               
+               string encoding;
+               string ns;
+               string[] parts;
+               string partsString;
+               SoapBindingUse use;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public SoapBodyBinding ()
+               {
+                       encoding = String.Empty;
+                       ns = String.Empty;
+                       parts = null;
+                       partsString = null;
+                       use = SoapBindingUse.Default;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue ("")]
+               [XmlAttribute ("encodingStyle")]
+               public string Encoding {
+                       get { return encoding; }
+                       set { encoding = value; }
+               }
+
+               [DefaultValue ("")]
+               [XmlAttribute ("namespace")]
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               [XmlIgnore]
+               public string[] Parts {
+                       get { return parts; }
+                       set {
+                               parts = value;
+                               if (value == null)
+                                       partsString = null;
+                               else
+                                       partsString = String.Join(" ", value);
+                       }
+               }
+
+               [XmlAttribute ("parts", DataType = "NMTOKENS")]
+               public string PartsString {
+                       get { return partsString; }
+                       set {
+                               partsString = value;
+                               if (value == null)
+                                       parts = null;
+                               else
+                                       parts = value.Split(' ');
+                       }
+               }
+
+               [DefaultValue (SoapBindingUse.Default)]
+               [XmlAttribute ("use")]
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+
+               #endregion // Properties
+       }
 }
index ef9560edfdad443fd7d5f31a6680ea0ff15f0295..9b9494e6a0e82246ae34008bd5e4e42c42ea53d6 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapExtensionImporter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapExtensionImporter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.CodeDom;\r
-\r
-namespace System.Web.Services.Description {\r
-       public abstract class SoapExtensionImporter {\r
-\r
-               #region Fields\r
-\r
-               SoapProtocolImporter importContext;\r
-               \r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               protected SoapExtensionImporter ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public SoapProtocolImporter ImportContext {\r
-                       get { return importContext; }\r
-                       set { importContext = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public abstract void ImportMethod (CodeAttributeDeclarationCollection metadata);\r
-\r
-               #endregion\r
-       }\r
-}\r
+
+using System.CodeDom;
+
+namespace System.Web.Services.Description {
+       public abstract class SoapExtensionImporter {
+
+               #region Fields
+
+               SoapProtocolImporter importContext;
+               
+               #endregion // Fields
+
+               #region Constructors
+       
+               protected SoapExtensionImporter ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public SoapProtocolImporter ImportContext {
+                       get { return importContext; }
+                       set { importContext = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public abstract void ImportMethod (CodeAttributeDeclarationCollection metadata);
+
+               #endregion
+       }
+}
index 41abe218ad3b8bba1893ea3e8bf30977772243bf..8584302bb5e866475ed53a3cb5dff8b2203ab838 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapExtensionReflector.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapExtensionReflector.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Description {\r
-       public abstract class SoapExtensionReflector {\r
-\r
-               #region Fields\r
-\r
-               ProtocolReflector reflectionContext;\r
-               \r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               protected SoapExtensionReflector ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public ProtocolReflector ReflectionContext {\r
-                       get { return reflectionContext; }\r
-                       set { reflectionContext = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public abstract void ReflectMethod ();\r
-\r
-               #endregion\r
-       }\r
-}\r
+
+namespace System.Web.Services.Description {
+       public abstract class SoapExtensionReflector {
+
+               #region Fields
+
+               ProtocolReflector reflectionContext;
+               
+               #endregion // Fields
+
+               #region Constructors
+       
+               protected SoapExtensionReflector ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public ProtocolReflector ReflectionContext {
+                       get { return reflectionContext; }
+                       set { reflectionContext = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public abstract void ReflectMethod ();
+
+               #endregion
+       }
+}
index 1aa7ece200955a2ebf8b8149fc472a612efd539d..75f648d1706d485b0f4b9f1402cf2cb0a2774ce3 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapFaultBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapFaultBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("fault", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (FaultBinding))]\r
-       public class SoapFaultBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string encoding;\r
-               string ns;\r
-               SoapBindingUse use;\r
-               string name;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public SoapFaultBinding ()\r
-               {\r
-                       encoding = String.Empty;\r
-                       ns = String.Empty;\r
-                       use = SoapBindingUse.Default;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-#if NET_2_0\r
-               [DefaultValue ("")]\r
-#endif\r
-               [XmlAttribute ("encodingStyle")]\r
-               public string Encoding {\r
-                       get { return encoding; }\r
-                       set { encoding = value; }\r
-               }\r
-       \r
-               [XmlAttribute ("namespace")]    \r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               [DefaultValue (SoapBindingUse.Default)]\r
-               [XmlAttribute ("use")]\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [XmlAttribute ("name")]\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-#endif\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.ComponentModel;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("fault", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (FaultBinding))]
+       public class SoapFaultBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string encoding;
+               string ns;
+               SoapBindingUse use;
+               string name;
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public SoapFaultBinding ()
+               {
+                       encoding = String.Empty;
+                       ns = String.Empty;
+                       use = SoapBindingUse.Default;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+#if NET_2_0
+               [DefaultValue ("")]
+#endif
+               [XmlAttribute ("encodingStyle")]
+               public string Encoding {
+                       get { return encoding; }
+                       set { encoding = value; }
+               }
+       
+               [XmlAttribute ("namespace")]    
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               [DefaultValue (SoapBindingUse.Default)]
+               [XmlAttribute ("use")]
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+
+#if NET_2_0
+               [XmlAttribute ("name")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+               #endregion // Properties
+       }
+}
index dd45d63b1d859d29bd06c85792cf7a35adbc30e8..9661c426862bfaecb2b737576f02b01026dbc036 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapHeaderBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapHeaderBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Web.Services;\r
-using System.Web.Services.Configuration;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("header", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (InputBinding), typeof (OutputBinding))]\r
-       public class SoapHeaderBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string encoding;\r
-               bool mapToProperty;\r
-               XmlQualifiedName message;\r
-               string ns;\r
-               string part;\r
-               SoapBindingUse use;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               public SoapHeaderBinding ()\r
-               {\r
-                       encoding = String.Empty;\r
-                       mapToProperty = false;\r
-                       message = XmlQualifiedName.Empty;\r
-                       ns = String.Empty;\r
-                       part = String.Empty;\r
-                       use = SoapBindingUse.Default;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue ("")]\r
-               [XmlAttribute ("encodingStyle")]\r
-               public string Encoding {\r
-                       get { return encoding; }\r
-                       set { encoding = value; }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public bool MapToProperty {     \r
-                       get { return mapToProperty; }\r
-                       set { mapToProperty = value; }\r
-               }\r
-\r
-               [XmlAttribute ("message")]      \r
-               public XmlQualifiedName Message {\r
-                       get { return message; }\r
-                       set { message = value; }\r
-               }\r
-\r
-               [DefaultValue ("")]     \r
-               [XmlAttribute ("namespace")]    \r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               [XmlAttribute ("part", DataType = "NMTOKEN")]\r
-               public string Part {\r
-                       get { return part; }\r
-                       set { part = value; }\r
-               }\r
-\r
-               [DefaultValue (SoapBindingUse.Default)]\r
-               [XmlAttribute ("use")]\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-\r
-#if NET_1_1\r
-               [MonoTODO]\r
-               [XmlElement ("headerfault")]\r
-               public SoapHeaderFaultBinding Fault \r
-               {\r
-                       get { return null; }\r
-                       set { ; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-       }\r
+
+using System.ComponentModel;
+using System.Web.Services;
+using System.Web.Services.Configuration;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("header", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (InputBinding), typeof (OutputBinding))]
+       public class SoapHeaderBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string encoding;
+               bool mapToProperty;
+               XmlQualifiedName message;
+               string ns;
+               string part;
+               SoapBindingUse use;
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               public SoapHeaderBinding ()
+               {
+                       encoding = String.Empty;
+                       mapToProperty = false;
+                       message = XmlQualifiedName.Empty;
+                       ns = String.Empty;
+                       part = String.Empty;
+                       use = SoapBindingUse.Default;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue ("")]
+               [XmlAttribute ("encodingStyle")]
+               public string Encoding {
+                       get { return encoding; }
+                       set { encoding = value; }
+               }
+
+               [XmlIgnore]
+               public bool MapToProperty {     
+                       get { return mapToProperty; }
+                       set { mapToProperty = value; }
+               }
+
+               [XmlAttribute ("message")]      
+               public XmlQualifiedName Message {
+                       get { return message; }
+                       set { message = value; }
+               }
+
+               [DefaultValue ("")]     
+               [XmlAttribute ("namespace")]    
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               [XmlAttribute ("part", DataType = "NMTOKEN")]
+               public string Part {
+                       get { return part; }
+                       set { part = value; }
+               }
+
+               [DefaultValue (SoapBindingUse.Default)]
+               [XmlAttribute ("use")]
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+
+#if NET_1_1
+               [MonoTODO]
+               [XmlElement ("headerfault")]
+               public SoapHeaderFaultBinding Fault 
+               {
+                       get { return null; }
+                       set { ; }
+               }
+#endif
+
+               #endregion // Properties
+       }
 }
index bb4748fbcbc252bc6bb9ff13759a4990f4682541..ac54292077ce3641d4dc50cf6198b8dd9ec7184a 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapHeaderFaultBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapHeaderFaultBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Web.Services.Configuration;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-\r
-       public class SoapHeaderFaultBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string encoding;\r
-               XmlQualifiedName message;\r
-               string ns;\r
-               string part;\r
-               SoapBindingUse use;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               [MonoTODO]      \r
-               public SoapHeaderFaultBinding ()\r
-               {\r
-                       encoding = String.Empty;\r
-                       message = XmlQualifiedName.Empty;\r
-                       ns = String.Empty;\r
-                       part = String.Empty;\r
-                       use = SoapBindingUse.Default;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue ("")]\r
-               [XmlAttribute ("encodingStyle")]\r
-               public string Encoding {\r
-                       get { return encoding; }\r
-                       set { encoding = value; }\r
-               }\r
-\r
-               [XmlAttribute ("message")]\r
-               public XmlQualifiedName Message {\r
-                       get { return message; }\r
-                       set { message = value; }\r
-               }\r
-       \r
-               [DefaultValue ("")]\r
-               [XmlAttribute ("namespace")]    \r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               [XmlAttribute ("part", DataType = "NMTOKEN")]\r
-               public string Part {\r
-                       get { return part; }\r
-                       set { part = value; }\r
-               }\r
-\r
-               [DefaultValue (SoapBindingUse.Default)]\r
-               [XmlAttribute ("use")]\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
+
+using System.ComponentModel;
+using System.Web.Services.Configuration;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+
+       public class SoapHeaderFaultBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string encoding;
+               XmlQualifiedName message;
+               string ns;
+               string part;
+               SoapBindingUse use;
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               [MonoTODO]      
+               public SoapHeaderFaultBinding ()
+               {
+                       encoding = String.Empty;
+                       message = XmlQualifiedName.Empty;
+                       ns = String.Empty;
+                       part = String.Empty;
+                       use = SoapBindingUse.Default;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue ("")]
+               [XmlAttribute ("encodingStyle")]
+               public string Encoding {
+                       get { return encoding; }
+                       set { encoding = value; }
+               }
+
+               [XmlAttribute ("message")]
+               public XmlQualifiedName Message {
+                       get { return message; }
+                       set { message = value; }
+               }
+       
+               [DefaultValue ("")]
+               [XmlAttribute ("namespace")]    
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               [XmlAttribute ("part", DataType = "NMTOKEN")]
+               public string Part {
+                       get { return part; }
+                       set { part = value; }
+               }
+
+               [DefaultValue (SoapBindingUse.Default)]
+               [XmlAttribute ("use")]
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+
+               #endregion // Properties
+       }
 }
index 9eecd8df09dba95b71578e6aa9d8333311a353bb..fff6bfa30ddf2266d0f9e22124b7b8f2cd7976cb 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.SoapOperationBinding.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.SoapOperationBinding.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtension ("operation", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (OperationBinding))]\r
-       public class SoapOperationBinding : ServiceDescriptionFormatExtension {\r
-\r
-               #region Fields\r
-\r
-               string soapAction;\r
-               SoapBindingStyle style;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               public SoapOperationBinding ()\r
-               {\r
-                       soapAction = String.Empty;\r
-                       style = SoapBindingStyle.Default;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlAttribute ("soapAction")]\r
-               public string SoapAction {\r
-                       get { return soapAction; }\r
-                       set { soapAction = value; }\r
-               }\r
-\r
-               // LAMESPEC: .NET Documentation says that the default value for this property is\r
-               // SoapBindingStyle.Document (see constructor), but reflection shows that this \r
-               // attribute value is SoapBindingStyle.Default\r
-\r
-               [DefaultValue (SoapBindingStyle.Default)]\r
-               [XmlAttribute ("style")]\r
-               public SoapBindingStyle Style {\r
-                       get { return style; }\r
-                       set { style = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.ComponentModel;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtension ("operation", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (OperationBinding))]
+       public class SoapOperationBinding : ServiceDescriptionFormatExtension {
+
+               #region Fields
+
+               string soapAction;
+               SoapBindingStyle style;
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               public SoapOperationBinding ()
+               {
+                       soapAction = String.Empty;
+                       style = SoapBindingStyle.Default;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlAttribute ("soapAction")]
+               public string SoapAction {
+                       get { return soapAction; }
+                       set { soapAction = value; }
+               }
+
+               // LAMESPEC: .NET Documentation says that the default value for this property is
+               // SoapBindingStyle.Document (see constructor), but reflection shows that this 
+               // attribute value is SoapBindingStyle.Default
+
+               [DefaultValue (SoapBindingStyle.Default)]
+               [XmlAttribute ("style")]
+               public SoapBindingStyle Style {
+                       get { return style; }
+                       set { style = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index 06db0b6fe77ea3773d2bebd31c910a12a21d9584..87a79dcdb94e9ee562ae4aa3625dc0257e38f6e5 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Description.Types.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Description.Types.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Configuration;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Description {\r
-       [XmlFormatExtensionPoint ("Extensions")]\r
-       public sealed class Types : DocumentableItem {\r
-\r
-               #region Fields\r
-\r
-               ServiceDescriptionFormatExtensionCollection extensions;\r
-               XmlSchemas schemas;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-       \r
-               public Types ()\r
-               {\r
-                       extensions = new ServiceDescriptionFormatExtensionCollection (this);\r
-                       schemas = new XmlSchemas ();\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
+
+using System.Web.Services.Configuration;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description {
+       [XmlFormatExtensionPoint ("Extensions")]
+       public sealed class Types : DocumentableItem {
+
+               #region Fields
+
+               ServiceDescriptionFormatExtensionCollection extensions;
+               XmlSchemas schemas;
+
+               #endregion // Fields
+
+               #region Constructors
+       
+               public Types ()
+               {
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+                       schemas = new XmlSchemas ();
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
                public 
 #if NET_2_0
                override
 #endif
-               ServiceDescriptionFormatExtensionCollection Extensions {        \r
-                       get { return extensions; }\r
-               }\r
-\r
-               [XmlElement ("schema", typeof (XmlSchema), Namespace = "http://www.w3.org/2001/XMLSchema")]\r
-               public XmlSchemas Schemas {\r
-                       get { return schemas; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+               ServiceDescriptionFormatExtensionCollection Extensions {        
+                       get { return extensions; }
+               }
+
+               [XmlElement ("schema", typeof (XmlSchema), Namespace = "http://www.w3.org/2001/XMLSchema")]
+               public XmlSchemas Schemas {
+                       get { return schemas; }
+               }
+
+               #endregion // Properties
+       }
+}
index 925746467f1244b946db9d7c6ec00b1d55fe7211..e6da3a8f3d2b9217450e03560441ddea3307042f 100644 (file)
-// \r
-// System.Web.Services.Discovery.ContractReference.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.IO;\r
-using System.Web.Services.Description;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-\r
-namespace System.Web.Services.Discovery {\r
-\r
-       [XmlRootAttribute("contractRef", Namespace="http://schemas.xmlsoap.org/disco/scl/", IsNullable=true)]\r
-       public class ContractReference : DiscoveryReference {\r
-\r
-               #region Fields\r
-               \r
-               public const string Namespace = "http://schemas.xmlsoap.org/disco/scl/";\r
-\r
-               private ServiceDescription contract;\r
-               private string defaultFilename;\r
-               private string docRef;\r
-               private string href;\r
-               \r
-               #endregion // Fields\r
-               \r
-               #region Constructors\r
-\r
-               public ContractReference () \r
-               {\r
-               }\r
-               \r
-               public ContractReference (string href) : this() \r
-               {\r
-                       this.href = href;\r
-               }\r
-               \r
-               public ContractReference (string href, string docRef)\r
-               {\r
-                       this.href = href;\r
-                       this.docRef = docRef;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public ServiceDescription Contract {\r
-                       get {\r
-                               if (ClientProtocol == null) \r
-                                       throw new InvalidOperationException ("The ClientProtocol property is a null reference");\r
-                               \r
-                               ServiceDescription desc = ClientProtocol.Documents [Url] as ServiceDescription;\r
-                               if (desc == null)\r
-                                       throw new Exception ("The Documents property of ClientProtocol does not contain a WSDL document with the url " + Url);\r
-                                       \r
-                               return desc; \r
-                       }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public override string DefaultFilename {\r
-                       get { return FilenameFromUrl (Url) + ".wsdl"; }\r
-               }\r
-               \r
-               [XmlAttribute("docRef")]\r
-               public string DocRef {\r
-                       get { return docRef; }\r
-                       set { docRef = value; }\r
-               }\r
-               \r
-               [XmlAttribute("ref")]\r
-               public string Ref {\r
-                       get { return href; }\r
-                       set { href = value; }\r
-               }\r
-               \r
-               [XmlIgnore]\r
-               public override string Url {\r
-                       get { return href;}                     \r
-                       set { href = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override object ReadDocument (Stream stream)\r
-               {\r
-                       return ServiceDescription.Read (stream);\r
-               }\r
-                \r
-               protected internal override void Resolve (string contentType, Stream stream) \r
-               {\r
-                       ServiceDescription wsdl = ServiceDescription.Read (stream);\r
-                       \r
-                       if (!ClientProtocol.References.Contains (Url))\r
-                               ClientProtocol.References.Add (this);\r
-\r
-                       ClientProtocol.Documents.Add (Url, wsdl);\r
-                       ResolveInternal (ClientProtocol, wsdl);\r
-               }\r
-               \r
-               internal void ResolveInternal (DiscoveryClientProtocol prot, ServiceDescription wsdl) \r
-               {\r
-                       if (wsdl.Imports == null) return;\r
-                       \r
-                       foreach (Import import in wsdl.Imports)\r
-                       {\r
-                               // Make relative uris to absoulte\r
-\r
-                               Uri uri = new Uri (BaseUri, import.Location);\r
-                               string url = uri.ToString ();\r
-\r
-                               if (prot.Documents.Contains (url))      // Already resolved\r
-                                       continue;\r
-\r
-                               try\r
-                               {\r
-                                       string contentType = null;\r
-                                       Stream stream = prot.Download (ref url, ref contentType);\r
-                                       XmlTextReader reader = new XmlTextReader (url, stream);\r
-                                       reader.XmlResolver = null;\r
-                                       reader.MoveToContent ();\r
-                                       \r
-                                       DiscoveryReference refe;\r
-                                       if (ServiceDescription.CanRead (reader))\r
-                                       {\r
-                                               ServiceDescription refWsdl = ServiceDescription.Read (reader);\r
-                                               refe = new ContractReference ();\r
-                                               refe.ClientProtocol = prot;\r
-                                               refe.Url = url;\r
-                                               ((ContractReference)refe).ResolveInternal (prot, refWsdl);\r
-                                               prot.Documents.Add (url, refWsdl);\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               XmlSchema schema = XmlSchema.Read (reader, null);\r
-                                               refe = new SchemaReference ();\r
-                                               refe.ClientProtocol = prot;\r
-                                               refe.Url = url;\r
-                                               prot.Documents.Add (url, schema);\r
-                                       }\r
-                                       \r
-                                       if (!prot.References.Contains (url))\r
-                                               prot.References.Add (refe);\r
-                                               \r
-                                       reader.Close ();\r
-                               }\r
-                               catch (Exception ex)\r
-                               {\r
-                                       ReportError (url, ex);\r
-                               }\r
-                       }\r
-\r
-                       foreach (XmlSchema schema in wsdl.Types.Schemas)\r
-                       {\r
-                               // the schema itself is not added to the\r
-                               // references, but it has to resolve includes.\r
-                               Uri uri = BaseUri;\r
-                               string url = uri.ToString ();\r
-                               SchemaReference refe = new SchemaReference ();\r
-                               refe.ClientProtocol = prot;\r
-                               refe.Url = url;\r
-                               refe.ResolveInternal (prot, schema);\r
-                       }\r
-               }\r
-                \r
-        public override void WriteDocument (object document, Stream stream) \r
-               {\r
-                       ((ServiceDescription)document).Write (stream);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+// 
+// System.Web.Services.Discovery.ContractReference.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.IO;
+using System.Web.Services.Description;
+using System.Xml.Serialization;
+using System.Xml;
+using System.Xml.Schema;
+
+namespace System.Web.Services.Discovery {
+
+       [XmlRootAttribute("contractRef", Namespace="http://schemas.xmlsoap.org/disco/scl/", IsNullable=true)]
+       public class ContractReference : DiscoveryReference {
+
+               #region Fields
+               
+               public const string Namespace = "http://schemas.xmlsoap.org/disco/scl/";
+
+               private ServiceDescription contract;
+               private string defaultFilename;
+               private string docRef;
+               private string href;
+               
+               #endregion // Fields
+               
+               #region Constructors
+
+               public ContractReference () 
+               {
+               }
+               
+               public ContractReference (string href) : this() 
+               {
+                       this.href = href;
+               }
+               
+               public ContractReference (string href, string docRef)
+               {
+                       this.href = href;
+                       this.docRef = docRef;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public ServiceDescription Contract {
+                       get {
+                               if (ClientProtocol == null) 
+                                       throw new InvalidOperationException ("The ClientProtocol property is a null reference");
+                               
+                               ServiceDescription desc = ClientProtocol.Documents [Url] as ServiceDescription;
+                               if (desc == null)
+                                       throw new Exception ("The Documents property of ClientProtocol does not contain a WSDL document with the url " + Url);
+                                       
+                               return desc; 
+                       }
+               }
+
+               [XmlIgnore]
+               public override string DefaultFilename {
+                       get { return FilenameFromUrl (Url) + ".wsdl"; }
+               }
+               
+               [XmlAttribute("docRef")]
+               public string DocRef {
+                       get { return docRef; }
+                       set { docRef = value; }
+               }
+               
+               [XmlAttribute("ref")]
+               public string Ref {
+                       get { return href; }
+                       set { href = value; }
+               }
+               
+               [XmlIgnore]
+               public override string Url {
+                       get { return href;}                     
+                       set { href = value; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public override object ReadDocument (Stream stream)
+               {
+                       return ServiceDescription.Read (stream);
+               }
+                
+               protected internal override void Resolve (string contentType, Stream stream) 
+               {
+                       ServiceDescription wsdl = ServiceDescription.Read (stream);
+                       
+                       if (!ClientProtocol.References.Contains (Url))
+                               ClientProtocol.References.Add (this);
+
+                       ClientProtocol.Documents.Add (Url, wsdl);
+                       ResolveInternal (ClientProtocol, wsdl);
+               }
+               
+               internal void ResolveInternal (DiscoveryClientProtocol prot, ServiceDescription wsdl) 
+               {
+                       if (wsdl.Imports == null) return;
+                       
+                       foreach (Import import in wsdl.Imports)
+                       {
+                               // Make relative uris to absoulte
+
+                               Uri uri = new Uri (BaseUri, import.Location);
+                               string url = uri.ToString ();
+
+                               if (prot.Documents.Contains (url))      // Already resolved
+                                       continue;
+
+                               try
+                               {
+                                       string contentType = null;
+                                       Stream stream = prot.Download (ref url, ref contentType);
+                                       XmlTextReader reader = new XmlTextReader (url, stream);
+                                       reader.XmlResolver = null;
+                                       reader.MoveToContent ();
+                                       
+                                       DiscoveryReference refe;
+                                       if (ServiceDescription.CanRead (reader))
+                                       {
+                                               ServiceDescription refWsdl = ServiceDescription.Read (reader);
+                                               refe = new ContractReference ();
+                                               refe.ClientProtocol = prot;
+                                               refe.Url = url;
+                                               ((ContractReference)refe).ResolveInternal (prot, refWsdl);
+                                               prot.Documents.Add (url, refWsdl);
+                                       }
+                                       else
+                                       {
+                                               XmlSchema schema = XmlSchema.Read (reader, null);
+                                               refe = new SchemaReference ();
+                                               refe.ClientProtocol = prot;
+                                               refe.Url = url;
+                                               prot.Documents.Add (url, schema);
+                                       }
+                                       
+                                       if (!prot.References.Contains (url))
+                                               prot.References.Add (refe);
+                                               
+                                       reader.Close ();
+                               }
+                               catch (Exception ex)
+                               {
+                                       ReportError (url, ex);
+                               }
+                       }
+
+                       foreach (XmlSchema schema in wsdl.Types.Schemas)
+                       {
+                               // the schema itself is not added to the
+                               // references, but it has to resolve includes.
+                               Uri uri = BaseUri;
+                               string url = uri.ToString ();
+                               SchemaReference refe = new SchemaReference ();
+                               refe.ClientProtocol = prot;
+                               refe.Url = url;
+                               refe.ResolveInternal (prot, schema);
+                       }
+               }
+                
+        public override void WriteDocument (object document, Stream stream) 
+               {
+                       ((ServiceDescription)document).Write (stream);
+               }
+
+               #endregion // Methods
+       }
+}
index d5dd6d100befc3a612e10103ace0aa1812eef7fa..c7ea99ed32f31df9485416204cbfae1a0b790c5b 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.ContractSearchPattern.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.ContractSearchPattern.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class ContractSearchPattern : DiscoverySearchPattern {\r
-\r
-               #region Fields\r
-\r
-               private string pattern = "*.asmx";\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public ContractSearchPattern () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override string Pattern {\r
-                       get { return pattern; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override DiscoveryReference GetDiscoveryReference (string filename)\r
-               {\r
-                       ContractReference refe = new ContractReference ();\r
-                       refe.Url = filename;\r
-                       refe.Ref = filename;\r
-                       refe.DocRef = filename;\r
-                       return refe;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Discovery {
+       public sealed class ContractSearchPattern : DiscoverySearchPattern {
+
+               #region Fields
+
+               private string pattern = "*.asmx";
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public ContractSearchPattern () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public override string Pattern {
+                       get { return pattern; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public override DiscoveryReference GetDiscoveryReference (string filename)
+               {
+                       ContractReference refe = new ContractReference ();
+                       refe.Url = filename;
+                       refe.Ref = filename;
+                       refe.DocRef = filename;
+                       return refe;
+               }
+
+               #endregion // Methods
+       }
+}
index 21e25bdab03d99ebdc6c81eb54714cfb582518e9..a0bea3a449dea517b05b229aec2cb375b6eaf489 100644 (file)
@@ -1,13 +1,13 @@
-// \r
-// System.Web.Services.Discovery.DiscoveryClientDocumentCollection.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DiscoveryClientDocumentCollection.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Dave Bettin, 2002
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryClientDocumentCollection : DictionaryBase {\r
-\r
-               #region Constructors \r
-\r
-               public DiscoveryClientDocumentCollection () \r
-                       : base ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public object this [string url] {\r
-                       get { return InnerHashtable [url]; }\r
-                       set { \r
-                               if (url == null)\r
-                                       throw new ArgumentNullException ();\r
-                               InnerHashtable [url] = value; \r
-                       }\r
-               }\r
-               \r
-               public ICollection Keys {\r
-                       get { return InnerHashtable.Keys; }\r
-               }\r
-               \r
-               public ICollection Values {\r
-                       get { return InnerHashtable.Values; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void Add (string url, object value)\r
-               {\r
-                       InnerHashtable [url] = value;\r
-               }\r
-\r
-               public bool Contains (string url)\r
-               {\r
-                       return InnerHashtable.Contains (url);\r
-               }\r
-               \r
-               public void Remove (string url)\r
-               {\r
-                       InnerHashtable.Remove (url);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryClientDocumentCollection : DictionaryBase {
+
+               #region Constructors 
+
+               public DiscoveryClientDocumentCollection () 
+                       : base ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public object this [string url] {
+                       get { return InnerHashtable [url]; }
+                       set { 
+                               if (url == null)
+                                       throw new ArgumentNullException ();
+                               InnerHashtable [url] = value; 
+                       }
+               }
+               
+               public ICollection Keys {
+                       get { return InnerHashtable.Keys; }
+               }
+               
+               public ICollection Values {
+                       get { return InnerHashtable.Values; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public void Add (string url, object value)
+               {
+                       InnerHashtable [url] = value;
+               }
+
+               public bool Contains (string url)
+               {
+                       return InnerHashtable.Contains (url);
+               }
+               
+               public void Remove (string url)
+               {
+                       InnerHashtable.Remove (url);
+               }
+
+               #endregion // Methods
+       }
+}
index 28677d0d8623a7cfc4c10a01b5f62cd9639603d1..64fa18b736a8217b7811e57ad48838bfa03847a6 100644 (file)
-// \r
-// System.Web.Services.Protocols.DiscoveryClientProtocol.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Collections;\r
-using System.IO;\r
-using System.Web.Services.Protocols;\r
-using System.Web.Services.Description;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-using System.Net;\r
-using System.Text.RegularExpressions;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public class DiscoveryClientProtocol : HttpWebClientProtocol {\r
-\r
-               #region Fields\r
-\r
-               private IList additionalInformation = new ArrayList ();\r
-               private DiscoveryClientDocumentCollection documents = new DiscoveryClientDocumentCollection();\r
-               private DiscoveryExceptionDictionary errors = new DiscoveryExceptionDictionary();\r
-               private DiscoveryClientReferenceCollection references = new DiscoveryClientReferenceCollection();\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryClientProtocol () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public IList AdditionalInformation {\r
-                       get { return additionalInformation; }\r
-               }\r
-               \r
-               public DiscoveryClientDocumentCollection Documents {\r
-                       get { return documents; }\r
-               }\r
-               \r
-               public DiscoveryExceptionDictionary Errors {\r
-                       get { return errors; }\r
-               }\r
-\r
-               public DiscoveryClientReferenceCollection References {\r
-                       get { return references; }\r
-               }               \r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public DiscoveryDocument Discover (string url)\r
-               {\r
-                       Stream stream = Download (ref url);\r
-                       XmlTextReader reader = new XmlTextReader (url, stream);\r
-                       reader.XmlResolver = null;\r
-                       if (!DiscoveryDocument.CanRead (reader)) \r
-                               throw new InvalidOperationException ("The url '" + url + "' does not point to a valid discovery document");\r
-                               \r
-                       DiscoveryDocument doc = DiscoveryDocument.Read (reader);\r
-                       reader.Close ();\r
-                       documents.Add (url, doc);\r
-                       AddDiscoReferences (doc);\r
-                       return doc;\r
-               }\r
-\r
-               public DiscoveryDocument DiscoverAny (string url)\r
-               {\r
-                       try\r
-                       {\r
-                               string contentType = null;\r
-                               Stream stream = Download (ref url, ref contentType);\r
-       \r
-                               if (contentType.IndexOf ("text/html") != -1)\r
-                               {\r
-                                       // Look for an alternate url\r
-                                       \r
-                                       StreamReader sr = new StreamReader (stream);\r
-                                       string str = sr.ReadToEnd ();\r
-                                       \r
-                                       string rex = "link\\s*rel\\s*=\\s*[\"']?alternate[\"']?\\s*";\r
-                                       rex += "type\\s*=\\s*[\"']?text/xml[\"']?\\s*href\\s*=\\s*(?:\"(?<1>[^\"]*)\"|'(?<1>[^']*)'|(?<1>\\S+))";\r
-                                       Regex rob = new Regex (rex, RegexOptions.IgnoreCase);\r
-                                       Match m = rob.Match (str);\r
-                                       if (!m.Success) \r
-                                               throw new InvalidOperationException ("The HTML document does not contain Web service discovery information");\r
-                                       \r
-                                       if (url.StartsWith ("/"))\r
-                                       {\r
-                                               Uri uri = new Uri (url);\r
-                                               url = uri.GetLeftPart (UriPartial.Authority) + m.Groups[1];\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               int i = url.LastIndexOf ('/');\r
-                                               if (i == -1)\r
-                                                       throw new InvalidOperationException ("The HTML document does not contain Web service discovery information");\r
-\r
-                                               Uri tmp = new Uri (url);\r
-                                               tmp = new Uri (tmp, m.Groups [1].ToString ());\r
-                                               url = tmp.ToString ();\r
-                                       }\r
-                                       stream = Download (ref url);\r
-                               }\r
-                               \r
-                               XmlTextReader reader = new XmlTextReader (url, stream);\r
-                               reader.XmlResolver = null;\r
-                               reader.MoveToContent ();\r
-                               DiscoveryDocument doc;\r
-                               DiscoveryReference refe = null;\r
-                               \r
-                               if (DiscoveryDocument.CanRead (reader))\r
-                               {\r
-                                       doc = DiscoveryDocument.Read (reader);\r
-                                       documents.Add (url, doc);\r
-                                       refe = new DiscoveryDocumentReference ();\r
-                                       AddDiscoReferences (doc);\r
-                               }\r
-                               else if (ServiceDescription.CanRead (reader))\r
-                               {\r
-                                       ServiceDescription wsdl = ServiceDescription.Read (reader);\r
-                                       documents.Add (url, wsdl);\r
-                                       doc = new DiscoveryDocument ();\r
-                                       refe = new ContractReference ();\r
-                                       doc.References.Add (refe);\r
-                                       refe.Url = url;\r
-                                       ((ContractReference)refe).ResolveInternal (this, wsdl);\r
-                               }\r
-                               else\r
-                               {\r
-                                       XmlSchema schema = XmlSchema.Read (reader, null);\r
-                                       documents.Add (url, schema);\r
-                                       doc = new DiscoveryDocument ();\r
-                                       refe = new SchemaReference ();\r
-                                       ((SchemaReference)refe).ResolveInternal (this, schema);\r
-                                       doc.References.Add (refe);\r
-                               }\r
-                               \r
-                               refe.ClientProtocol = this;\r
-                               refe.Url = url;\r
-                               references.Add (url, refe);\r
-                                       \r
-                               reader.Close ();\r
-                               return doc;\r
-                       }\r
-                       catch (DiscoveryException ex) {\r
-                               throw ex.Exception;\r
-                       }\r
-               }\r
-               \r
-               void AddDiscoReferences (DiscoveryDocument doc)\r
-               {\r
-                       foreach (DiscoveryReference re in doc.References)\r
-                       {\r
-                               re.ClientProtocol = this;\r
-                               references.Add (re.Url, re);\r
-                       }\r
-                       \r
-                       if (doc.AdditionalInfo != null) {\r
-                               foreach (object info in doc.AdditionalInfo)\r
-                                       additionalInformation.Add (info);\r
-                       }\r
-               }\r
-               \r
-               public Stream Download (ref string url)\r
-               {\r
-                       string contentType = null;\r
-                       return Download (ref url, ref contentType);\r
-               }\r
-               \r
-               public Stream Download (ref string url, ref string contentType)\r
-               {\r
-                       if (url.StartsWith ("http://") || url.StartsWith ("https://"))\r
-                       {\r
-                               WebRequest request = GetWebRequest (new Uri(url));\r
-                               WebResponse resp = request.GetResponse ();\r
-                               contentType = resp.ContentType;\r
-                               return resp.GetResponseStream ();\r
-                       }\r
-                       else if (url.StartsWith ("file://"))\r
-                       {\r
-                               WebRequest request = WebRequest.Create (new Uri (url));\r
-                               WebResponse resp = request.GetResponse ();\r
-                               contentType = resp.ContentType;\r
-                               return resp.GetResponseStream ();\r
-                       }\r
-                       else\r
-                       {\r
-                               string ext = Path.GetExtension (url).ToLower();\r
-                               if (ext == ".wsdl" || ext == ".xsd")\r
-                               {\r
-                                       contentType = "text/xml";\r
-                                       return new FileStream (url, FileMode.Open, FileAccess.Read);\r
-                               }\r
-                               else\r
-                                       throw new InvalidOperationException ("Unrecognized file type '" + url + "'. Extension must be one of .wsdl or .xsd");\r
-                       }\r
-               }\r
-\r
-               [Obsolete ("This method will be removed from a future version. The method call is no longer required for resource discovery", false)]\r
-               public void LoadExternals ()\r
-               {\r
-               }\r
-\r
-               public DiscoveryClientResultCollection ReadAll (string topLevelFilename)\r
-               {\r
-                       StreamReader sr = new StreamReader (topLevelFilename);\r
-                       XmlSerializer ser = new XmlSerializer (typeof (DiscoveryClientResultsFile));\r
-                       DiscoveryClientResultsFile resfile = (DiscoveryClientResultsFile) ser.Deserialize (sr);\r
-                       sr.Close ();\r
-                       \r
-                       string basePath = Path.GetDirectoryName (topLevelFilename);\r
-                       \r
-                       foreach (DiscoveryClientResult dcr in resfile.Results)\r
-                       {\r
-                               Type type = Type.GetType (dcr.ReferenceTypeName);\r
-                               DiscoveryReference dr = (DiscoveryReference) Activator.CreateInstance (type);\r
-                               dr.Url = dcr.Url;\r
-                               FileStream fs = new FileStream (Path.Combine (basePath, dcr.Filename), FileMode.Open, FileAccess.Read);\r
-                               Documents.Add (dr.Url, dr.ReadDocument (fs));\r
-                               fs.Close ();\r
-                               References.Add (dr.Url, dr);\r
-                       }\r
-                       return resfile.Results;\r
-               }\r
-\r
-               public void ResolveAll ()\r
-               {\r
-                       ArrayList list = new ArrayList (References.Values);\r
-                       foreach (DiscoveryReference re in list)\r
-                       {\r
-                               try\r
-                               {\r
-                                       if (re is DiscoveryDocumentReference)\r
-                                               ((DiscoveryDocumentReference)re).ResolveAll ();\r
-                                       else\r
-                                               re.Resolve ();\r
-                               }\r
-                               catch (DiscoveryException ex)\r
-                               {\r
-                                       Errors [ex.Url] = ex.Exception; \r
-                               }\r
-                               catch (Exception ex)\r
-                               {\r
-                                       Errors [re.Url] = ex;   \r
-                               }\r
-                       }\r
-               }\r
-               \r
-               public void ResolveOneLevel ()\r
-               {\r
-                       ArrayList list = new ArrayList (References.Values);\r
-                       foreach (DiscoveryReference re in list)\r
-                               re.Resolve ();\r
-               }\r
-               \r
-               public DiscoveryClientResultCollection WriteAll (string directory, string topLevelFilename)\r
-               {\r
-                       DiscoveryClientResultsFile resfile = new DiscoveryClientResultsFile();\r
-                       \r
-                       foreach (DiscoveryReference re in References.Values)\r
-                       {\r
-                               object doc = Documents [re.Url];\r
-                               if (doc == null) continue;\r
-                               \r
-                               string fileName = FindValidName (resfile, re.DefaultFilename);\r
-                               resfile.Results.Add (new DiscoveryClientResult (re.GetType(), re.Url, fileName));\r
-                               \r
-                               string filepath = Path.Combine (directory, fileName);\r
-                               FileStream fs = new FileStream (filepath, FileMode.Create, FileAccess.Write);\r
-                               re.WriteDocument (doc, fs);\r
-                               fs.Close ();\r
-                       }\r
-                       \r
-                       StreamWriter sw = new StreamWriter (Path.Combine (directory, topLevelFilename));\r
-                       XmlSerializer ser = new XmlSerializer (typeof (DiscoveryClientResultsFile));\r
-                       ser.Serialize (sw, resfile);\r
-                       sw.Close ();\r
-                       return resfile.Results;\r
-               }\r
-               \r
-               string FindValidName (DiscoveryClientResultsFile resfile, string baseName)\r
-               {\r
-                       string name = baseName;\r
-                       int id = 0;\r
-                       bool found;\r
-                       do\r
-                       {\r
-                               found = false;\r
-                               foreach (DiscoveryClientResult res in resfile.Results)\r
-                               {\r
-                                       if (name == res.Filename) {\r
-                                               found = true; break;\r
-                                       }\r
-                               }\r
-                               if (found)\r
-                                       name = Path.GetFileNameWithoutExtension (baseName) + (++id) + Path.GetExtension (baseName);\r
-                       }\r
-                       while (found);\r
-                       \r
-                       return name;\r
-               }\r
-               \r
-               #endregion // Methods\r
-               \r
-               #region Classes\r
-               \r
-               public sealed class DiscoveryClientResultsFile {\r
-                       \r
-                       #region Fields\r
-                       \r
-                       private DiscoveryClientResultCollection results;\r
-\r
-                       #endregion // Fields\r
-\r
-                       #region Contructors\r
-                       \r
-                       public DiscoveryClientResultsFile () \r
-                       {\r
-                               results = new DiscoveryClientResultCollection ();\r
-                       }\r
-               \r
-                       #endregion // Constructors\r
-                       \r
-                       #region Properties\r
-               \r
-                       public DiscoveryClientResultCollection Results {                                \r
-                               get { return results; }\r
-                       }\r
-                       \r
-                       #endregion // Properties\r
-               }\r
-               \r
-               #endregion // Classes\r
-       }\r
-               \r
-       internal class DiscoveryException : Exception\r
-       {\r
-               public string Url;\r
-               public Exception Exception;\r
-               \r
-               public DiscoveryException (string url, Exception origin)\r
-               {\r
-                       Url = url;\r
-                       Exception = origin;\r
-               }\r
-       }\r
-}\r
+// 
+// System.Web.Services.Protocols.DiscoveryClientProtocol.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections;
+using System.IO;
+using System.Web.Services.Protocols;
+using System.Web.Services.Description;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+using System.Net;
+using System.Text.RegularExpressions;
+
+namespace System.Web.Services.Discovery {
+       public class DiscoveryClientProtocol : HttpWebClientProtocol {
+
+               #region Fields
+
+               private IList additionalInformation = new ArrayList ();
+               private DiscoveryClientDocumentCollection documents = new DiscoveryClientDocumentCollection();
+               private DiscoveryExceptionDictionary errors = new DiscoveryExceptionDictionary();
+               private DiscoveryClientReferenceCollection references = new DiscoveryClientReferenceCollection();
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public DiscoveryClientProtocol () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public IList AdditionalInformation {
+                       get { return additionalInformation; }
+               }
+               
+               public DiscoveryClientDocumentCollection Documents {
+                       get { return documents; }
+               }
+               
+               public DiscoveryExceptionDictionary Errors {
+                       get { return errors; }
+               }
+
+               public DiscoveryClientReferenceCollection References {
+                       get { return references; }
+               }               
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public DiscoveryDocument Discover (string url)
+               {
+                       Stream stream = Download (ref url);
+                       XmlTextReader reader = new XmlTextReader (url, stream);
+                       reader.XmlResolver = null;
+                       if (!DiscoveryDocument.CanRead (reader)) 
+                               throw new InvalidOperationException ("The url '" + url + "' does not point to a valid discovery document");
+                               
+                       DiscoveryDocument doc = DiscoveryDocument.Read (reader);
+                       reader.Close ();
+                       documents.Add (url, doc);
+                       AddDiscoReferences (doc);
+                       return doc;
+               }
+
+               public DiscoveryDocument DiscoverAny (string url)
+               {
+                       try
+                       {
+                               string contentType = null;
+                               Stream stream = Download (ref url, ref contentType);
+       
+                               if (contentType.IndexOf ("text/html") != -1)
+                               {
+                                       // Look for an alternate url
+                                       
+                                       StreamReader sr = new StreamReader (stream);
+                                       string str = sr.ReadToEnd ();
+                                       
+                                       string rex = "link\\s*rel\\s*=\\s*[\"']?alternate[\"']?\\s*";
+                                       rex += "type\\s*=\\s*[\"']?text/xml[\"']?\\s*href\\s*=\\s*(?:\"(?<1>[^\"]*)\"|'(?<1>[^']*)'|(?<1>\\S+))";
+                                       Regex rob = new Regex (rex, RegexOptions.IgnoreCase);
+                                       Match m = rob.Match (str);
+                                       if (!m.Success) 
+                                               throw new InvalidOperationException ("The HTML document does not contain Web service discovery information");
+                                       
+                                       if (url.StartsWith ("/"))
+                                       {
+                                               Uri uri = new Uri (url);
+                                               url = uri.GetLeftPart (UriPartial.Authority) + m.Groups[1];
+                                       }
+                                       else
+                                       {
+                                               int i = url.LastIndexOf ('/');
+                                               if (i == -1)
+                                                       throw new InvalidOperationException ("The HTML document does not contain Web service discovery information");
+
+                                               Uri tmp = new Uri (url);
+                                               tmp = new Uri (tmp, m.Groups [1].ToString ());
+                                               url = tmp.ToString ();
+                                       }
+                                       stream = Download (ref url);
+                               }
+                               
+                               XmlTextReader reader = new XmlTextReader (url, stream);
+                               reader.XmlResolver = null;
+                               reader.MoveToContent ();
+                               DiscoveryDocument doc;
+                               DiscoveryReference refe = null;
+                               
+                               if (DiscoveryDocument.CanRead (reader))
+                               {
+                                       doc = DiscoveryDocument.Read (reader);
+                                       documents.Add (url, doc);
+                                       refe = new DiscoveryDocumentReference ();
+                                       AddDiscoReferences (doc);
+                               }
+                               else if (ServiceDescription.CanRead (reader))
+                               {
+                                       ServiceDescription wsdl = ServiceDescription.Read (reader);
+                                       documents.Add (url, wsdl);
+                                       doc = new DiscoveryDocument ();
+                                       refe = new ContractReference ();
+                                       doc.References.Add (refe);
+                                       refe.Url = url;
+                                       ((ContractReference)refe).ResolveInternal (this, wsdl);
+                               }
+                               else
+                               {
+                                       XmlSchema schema = XmlSchema.Read (reader, null);
+                                       documents.Add (url, schema);
+                                       doc = new DiscoveryDocument ();
+                                       refe = new SchemaReference ();
+                                       ((SchemaReference)refe).ResolveInternal (this, schema);
+                                       doc.References.Add (refe);
+                               }
+                               
+                               refe.ClientProtocol = this;
+                               refe.Url = url;
+                               references.Add (url, refe);
+                                       
+                               reader.Close ();
+                               return doc;
+                       }
+                       catch (DiscoveryException ex) {
+                               throw ex.Exception;
+                       }
+               }
+               
+               void AddDiscoReferences (DiscoveryDocument doc)
+               {
+                       foreach (DiscoveryReference re in doc.References)
+                       {
+                               re.ClientProtocol = this;
+                               references.Add (re.Url, re);
+                       }
+                       
+                       if (doc.AdditionalInfo != null) {
+                               foreach (object info in doc.AdditionalInfo)
+                                       additionalInformation.Add (info);
+                       }
+               }
+               
+               public Stream Download (ref string url)
+               {
+                       string contentType = null;
+                       return Download (ref url, ref contentType);
+               }
+               
+               public Stream Download (ref string url, ref string contentType)
+               {
+                       if (url.StartsWith ("http://") || url.StartsWith ("https://"))
+                       {
+                               WebRequest request = GetWebRequest (new Uri(url));
+                               WebResponse resp = request.GetResponse ();
+                               contentType = resp.ContentType;
+                               return resp.GetResponseStream ();
+                       }
+                       else if (url.StartsWith ("file://"))
+                       {
+                               WebRequest request = WebRequest.Create (new Uri (url));
+                               WebResponse resp = request.GetResponse ();
+                               contentType = resp.ContentType;
+                               return resp.GetResponseStream ();
+                       }
+                       else
+                       {
+                               string ext = Path.GetExtension (url).ToLower();
+                               if (ext == ".wsdl" || ext == ".xsd")
+                               {
+                                       contentType = "text/xml";
+                                       return new FileStream (url, FileMode.Open, FileAccess.Read);
+                               }
+                               else
+                                       throw new InvalidOperationException ("Unrecognized file type '" + url + "'. Extension must be one of .wsdl or .xsd");
+                       }
+               }
+
+               [Obsolete ("This method will be removed from a future version. The method call is no longer required for resource discovery", false)]
+               public void LoadExternals ()
+               {
+               }
+
+               public DiscoveryClientResultCollection ReadAll (string topLevelFilename)
+               {
+                       StreamReader sr = new StreamReader (topLevelFilename);
+                       XmlSerializer ser = new XmlSerializer (typeof (DiscoveryClientResultsFile));
+                       DiscoveryClientResultsFile resfile = (DiscoveryClientResultsFile) ser.Deserialize (sr);
+                       sr.Close ();
+                       
+                       string basePath = Path.GetDirectoryName (topLevelFilename);
+                       
+                       foreach (DiscoveryClientResult dcr in resfile.Results)
+                       {
+                               Type type = Type.GetType (dcr.ReferenceTypeName);
+                               DiscoveryReference dr = (DiscoveryReference) Activator.CreateInstance (type);
+                               dr.Url = dcr.Url;
+                               FileStream fs = new FileStream (Path.Combine (basePath, dcr.Filename), FileMode.Open, FileAccess.Read);
+                               Documents.Add (dr.Url, dr.ReadDocument (fs));
+                               fs.Close ();
+                               References.Add (dr.Url, dr);
+                       }
+                       return resfile.Results;
+               }
+
+               public void ResolveAll ()
+               {
+                       ArrayList list = new ArrayList (References.Values);
+                       foreach (DiscoveryReference re in list)
+                       {
+                               try
+                               {
+                                       if (re is DiscoveryDocumentReference)
+                                               ((DiscoveryDocumentReference)re).ResolveAll ();
+                                       else
+                                               re.Resolve ();
+                               }
+                               catch (DiscoveryException ex)
+                               {
+                                       Errors [ex.Url] = ex.Exception; 
+                               }
+                               catch (Exception ex)
+                               {
+                                       Errors [re.Url] = ex;   
+                               }
+                       }
+               }
+               
+               public void ResolveOneLevel ()
+               {
+                       ArrayList list = new ArrayList (References.Values);
+                       foreach (DiscoveryReference re in list)
+                               re.Resolve ();
+               }
+               
+               public DiscoveryClientResultCollection WriteAll (string directory, string topLevelFilename)
+               {
+                       DiscoveryClientResultsFile resfile = new DiscoveryClientResultsFile();
+                       
+                       foreach (DiscoveryReference re in References.Values)
+                       {
+                               object doc = Documents [re.Url];
+                               if (doc == null) continue;
+                               
+                               string fileName = FindValidName (resfile, re.DefaultFilename);
+                               resfile.Results.Add (new DiscoveryClientResult (re.GetType(), re.Url, fileName));
+                               
+                               string filepath = Path.Combine (directory, fileName);
+                               FileStream fs = new FileStream (filepath, FileMode.Create, FileAccess.Write);
+                               re.WriteDocument (doc, fs);
+                               fs.Close ();
+                       }
+                       
+                       StreamWriter sw = new StreamWriter (Path.Combine (directory, topLevelFilename));
+                       XmlSerializer ser = new XmlSerializer (typeof (DiscoveryClientResultsFile));
+                       ser.Serialize (sw, resfile);
+                       sw.Close ();
+                       return resfile.Results;
+               }
+               
+               string FindValidName (DiscoveryClientResultsFile resfile, string baseName)
+               {
+                       string name = baseName;
+                       int id = 0;
+                       bool found;
+                       do
+                       {
+                               found = false;
+                               foreach (DiscoveryClientResult res in resfile.Results)
+                               {
+                                       if (name == res.Filename) {
+                                               found = true; break;
+                                       }
+                               }
+                               if (found)
+                                       name = Path.GetFileNameWithoutExtension (baseName) + (++id) + Path.GetExtension (baseName);
+                       }
+                       while (found);
+                       
+                       return name;
+               }
+               
+               #endregion // Methods
+               
+               #region Classes
+               
+               public sealed class DiscoveryClientResultsFile {
+                       
+                       #region Fields
+                       
+                       private DiscoveryClientResultCollection results;
+
+                       #endregion // Fields
+
+                       #region Contructors
+                       
+                       public DiscoveryClientResultsFile () 
+                       {
+                               results = new DiscoveryClientResultCollection ();
+                       }
+               
+                       #endregion // Constructors
+                       
+                       #region Properties
+               
+                       public DiscoveryClientResultCollection Results {                                
+                               get { return results; }
+                       }
+                       
+                       #endregion // Properties
+               }
+               
+               #endregion // Classes
+       }
+               
+       internal class DiscoveryException : Exception
+       {
+               public string Url;
+               public Exception Exception;
+               
+               public DiscoveryException (string url, Exception origin)
+               {
+                       Url = url;
+                       Exception = origin;
+               }
+       }
+}
index 130ce28e28c5a59195197d659957e130d300315e..0e77dfe5394ba3ecfeac52430630662f634daf0d 100644 (file)
@@ -1,13 +1,13 @@
-// \r
-// System.Web.Services.Protocols.DiscoveryClientReferenceCollection.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.DiscoveryClientReferenceCollection.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Dave Bettin, 2002
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryClientReferenceCollection : DictionaryBase {\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryClientReferenceCollection () \r
-                       : base ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public DiscoveryReference this [string url] {\r
-                       get { return (DiscoveryReference) InnerHashtable [url]; }\r
-                       set { InnerHashtable [url] = value; }\r
-               }\r
-               \r
-               public ICollection Keys {\r
-                       get { return InnerHashtable.Keys; }\r
-               }\r
-               \r
-               public ICollection Values {\r
-                       get { return InnerHashtable.Values; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void Add (DiscoveryReference value)\r
-               {\r
-                       Add (value.Url, value);\r
-               }\r
-               \r
-               public void Add (string url, DiscoveryReference value)\r
-               {\r
-                       InnerHashtable [url] = value;\r
-               }\r
-\r
-               public bool Contains (string url)\r
-               {\r
-                       return InnerHashtable.Contains (url);\r
-               }\r
-               \r
-               public void Remove (string url)\r
-               {\r
-                       InnerHashtable.Remove (url);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryClientReferenceCollection : DictionaryBase {
+
+               #region Constructors
+
+               public DiscoveryClientReferenceCollection () 
+                       : base ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public DiscoveryReference this [string url] {
+                       get { return (DiscoveryReference) InnerHashtable [url]; }
+                       set { InnerHashtable [url] = value; }
+               }
+               
+               public ICollection Keys {
+                       get { return InnerHashtable.Keys; }
+               }
+               
+               public ICollection Values {
+                       get { return InnerHashtable.Values; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public void Add (DiscoveryReference value)
+               {
+                       Add (value.Url, value);
+               }
+               
+               public void Add (string url, DiscoveryReference value)
+               {
+                       InnerHashtable [url] = value;
+               }
+
+               public bool Contains (string url)
+               {
+                       return InnerHashtable.Contains (url);
+               }
+               
+               public void Remove (string url)
+               {
+                       InnerHashtable.Remove (url);
+               }
+
+               #endregion // Methods
+       }
+}
index 930b0845758ae141f660cc55cf5b763a7fb03258..7b13529398767e2930b230b2f8575a6b99b5f11d 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Disocvery.DiscoveryClientResult.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Disocvery.DiscoveryClientResult.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryClientResult {\r
-       \r
-               #region Fields\r
-\r
-               private string filename;\r
-               private string referenceTypeName;\r
-               private string url;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryClientResult () \r
-               {\r
-               }\r
-               \r
-               public DiscoveryClientResult (Type referenceType, string url, string filename) : this() \r
-               {\r
-                       this.filename = filename;\r
-                       this.url = url;\r
-                       this.referenceTypeName = referenceType.FullName;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties      \r
-       \r
-               [XmlAttribute("filename")]\r
-               public string Filename {\r
-                       get { return filename; }\r
-                       set { filename = value; }\r
-               }\r
-               \r
-               [XmlAttribute("referenceType")]\r
-               public string ReferenceTypeName {\r
-                       get { return referenceTypeName; }\r
-                       set { referenceTypeName = value; }\r
-               }\r
-               \r
-               [XmlAttribute("url")]\r
-               public string Url {\r
-                       get { return url; }\r
-                       set { url = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-       }\r
+
+
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryClientResult {
+       
+               #region Fields
+
+               private string filename;
+               private string referenceTypeName;
+               private string url;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public DiscoveryClientResult () 
+               {
+               }
+               
+               public DiscoveryClientResult (Type referenceType, string url, string filename) : this() 
+               {
+                       this.filename = filename;
+                       this.url = url;
+                       this.referenceTypeName = referenceType.FullName;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties      
+       
+               [XmlAttribute("filename")]
+               public string Filename {
+                       get { return filename; }
+                       set { filename = value; }
+               }
+               
+               [XmlAttribute("referenceType")]
+               public string ReferenceTypeName {
+                       get { return referenceTypeName; }
+                       set { referenceTypeName = value; }
+               }
+               
+               [XmlAttribute("url")]
+               public string Url {
+                       get { return url; }
+                       set { url = value; }
+               }
+               
+               #endregion // Properties
+       }
 }
index d48f6368047957d2a61e5446527f039ba75ff57b..4a92f0d4c13caf983d765890703d6710310c4268 100644 (file)
@@ -1,13 +1,13 @@
-// \r
-// System.Web.Services.Protocols.DiscoveryClientResultCollection.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.DiscoveryClientResultCollection.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Dave Bettin, 2002
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryClientResultCollection : CollectionBase {\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryClientResultCollection () \r
-                       : base ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public DiscoveryClientResult this [int i] {\r
-                       get { \r
-                               if (i < 0 || i >= Count)\r
-                                       throw new ArgumentOutOfRangeException (); \r
-                               return (DiscoveryClientResult) InnerList [i]; \r
-                       }       \r
-                       set { \r
-                               if (i < 0 || i >= Count)\r
-                                       throw new ArgumentOutOfRangeException (); \r
-                               InnerList [i] = value; \r
-                       }\r
-               }                               \r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (DiscoveryClientResult value)\r
-               {\r
-                       return InnerList.Add (value);\r
-               }\r
-\r
-               public bool Contains (DiscoveryClientResult value)\r
-               {\r
-                       return InnerList.Contains (value);\r
-               }\r
-               \r
-               public void Remove (DiscoveryClientResult value)\r
-               {\r
-                       InnerList.Remove (value);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryClientResultCollection : CollectionBase {
+
+               #region Constructors
+
+               public DiscoveryClientResultCollection () 
+                       : base ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public DiscoveryClientResult this [int i] {
+                       get { 
+                               if (i < 0 || i >= Count)
+                                       throw new ArgumentOutOfRangeException (); 
+                               return (DiscoveryClientResult) InnerList [i]; 
+                       }       
+                       set { 
+                               if (i < 0 || i >= Count)
+                                       throw new ArgumentOutOfRangeException (); 
+                               InnerList [i] = value; 
+                       }
+               }                               
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (DiscoveryClientResult value)
+               {
+                       return InnerList.Add (value);
+               }
+
+               public bool Contains (DiscoveryClientResult value)
+               {
+                       return InnerList.Contains (value);
+               }
+               
+               public void Remove (DiscoveryClientResult value)
+               {
+                       InnerList.Remove (value);
+               }
+
+               #endregion // Methods
+       }
+}
index 6e54d1eb6fdc498ece882b3a7de0fddb123bf503..0d0de87a952280e913d3632b6b65174eb2aba3a3 100644 (file)
@@ -1,14 +1,14 @@
-// \r
-// System.Web.Services.Protocols.DiscoveryDocument.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Tim Coleman (tim@timcoleman.com)  \r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.DiscoveryDocument.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Tim Coleman (tim@timcoleman.com)  
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-using System.IO;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       [XmlRoot ("discovery", Namespace = "http://schemas.xmlsoap.org/disco/")]\r
-       public sealed class DiscoveryDocument {\r
-\r
-               #region Fields\r
-               \r
-               public const string Namespace = "http://schemas.xmlsoap.org/disco/";\r
-               \r
-               [XmlElement(typeof(ContractReference), Namespace="http://schemas.xmlsoap.org/disco/scl/")]\r
-               [XmlElement(typeof(DiscoveryDocumentReference))]\r
-               [XmlElement(typeof(SchemaReference))]\r
-               internal ArrayList references = new ArrayList();\r
-               \r
-               [XmlElement(typeof(SoapBinding), ElementName="soap", Namespace="http://schemas/xmlsoap.org/disco/schema/soap/")]\r
-               internal ArrayList additionalInfo = new ArrayList();\r
-               \r
-               #endregion // Fields\r
-               \r
-               #region Constructors\r
-\r
-               public DiscoveryDocument () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-       \r
-               [XmlIgnore]\r
-               public IList References {\r
-                       get { return references; }\r
-               }\r
-               \r
-               [XmlIgnore]\r
-               internal IList AdditionalInfo {\r
-                       get { return additionalInfo; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public static bool CanRead (XmlReader xmlReader)\r
-               {\r
-                       xmlReader.MoveToContent ();\r
-                       return xmlReader.NodeType == XmlNodeType.Element &&\r
-                                       xmlReader.LocalName == "discovery" && \r
-                                       xmlReader.NamespaceURI == Namespace;\r
-               }\r
-\r
-               public static DiscoveryDocument Read (Stream stream)\r
-               {\r
-                       return Read (new XmlTextReader (stream));\r
-               }\r
-               \r
-               public static DiscoveryDocument Read (TextReader textReader)\r
-               {\r
-                       return Read (new XmlTextReader (textReader));\r
-               }\r
-               \r
-               public static DiscoveryDocument Read (XmlReader xmlReader)\r
-               {\r
-                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();\r
-                       return (DiscoveryDocument) ser.Deserialize (xmlReader);\r
-               }\r
-               \r
-               public void Write (Stream stream)\r
-               {\r
-                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();\r
-                       ser.Serialize (stream, this, GetNamespaceList());\r
-               }\r
-               \r
-               public void Write (TextWriter textWriter)\r
-               {\r
-                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();\r
-                       ser.Serialize (textWriter, this, GetNamespaceList());\r
-               }\r
-               \r
-               public void Write (XmlWriter xmlWriter)\r
-               {\r
-                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();\r
-                       ser.Serialize (xmlWriter, this, GetNamespaceList());\r
-               }\r
-\r
-               XmlSerializerNamespaces GetNamespaceList ()\r
-               {\r
-                       XmlSerializerNamespaces ns = new XmlSerializerNamespaces ();\r
-                       ns.Add ("scl", ContractReference.Namespace);\r
-                       return ns;\r
-               }\r
-               \r
-               #endregion // Methods\r
-       }\r
-\r
-       internal class DiscoveryDocumentSerializer : XmlSerializer \r
-       {\r
-               protected override void Serialize (object o, XmlSerializationWriter writer)\r
-               {\r
-                       DiscoveryDocumentWriter xsWriter = writer as DiscoveryDocumentWriter;\r
-                       xsWriter.WriteRoot_DiscoveryDocument (o);\r
-               }\r
-               \r
-               protected override object Deserialize (XmlSerializationReader reader)\r
-               {\r
-                       DiscoveryDocumentReader xsReader = reader as DiscoveryDocumentReader;\r
-                       return xsReader.ReadRoot_DiscoveryDocument ();\r
-               }\r
-               \r
-               protected override XmlSerializationWriter CreateWriter ()\r
-               {\r
-                       return new DiscoveryDocumentWriter ();\r
-               }\r
-               \r
-               protected override XmlSerializationReader CreateReader ()\r
-               {\r
-                       return new DiscoveryDocumentReader ();\r
-               }\r
-       }       \r
+
+using System.Collections;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+       [XmlRoot ("discovery", Namespace = "http://schemas.xmlsoap.org/disco/")]
+       public sealed class DiscoveryDocument {
+
+               #region Fields
+               
+               public const string Namespace = "http://schemas.xmlsoap.org/disco/";
+               
+               [XmlElement(typeof(ContractReference), Namespace="http://schemas.xmlsoap.org/disco/scl/")]
+               [XmlElement(typeof(DiscoveryDocumentReference))]
+               [XmlElement(typeof(SchemaReference))]
+               internal ArrayList references = new ArrayList();
+               
+               [XmlElement(typeof(SoapBinding), ElementName="soap", Namespace="http://schemas/xmlsoap.org/disco/schema/soap/")]
+               internal ArrayList additionalInfo = new ArrayList();
+               
+               #endregion // Fields
+               
+               #region Constructors
+
+               public DiscoveryDocument () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+       
+               [XmlIgnore]
+               public IList References {
+                       get { return references; }
+               }
+               
+               [XmlIgnore]
+               internal IList AdditionalInfo {
+                       get { return additionalInfo; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public static bool CanRead (XmlReader xmlReader)
+               {
+                       xmlReader.MoveToContent ();
+                       return xmlReader.NodeType == XmlNodeType.Element &&
+                                       xmlReader.LocalName == "discovery" && 
+                                       xmlReader.NamespaceURI == Namespace;
+               }
+
+               public static DiscoveryDocument Read (Stream stream)
+               {
+                       return Read (new XmlTextReader (stream));
+               }
+               
+               public static DiscoveryDocument Read (TextReader textReader)
+               {
+                       return Read (new XmlTextReader (textReader));
+               }
+               
+               public static DiscoveryDocument Read (XmlReader xmlReader)
+               {
+                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();
+                       return (DiscoveryDocument) ser.Deserialize (xmlReader);
+               }
+               
+               public void Write (Stream stream)
+               {
+                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();
+                       ser.Serialize (stream, this, GetNamespaceList());
+               }
+               
+               public void Write (TextWriter textWriter)
+               {
+                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();
+                       ser.Serialize (textWriter, this, GetNamespaceList());
+               }
+               
+               public void Write (XmlWriter xmlWriter)
+               {
+                       DiscoveryDocumentSerializer ser = new DiscoveryDocumentSerializer();
+                       ser.Serialize (xmlWriter, this, GetNamespaceList());
+               }
+
+               XmlSerializerNamespaces GetNamespaceList ()
+               {
+                       XmlSerializerNamespaces ns = new XmlSerializerNamespaces ();
+                       ns.Add ("scl", ContractReference.Namespace);
+                       return ns;
+               }
+               
+               #endregion // Methods
+       }
+
+       internal class DiscoveryDocumentSerializer : XmlSerializer 
+       {
+               protected override void Serialize (object o, XmlSerializationWriter writer)
+               {
+                       DiscoveryDocumentWriter xsWriter = writer as DiscoveryDocumentWriter;
+                       xsWriter.WriteRoot_DiscoveryDocument (o);
+               }
+               
+               protected override object Deserialize (XmlSerializationReader reader)
+               {
+                       DiscoveryDocumentReader xsReader = reader as DiscoveryDocumentReader;
+                       return xsReader.ReadRoot_DiscoveryDocument ();
+               }
+               
+               protected override XmlSerializationWriter CreateWriter ()
+               {
+                       return new DiscoveryDocumentWriter ();
+               }
+               
+               protected override XmlSerializationReader CreateReader ()
+               {
+                       return new DiscoveryDocumentReader ();
+               }
+       }       
 }
index 59208e1e31ee87ba20397604881b259888190043..519e16edbe950ff2525e5854fd5490380544a7ad 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.DiscoveryDocumentLinksPattern.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.DiscoveryDocumentLinksPattern.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Discovery {\r
-       public class DiscoveryDocumentLinksPattern : DiscoverySearchPattern {\r
-               \r
-               #region Fields\r
-               \r
-               private string pattern = "*.disco";\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryDocumentLinksPattern () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override string Pattern {\r
-                       get { return pattern; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override DiscoveryReference GetDiscoveryReference (string filename)\r
-               {\r
-                       DiscoveryDocumentReference refe = new DiscoveryDocumentReference ();\r
-                       refe.Url = filename;\r
-                       refe.Ref = filename;\r
-                       return refe;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Discovery {
+       public class DiscoveryDocumentLinksPattern : DiscoverySearchPattern {
+               
+               #region Fields
+               
+               private string pattern = "*.disco";
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public DiscoveryDocumentLinksPattern () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public override string Pattern {
+                       get { return pattern; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public override DiscoveryReference GetDiscoveryReference (string filename)
+               {
+                       DiscoveryDocumentReference refe = new DiscoveryDocumentReference ();
+                       refe.Url = filename;
+                       refe.Ref = filename;
+                       return refe;
+               }
+
+               #endregion // Methods
+       }
+}
index 599e7d4eaef53cacfcddceebe2490fdd436f8c0c..e6a658a01de39222f6f0b0abda318b791694b0d1 100644 (file)
@@ -1,14 +1,14 @@
-// \r
-// System.Web.Services.Discovery.DiscoveryDocumentReference.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DiscoveryDocumentReference.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Web.Services.Description;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-\r
-       [XmlRootAttribute("discoveryRef", Namespace="http://schemas.xmlsoap.org/disco/", IsNullable=true)]\r
-       public sealed class DiscoveryDocumentReference : DiscoveryReference {\r
-               \r
-               #region Fields\r
-               \r
-               private DiscoveryDocument document;\r
-               private string defaultFilename;\r
-               private string href;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryDocumentReference () \r
-               {\r
-                       href = String.Empty;\r
-               }\r
-               \r
-               public DiscoveryDocumentReference (string href)\r
-               {\r
-                       this.href = href;\r
-               }               \r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-               \r
-               [XmlIgnore]\r
-               public DiscoveryDocument Document {\r
-                       get {\r
-                               if (ClientProtocol == null) \r
-                                       throw new InvalidOperationException ("The ClientProtocol property is a null reference");\r
-                               \r
-                               DiscoveryDocument doc = ClientProtocol.Documents [Url] as DiscoveryDocument;\r
-                               if (doc == null)\r
-                                       throw new Exception ("The Documents property of ClientProtocol does not contain a discovery document with the url " + Url);\r
-                                       \r
-                               return doc; \r
-                       }\r
-               }\r
-               \r
-               [XmlIgnore]\r
-               public override string DefaultFilename {\r
-                       get { return FilenameFromUrl (Url) + ".disco"; }\r
-               }\r
-               \r
-               [XmlAttribute("ref")]\r
-               public string Ref {\r
-                       get { return href; }\r
-                       set { href = value; }\r
-               }\r
-               \r
-               [XmlIgnore]\r
-               public override string Url {\r
-                       get { return href; }\r
-                       set { href = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override object ReadDocument (Stream stream)\r
-               {\r
-                       return DiscoveryDocument.Read (stream);\r
-               }\r
-                \r
-               protected internal override void Resolve (string contentType, Stream stream) \r
-               {\r
-                       DiscoveryDocument doc = DiscoveryDocument.Read (stream);\r
-                       ClientProtocol.Documents.Add (Url, doc);\r
-                       if (!ClientProtocol.References.Contains (Url))\r
-                               ClientProtocol.References.Add (this);\r
-                               \r
-                       foreach (DiscoveryReference re in doc.References)\r
-                       {\r
-                               re.ClientProtocol = ClientProtocol;\r
-                               ClientProtocol.References.Add (re.Url, re);\r
-                       }\r
-               }\r
-\r
-               public void ResolveAll () \r
-               {\r
-                       if (ClientProtocol.Documents.Contains (Url))    // Already resolved\r
-                               return;\r
-                               \r
-                       Resolve ();\r
-                       DiscoveryDocument doc = document;\r
-                       foreach (DiscoveryReference re in doc.References)\r
-                       {\r
-                               try\r
-                               {\r
-                                       if (re is DiscoveryDocumentReference)\r
-                                               ((DiscoveryDocumentReference)re).ResolveAll ();\r
-                                       else\r
-                                               re.Resolve ();\r
-                               }\r
-                               catch (Exception ex)\r
-                               {\r
-                                       ReportError (re.Url, ex);\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               public override void WriteDocument (object document, Stream stream) \r
-               {\r
-                       ((DiscoveryDocument)document).Write (stream);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.IO;
+using System.Web.Services.Description;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+
+       [XmlRootAttribute("discoveryRef", Namespace="http://schemas.xmlsoap.org/disco/", IsNullable=true)]
+       public sealed class DiscoveryDocumentReference : DiscoveryReference {
+               
+               #region Fields
+               
+               private DiscoveryDocument document;
+               private string defaultFilename;
+               private string href;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public DiscoveryDocumentReference () 
+               {
+                       href = String.Empty;
+               }
+               
+               public DiscoveryDocumentReference (string href)
+               {
+                       this.href = href;
+               }               
+               
+               #endregion // Constructors
+
+               #region Properties
+               
+               [XmlIgnore]
+               public DiscoveryDocument Document {
+                       get {
+                               if (ClientProtocol == null) 
+                                       throw new InvalidOperationException ("The ClientProtocol property is a null reference");
+                               
+                               DiscoveryDocument doc = ClientProtocol.Documents [Url] as DiscoveryDocument;
+                               if (doc == null)
+                                       throw new Exception ("The Documents property of ClientProtocol does not contain a discovery document with the url " + Url);
+                                       
+                               return doc; 
+                       }
+               }
+               
+               [XmlIgnore]
+               public override string DefaultFilename {
+                       get { return FilenameFromUrl (Url) + ".disco"; }
+               }
+               
+               [XmlAttribute("ref")]
+               public string Ref {
+                       get { return href; }
+                       set { href = value; }
+               }
+               
+               [XmlIgnore]
+               public override string Url {
+                       get { return href; }
+                       set { href = value; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public override object ReadDocument (Stream stream)
+               {
+                       return DiscoveryDocument.Read (stream);
+               }
+                
+               protected internal override void Resolve (string contentType, Stream stream) 
+               {
+                       DiscoveryDocument doc = DiscoveryDocument.Read (stream);
+                       ClientProtocol.Documents.Add (Url, doc);
+                       if (!ClientProtocol.References.Contains (Url))
+                               ClientProtocol.References.Add (this);
+                               
+                       foreach (DiscoveryReference re in doc.References)
+                       {
+                               re.ClientProtocol = ClientProtocol;
+                               ClientProtocol.References.Add (re.Url, re);
+                       }
+               }
+
+               public void ResolveAll () 
+               {
+                       if (ClientProtocol.Documents.Contains (Url))    // Already resolved
+                               return;
+                               
+                       Resolve ();
+                       DiscoveryDocument doc = document;
+                       foreach (DiscoveryReference re in doc.References)
+                       {
+                               try
+                               {
+                                       if (re is DiscoveryDocumentReference)
+                                               ((DiscoveryDocumentReference)re).ResolveAll ();
+                                       else
+                                               re.Resolve ();
+                               }
+                               catch (Exception ex)
+                               {
+                                       ReportError (re.Url, ex);
+                               }
+                       }
+               }
+               
+               public override void WriteDocument (object document, Stream stream) 
+               {
+                       ((DiscoveryDocument)document).Write (stream);
+               }
+
+               #endregion // Methods
+       }
 }
index 697682d8b313664a3e45ec24a327fed9508d7b1d..7bfc044354baa8fde2305fdc2f9c827206e7ea05 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Discovery.DiscoveryDocumentSearchPattern.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DiscoveryDocumentSearchPattern.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryDocumentSearchPattern : DiscoverySearchPattern {\r
-               \r
-               #region Fields\r
-\r
-               private string pattern = "*.vsdisco";\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryDocumentSearchPattern () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override string Pattern {\r
-                       get { return pattern; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override DiscoveryReference GetDiscoveryReference (string filename)\r
-               {\r
-                       DiscoveryDocumentReference refe = new DiscoveryDocumentReference ();\r
-                       refe.Url = filename;\r
-                       refe.Ref = filename;\r
-                       return refe;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryDocumentSearchPattern : DiscoverySearchPattern {
+               
+               #region Fields
+
+               private string pattern = "*.vsdisco";
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public DiscoveryDocumentSearchPattern () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public override string Pattern {
+                       get { return pattern; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public override DiscoveryReference GetDiscoveryReference (string filename)
+               {
+                       DiscoveryDocumentReference refe = new DiscoveryDocumentReference ();
+                       refe.Url = filename;
+                       refe.Ref = filename;
+                       return refe;
+               }
+
+               #endregion // Methods
+       }
+}
index 198b2effe556aa7e71ab4833f094f6d85f99a4f4..1810867f2258dd8d58cac95c078977dbccd090bb 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.DiscoveryExceptionDictionary.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.DiscoveryExceptionDictionary.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Discovery \r
-{\r
-       public sealed class DiscoveryExceptionDictionary : DictionaryBase \r
-       {\r
-               #region Constructors\r
-\r
-               public DiscoveryExceptionDictionary () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public Exception this[string url] {\r
-                       get { return (Exception) InnerHashtable [url]; }\r
-                       set { \r
-                               if (url == null)\r
-                                       throw new ArgumentNullException ();\r
-                               InnerHashtable [url] = value; \r
-                       }\r
-               }\r
-               \r
-               public ICollection Keys {\r
-                       get { return InnerHashtable.Keys; }\r
-               }\r
-               \r
-               public ICollection Values {\r
-                       get { return InnerHashtable.Values; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void Add (string url, Exception value)\r
-               {\r
-                       InnerHashtable.Add (url, value);\r
-               }\r
-\r
-               public bool Contains (string url)\r
-               {\r
-                       return InnerHashtable.Contains (url);\r
-               }\r
-               \r
-               public void Remove (string url)\r
-               {\r
-                       InnerHashtable.Remove (url);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Collections;
+
+namespace System.Web.Services.Discovery 
+{
+       public sealed class DiscoveryExceptionDictionary : DictionaryBase 
+       {
+               #region Constructors
+
+               public DiscoveryExceptionDictionary () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public Exception this[string url] {
+                       get { return (Exception) InnerHashtable [url]; }
+                       set { 
+                               if (url == null)
+                                       throw new ArgumentNullException ();
+                               InnerHashtable [url] = value; 
+                       }
+               }
+               
+               public ICollection Keys {
+                       get { return InnerHashtable.Keys; }
+               }
+               
+               public ICollection Values {
+                       get { return InnerHashtable.Values; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public void Add (string url, Exception value)
+               {
+                       InnerHashtable.Add (url, value);
+               }
+
+               public bool Contains (string url)
+               {
+                       return InnerHashtable.Contains (url);
+               }
+               
+               public void Remove (string url)
+               {
+                       InnerHashtable.Remove (url);
+               }
+
+               #endregion // Methods
+       }
 }
index b99b5871e81b504244ac1c31b01696e98190a92a..9157898ba134a13e527ec71a309317cadc244044 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Discovery.DiscoveryReference.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DiscoveryReference.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public abstract class DiscoveryReference {\r
-               \r
-               #region Fields\r
-\r
-               private string defaultFilename;\r
-               private DiscoveryClientProtocol clientProtocol;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               protected DiscoveryReference () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public DiscoveryClientProtocol ClientProtocol {\r
-                       get { return clientProtocol; }                  \r
-                       set { clientProtocol = value; }\r
-                       \r
-               }\r
-               \r
-               [XmlIgnore]\r
-               public virtual string DefaultFilename {\r
-                       get { return FilenameFromUrl (Url); }                   \r
-               }\r
-               \r
-               [XmlIgnore]\r
-               public abstract string Url {\r
-                       get;            \r
-                       set;\r
-               }\r
-               \r
-               internal Uri BaseUri \r
-               {\r
-                       get\r
-                       {\r
-                               int i = Url.IndexOf ("://");\r
-                               if (i == -1 || !Uri.CheckSchemeName (Url.Substring (0,i)))\r
-                                       return new Uri ("file://" + Url);\r
-                               else\r
-                                       return new Uri (Url);\r
-                       }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public static string FilenameFromUrl (string url)\r
-               {\r
-                       if (url.ToLower().EndsWith ("/wsdl"))\r
-                               url = url.Substring (0,url.Length-5);\r
-                       else if (url.ToLower().EndsWith ("/soap"))\r
-                               url = url.Substring (0,url.Length-5);\r
-                       else if (url.ToLower().EndsWith ("/wsdl.jsp"))\r
-                               url = url.Substring (0,url.Length-9);\r
-                       else if (url.ToLower().EndsWith ("/soap.wsdl"))\r
-                               url = url.Substring (0,url.Length-10);\r
-                       \r
-                       int i = url.LastIndexOf ("/");\r
-                       if (i != -1) url = url.Substring (i+1);\r
-                       \r
-                       i = url.IndexOfAny (new char[] {'.','?','\\'});\r
-                       if (i != -1) url = url.Substring (0,i);\r
-                       \r
-                       System.Text.StringBuilder sb = new System.Text.StringBuilder ();\r
-                       for (int n=0; n<url.Length; n++)\r
-                               if (Char.IsLetterOrDigit (url[n]) || url[n] == '_') sb.Append (url[n]);\r
-                               \r
-                       return sb.ToString ();\r
-               }\r
-               \r
-               public abstract object ReadDocument (Stream stream);\r
-               \r
-               public void Resolve () \r
-               {\r
-                       if (clientProtocol == null) \r
-                               throw new InvalidOperationException ("The ClientProtocol property is a null reference.");\r
-                       \r
-                       if (clientProtocol.Documents.Contains (Url))    // Already resolved\r
-                               return;\r
-                       \r
-                       try\r
-                       {\r
-                               string contentType = null;\r
-                               string url = Url;\r
-                               Stream stream = clientProtocol.Download (ref url, ref contentType);\r
-                               Resolve (contentType, stream);\r
-                       }\r
-                       catch (Exception ex)\r
-                       {\r
-                               ReportError (Url, ex);\r
-                       }\r
-               }\r
-                \r
-               protected internal abstract void Resolve (string contentType, Stream stream);\r
-               \r
-               public abstract void WriteDocument (object document, Stream stream);\r
-\r
-               internal void ReportError (string url, Exception ex)\r
-               {\r
-                       if (ex is DiscoveryException) throw ex;\r
-                       else throw new DiscoveryException (url, ex);\r
-               }\r
-               \r
-               #endregion // Methods\r
-       }\r
+
+using System.IO;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+       public abstract class DiscoveryReference {
+               
+               #region Fields
+
+               private string defaultFilename;
+               private DiscoveryClientProtocol clientProtocol;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               protected DiscoveryReference () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public DiscoveryClientProtocol ClientProtocol {
+                       get { return clientProtocol; }                  
+                       set { clientProtocol = value; }
+                       
+               }
+               
+               [XmlIgnore]
+               public virtual string DefaultFilename {
+                       get { return FilenameFromUrl (Url); }                   
+               }
+               
+               [XmlIgnore]
+               public abstract string Url {
+                       get;            
+                       set;
+               }
+               
+               internal Uri BaseUri 
+               {
+                       get
+                       {
+                               int i = Url.IndexOf ("://");
+                               if (i == -1 || !Uri.CheckSchemeName (Url.Substring (0,i)))
+                                       return new Uri ("file://" + Url);
+                               else
+                                       return new Uri (Url);
+                       }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public static string FilenameFromUrl (string url)
+               {
+                       if (url.ToLower().EndsWith ("/wsdl"))
+                               url = url.Substring (0,url.Length-5);
+                       else if (url.ToLower().EndsWith ("/soap"))
+                               url = url.Substring (0,url.Length-5);
+                       else if (url.ToLower().EndsWith ("/wsdl.jsp"))
+                               url = url.Substring (0,url.Length-9);
+                       else if (url.ToLower().EndsWith ("/soap.wsdl"))
+                               url = url.Substring (0,url.Length-10);
+                       
+                       int i = url.LastIndexOf ("/");
+                       if (i != -1) url = url.Substring (i+1);
+                       
+                       i = url.IndexOfAny (new char[] {'.','?','\\'});
+                       if (i != -1) url = url.Substring (0,i);
+                       
+                       System.Text.StringBuilder sb = new System.Text.StringBuilder ();
+                       for (int n=0; n<url.Length; n++)
+                               if (Char.IsLetterOrDigit (url[n]) || url[n] == '_') sb.Append (url[n]);
+                               
+                       return sb.ToString ();
+               }
+               
+               public abstract object ReadDocument (Stream stream);
+               
+               public void Resolve () 
+               {
+                       if (clientProtocol == null) 
+                               throw new InvalidOperationException ("The ClientProtocol property is a null reference.");
+                       
+                       if (clientProtocol.Documents.Contains (Url))    // Already resolved
+                               return;
+                       
+                       try
+                       {
+                               string contentType = null;
+                               string url = Url;
+                               Stream stream = clientProtocol.Download (ref url, ref contentType);
+                               Resolve (contentType, stream);
+                       }
+                       catch (Exception ex)
+                       {
+                               ReportError (Url, ex);
+                       }
+               }
+                
+               protected internal abstract void Resolve (string contentType, Stream stream);
+               
+               public abstract void WriteDocument (object document, Stream stream);
+
+               internal void ReportError (string url, Exception ex)
+               {
+                       if (ex is DiscoveryException) throw ex;
+                       else throw new DiscoveryException (url, ex);
+               }
+               
+               #endregion // Methods
+       }
 }
index 36cc203940962320909d8334fcff5575b4326fa7..21cf4ce9e308239a6ec2c5bc926fc46cbc5da90b 100644 (file)
@@ -1,13 +1,13 @@
-// \r
-// System.Web.Services.Protocols.DiscoveryReferenceCollection.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.DiscoveryReferenceCollection.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Dave Bettin, 2002
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryReferenceCollection : CollectionBase {\r
-\r
-               #region Constructors\r
-\r
-               public DiscoveryReferenceCollection () \r
-                       : base ()\r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public DiscoveryReference this [int i] {\r
-                       get { \r
-                               if (i < 0 || i >= Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               return (DiscoveryReference) InnerList [i]; \r
-                       }\r
-                       set {\r
-                               if (i < 0 || i >= Count)\r
-                                       throw new ArgumentOutOfRangeException ();\r
-                               InnerList [i] = value;\r
-                       }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (DiscoveryReference value)\r
-               {\r
-                       return InnerList.Add (value);\r
-               }\r
-\r
-               public bool Contains (DiscoveryReference value)\r
-               {\r
-                       return InnerList.Contains (value);\r
-               }\r
-               \r
-               public void Remove (DiscoveryReference value)\r
-               {\r
-                       InnerList.Remove (value);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryReferenceCollection : CollectionBase {
+
+               #region Constructors
+
+               public DiscoveryReferenceCollection () 
+                       : base ()
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public DiscoveryReference this [int i] {
+                       get { 
+                               if (i < 0 || i >= Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               return (DiscoveryReference) InnerList [i]; 
+                       }
+                       set {
+                               if (i < 0 || i >= Count)
+                                       throw new ArgumentOutOfRangeException ();
+                               InnerList [i] = value;
+                       }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (DiscoveryReference value)
+               {
+                       return InnerList.Add (value);
+               }
+
+               public bool Contains (DiscoveryReference value)
+               {
+                       return InnerList.Contains (value);
+               }
+               
+               public void Remove (DiscoveryReference value)
+               {
+                       InnerList.Remove (value);
+               }
+
+               #endregion // Methods
+       }
+}
index 394bf7f5a91d8467999a053a24dc3a19029696c8..99be0d75567837b10e92acec8d8aa43898ddfab8 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Discovery.DiscoveryRequestHandler.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DiscoveryRequestHandler.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web;\r
-using System.IO;\r
-using System.Web.Services.Discovery;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class DiscoveryRequestHandler : IHttpHandler {\r
-               \r
-               #region Constructors\r
-\r
-               public DiscoveryRequestHandler () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public bool IsReusable {\r
-                       get { return true; }                    \r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void ProcessRequest (HttpContext context)\r
-               {\r
-                       string path = context.Request.PhysicalPath;\r
-                       FileStream fs = new FileStream (path, FileMode.Open);\r
-                       DynamicDiscoveryDocument ddoc = DynamicDiscoveryDocument.Load (fs);\r
-                       fs.Close ();\r
-                       \r
-                       string url = context.Request.Url.ToString();\r
-                       int i = url.LastIndexOf ('/');\r
-                       if (i != -1) url = url.Substring (0,i+1);\r
-                       \r
-                       DiscoveryDocument doc = new DiscoveryDocument ();\r
-                       GetFiles (url, "", Path.GetDirectoryName(path), doc, ddoc);\r
-                       \r
-                       context.Response.ContentType = "text/xml; charset=utf-8";\r
-                       doc.Write (context.Response.OutputStream);\r
-               }\r
-               \r
-               void GetFiles (string baseUrl, string relPath, string path, DiscoveryDocument doc, DynamicDiscoveryDocument ddoc)\r
-               {\r
-                       string url = baseUrl + relPath;\r
-                       if (!url.EndsWith ("/")) url += "/";\r
-                       \r
-                       string[] files = Directory.GetFiles (path);\r
-                       foreach (string file in files)\r
-                       {\r
-                               string ext = Path.GetExtension (file).ToLower();\r
-                               if (ext == ".asmx")\r
-                               {\r
-                                       ContractReference cref = new ContractReference ();\r
-                                       cref.DocRef = url + Path.GetFileName (file);\r
-                                       cref.Ref = cref.DocRef + "?wsdl";\r
-                                       doc.References.Add (cref);\r
-                               }\r
-                               else if (ext == ".disco")\r
-                               {\r
-                                       DiscoveryDocumentReference dref = new DiscoveryDocumentReference ();\r
-                                       dref.Ref = url + Path.GetFileName (file);\r
-                                       doc.References.Add (dref);\r
-                               }\r
-                       }\r
-                       string[] dirs = Directory.GetDirectories (path);\r
-                       \r
-                       foreach (string dir in dirs)\r
-                       {\r
-                               string rel = Path.Combine (relPath, Path.GetFileName(dir));\r
-                               if (!ddoc.IsExcluded (rel))\r
-                                       GetFiles (baseUrl, rel, Path.Combine (path, dir), doc, ddoc);\r
-                       }\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Web;
+using System.IO;
+using System.Web.Services.Discovery;
+
+namespace System.Web.Services.Discovery {
+       public sealed class DiscoveryRequestHandler : IHttpHandler {
+               
+               #region Constructors
+
+               public DiscoveryRequestHandler () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public bool IsReusable {
+                       get { return true; }                    
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public void ProcessRequest (HttpContext context)
+               {
+                       string path = context.Request.PhysicalPath;
+                       FileStream fs = new FileStream (path, FileMode.Open);
+                       DynamicDiscoveryDocument ddoc = DynamicDiscoveryDocument.Load (fs);
+                       fs.Close ();
+                       
+                       string url = context.Request.Url.ToString();
+                       int i = url.LastIndexOf ('/');
+                       if (i != -1) url = url.Substring (0,i+1);
+                       
+                       DiscoveryDocument doc = new DiscoveryDocument ();
+                       GetFiles (url, "", Path.GetDirectoryName(path), doc, ddoc);
+                       
+                       context.Response.ContentType = "text/xml; charset=utf-8";
+                       doc.Write (context.Response.OutputStream);
+               }
+               
+               void GetFiles (string baseUrl, string relPath, string path, DiscoveryDocument doc, DynamicDiscoveryDocument ddoc)
+               {
+                       string url = baseUrl + relPath;
+                       if (!url.EndsWith ("/")) url += "/";
+                       
+                       string[] files = Directory.GetFiles (path);
+                       foreach (string file in files)
+                       {
+                               string ext = Path.GetExtension (file).ToLower();
+                               if (ext == ".asmx")
+                               {
+                                       ContractReference cref = new ContractReference ();
+                                       cref.DocRef = url + Path.GetFileName (file);
+                                       cref.Ref = cref.DocRef + "?wsdl";
+                                       doc.References.Add (cref);
+                               }
+                               else if (ext == ".disco")
+                               {
+                                       DiscoveryDocumentReference dref = new DiscoveryDocumentReference ();
+                                       dref.Ref = url + Path.GetFileName (file);
+                                       doc.References.Add (dref);
+                               }
+                       }
+                       string[] dirs = Directory.GetDirectories (path);
+                       
+                       foreach (string dir in dirs)
+                       {
+                               string rel = Path.Combine (relPath, Path.GetFileName(dir));
+                               if (!ddoc.IsExcluded (rel))
+                                       GetFiles (baseUrl, rel, Path.Combine (path, dir), doc, ddoc);
+                       }
+               }
+
+               #endregion // Methods
+       }
+}
index 9a101b0a7b48ffcf9aaf79cec35c90b257956aab..081cbcb306c0e0ee60bdfff14a34c7c00d6e56a5 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Discovery.DiscoverySearchPattern.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DiscoverySearchPattern.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Discovery {\r
-       public abstract class DiscoverySearchPattern {\r
-\r
-               #region Constructors\r
-\r
-               protected DiscoverySearchPattern () {}\r
-       \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public abstract string Pattern {\r
-                       get;\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public abstract DiscoveryReference GetDiscoveryReference (string filename);\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Discovery {
+       public abstract class DiscoverySearchPattern {
+
+               #region Constructors
+
+               protected DiscoverySearchPattern () {}
+       
+               #endregion // Constructors
+
+               #region Properties
+
+               public abstract string Pattern {
+                       get;
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public abstract DiscoveryReference GetDiscoveryReference (string filename);
+
+               #endregion // Methods
+       }
+}
index f61e53200f926d92b519b5b9dbf06c11a886b97f..423a3ae6d3cfb6b42c229212e2150a91b7a92faf 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Discovery.DynamicDiscoveryDocument.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.DynamicDiscoveryDocument.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-\r
-       [XmlRootAttribute("dynamicDiscovery", Namespace="urn:schemas-dynamicdiscovery:disco.2000-03-17", IsNullable=true)]\r
-       public sealed class DynamicDiscoveryDocument {\r
-\r
-               #region Fields\r
-               \r
-               public const string Namespace = "urn:schemas-dynamicdiscovery:disco.2000-03-17";\r
-               \r
-               ExcludePathInfo[] excludes;\r
-               \r
-               #endregion // Fields\r
-               \r
-               #region Constructors\r
-\r
-               public DynamicDiscoveryDocument () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-               \r
-               [XmlElement("exclude", typeof(ExcludePathInfo))]\r
-               public ExcludePathInfo[] ExcludePaths {\r
-                       get { return excludes; }\r
-                       set { excludes = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public static DynamicDiscoveryDocument Load (Stream stream)\r
-               {\r
-                       XmlSerializer ser = new XmlSerializer (typeof(DynamicDiscoveryDocument));\r
-                       return (DynamicDiscoveryDocument) ser.Deserialize (stream);\r
-               }\r
-\r
-               public void Write (Stream stream)\r
-               {\r
-                       XmlSerializer ser = new XmlSerializer (typeof(DynamicDiscoveryDocument));\r
-                       ser.Serialize (stream, this);\r
-               }\r
-               \r
-               internal bool IsExcluded (string path)\r
-               {\r
-                       if (excludes == null) return false;\r
-                       \r
-                       foreach (ExcludePathInfo ex in excludes)\r
-                               if (ex.Path == path) return true;\r
-                               \r
-                       return false;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.IO;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+
+       [XmlRootAttribute("dynamicDiscovery", Namespace="urn:schemas-dynamicdiscovery:disco.2000-03-17", IsNullable=true)]
+       public sealed class DynamicDiscoveryDocument {
+
+               #region Fields
+               
+               public const string Namespace = "urn:schemas-dynamicdiscovery:disco.2000-03-17";
+               
+               ExcludePathInfo[] excludes;
+               
+               #endregion // Fields
+               
+               #region Constructors
+
+               public DynamicDiscoveryDocument () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+               
+               [XmlElement("exclude", typeof(ExcludePathInfo))]
+               public ExcludePathInfo[] ExcludePaths {
+                       get { return excludes; }
+                       set { excludes = value; }
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public static DynamicDiscoveryDocument Load (Stream stream)
+               {
+                       XmlSerializer ser = new XmlSerializer (typeof(DynamicDiscoveryDocument));
+                       return (DynamicDiscoveryDocument) ser.Deserialize (stream);
+               }
+
+               public void Write (Stream stream)
+               {
+                       XmlSerializer ser = new XmlSerializer (typeof(DynamicDiscoveryDocument));
+                       ser.Serialize (stream, this);
+               }
+               
+               internal bool IsExcluded (string path)
+               {
+                       if (excludes == null) return false;
+                       
+                       foreach (ExcludePathInfo ex in excludes)
+                               if (ex.Path == path) return true;
+                               
+                       return false;
+               }
+
+               #endregion // Methods
+       }
+}
index d759682b8c0a15798ffcabf3825a6d2916d434ae..46be91b28c014a407e75e212f64895bcce82f9a5 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Discovery.ExcludePathInfo.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.ExcludePathInfo.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class ExcludePathInfo {\r
-               \r
-               #region Fields\r
-               \r
-               private string path;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public ExcludePathInfo () \r
-               {\r
-               }\r
-               \r
-               public ExcludePathInfo (string path)\r
-               {\r
-                       this.path = path;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-               \r
-               [XmlAttribute("path")]\r
-               public string Path {\r
-                       get { return path; }\r
-                       set { path = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+       public sealed class ExcludePathInfo {
+               
+               #region Fields
+               
+               private string path;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public ExcludePathInfo () 
+               {
+               }
+               
+               public ExcludePathInfo (string path)
+               {
+                       this.path = path;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+               
+               [XmlAttribute("path")]
+               public string Path {
+                       get { return path; }
+                       set { path = value; }
+               }
+               
+               #endregion // Properties
+       }
+}
index e5f2cabe8dc1e161d84a42af4ec7949e2af95f01..be9f56a630130daaf2c2781086c518cb90619660 100644 (file)
-// \r
-// System.Web.Services.Discovery.SchemaReference.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System.ComponentModel;\r
-using System.IO;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-\r
-       [XmlRootAttribute("schemaRef", Namespace="http://schemas.xmlsoap.org/disco/schema/", IsNullable=true)]\r
-       public sealed class SchemaReference : DiscoveryReference {\r
-\r
-               #region Fields\r
-               \r
-               public const string Namespace = "http://schemas.xmlsoap.org/disco/schema/";\r
-\r
-               private string defaultFilename;\r
-               private string href;\r
-               private string targetNamespace;\r
-               private XmlSchema schema;\r
-               \r
-               #endregion // Fields\r
-               \r
-               #region Constructors\r
-\r
-               public SchemaReference () \r
-               {\r
-               }\r
-               \r
-               public SchemaReference (string href) : this() \r
-               {\r
-                       this.href = href;\r
-               }               \r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public override string DefaultFilename {\r
-                       get { return FilenameFromUrl (Url) + ".xsd"; }\r
-               }\r
-               \r
-               [XmlAttribute("ref")]\r
-               public string Ref {\r
-                       get { return href; }\r
-                       set { href = value; }\r
-               }\r
-               \r
-               [XmlIgnore]\r
-               public override string Url {\r
-                       get { return href; }\r
-                       set { href = value; }\r
-               }\r
-               \r
-               [DefaultValue(null)]\r
-               [XmlAttribute("targetNamespace")]\r
-               public string TargetNamespace {\r
-                       get { return targetNamespace; }\r
-                       set { targetNamespace = value; }\r
-               }\r
-\r
-               [XmlIgnore]\r
-               public XmlSchema Schema {\r
-                       get { \r
-                               if (ClientProtocol == null) \r
-                                       throw new InvalidOperationException ("The ClientProtocol property is a null reference");\r
-                               \r
-                               XmlSchema doc = ClientProtocol.Documents [Url] as XmlSchema;\r
-                               if (doc == null)\r
-                                       throw new Exception ("The Documents property of ClientProtocol does not contain a schema with the url " + Url);\r
-                                       \r
-                               return doc; \r
-                       }\r
-                       \r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override object ReadDocument (Stream stream)\r
-               {\r
-                       return XmlSchema.Read (stream, null);\r
-               }\r
-                \r
-               protected internal override void Resolve (string contentType, Stream stream) \r
-               {\r
-                       XmlSchema doc = XmlSchema.Read (stream, null);\r
-                       ClientProtocol.Documents.Add (Url, doc);\r
-                       if (!ClientProtocol.References.Contains (Url))\r
-                               ClientProtocol.References.Add (this);\r
-               }\r
-                \r
-               internal void ResolveInternal (DiscoveryClientProtocol prot, XmlSchema xsd) \r
-               {\r
-                       if (xsd.Includes.Count == 0) return;\r
-                       \r
-                       foreach (XmlSchemaExternal ext in xsd.Includes)\r
-                       {\r
-                               if (ext.SchemaLocation == null)\r
-                                       continue;\r
-\r
-                               // Make relative uris to absoulte\r
-\r
-                               Uri uri = new Uri (BaseUri, ext.SchemaLocation);\r
-                               string url = uri.ToString ();\r
-\r
-                               if (prot.Documents.Contains (url))      // Already resolved\r
-                                       continue;\r
-\r
-                               try\r
-                               {\r
-                                       string contentType = null;\r
-                                       Stream stream = prot.Download (ref url, ref contentType);\r
-                                       XmlTextReader reader = new XmlTextReader (url, stream);\r
-                                       reader.XmlResolver = null;\r
-                                       reader.MoveToContent ();\r
-                                       \r
-                                       DiscoveryReference refe;\r
-                                       XmlSchema schema = XmlSchema.Read (reader, null);\r
-                                       refe = new SchemaReference ();\r
-                                       refe.ClientProtocol = prot;\r
-                                       refe.Url = url;\r
-                                       prot.Documents.Add (url, schema);\r
-                                       ((SchemaReference)refe).ResolveInternal (prot, schema);\r
-                                       \r
-                                       if (!prot.References.Contains (url))\r
-                                               prot.References.Add (refe);\r
-                                               \r
-                                       stream.Close ();\r
-                               }\r
-                               catch (Exception ex)\r
-                               {\r
-                                       ReportError (url, ex);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public override void WriteDocument (object document, Stream stream) \r
-               {\r
-                       ((XmlSchema)document).Write (stream);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+// 
+// System.Web.Services.Discovery.SchemaReference.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System.ComponentModel;
+using System.IO;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+
+       [XmlRootAttribute("schemaRef", Namespace="http://schemas.xmlsoap.org/disco/schema/", IsNullable=true)]
+       public sealed class SchemaReference : DiscoveryReference {
+
+               #region Fields
+               
+               public const string Namespace = "http://schemas.xmlsoap.org/disco/schema/";
+
+               private string defaultFilename;
+               private string href;
+               private string targetNamespace;
+               private XmlSchema schema;
+               
+               #endregion // Fields
+               
+               #region Constructors
+
+               public SchemaReference () 
+               {
+               }
+               
+               public SchemaReference (string href) : this() 
+               {
+                       this.href = href;
+               }               
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public override string DefaultFilename {
+                       get { return FilenameFromUrl (Url) + ".xsd"; }
+               }
+               
+               [XmlAttribute("ref")]
+               public string Ref {
+                       get { return href; }
+                       set { href = value; }
+               }
+               
+               [XmlIgnore]
+               public override string Url {
+                       get { return href; }
+                       set { href = value; }
+               }
+               
+               [DefaultValue(null)]
+               [XmlAttribute("targetNamespace")]
+               public string TargetNamespace {
+                       get { return targetNamespace; }
+                       set { targetNamespace = value; }
+               }
+
+               [XmlIgnore]
+               public XmlSchema Schema {
+                       get { 
+                               if (ClientProtocol == null) 
+                                       throw new InvalidOperationException ("The ClientProtocol property is a null reference");
+                               
+                               XmlSchema doc = ClientProtocol.Documents [Url] as XmlSchema;
+                               if (doc == null)
+                                       throw new Exception ("The Documents property of ClientProtocol does not contain a schema with the url " + Url);
+                                       
+                               return doc; 
+                       }
+                       
+               }
+               
+               #endregion // Properties
+
+               #region Methods
+
+               public override object ReadDocument (Stream stream)
+               {
+                       return XmlSchema.Read (stream, null);
+               }
+                
+               protected internal override void Resolve (string contentType, Stream stream) 
+               {
+                       XmlSchema doc = XmlSchema.Read (stream, null);
+                       ClientProtocol.Documents.Add (Url, doc);
+                       if (!ClientProtocol.References.Contains (Url))
+                               ClientProtocol.References.Add (this);
+               }
+                
+               internal void ResolveInternal (DiscoveryClientProtocol prot, XmlSchema xsd) 
+               {
+                       if (xsd.Includes.Count == 0) return;
+                       
+                       foreach (XmlSchemaExternal ext in xsd.Includes)
+                       {
+                               if (ext.SchemaLocation == null)
+                                       continue;
+
+                               // Make relative uris to absoulte
+
+                               Uri uri = new Uri (BaseUri, ext.SchemaLocation);
+                               string url = uri.ToString ();
+
+                               if (prot.Documents.Contains (url))      // Already resolved
+                                       continue;
+
+                               try
+                               {
+                                       string contentType = null;
+                                       Stream stream = prot.Download (ref url, ref contentType);
+                                       XmlTextReader reader = new XmlTextReader (url, stream);
+                                       reader.XmlResolver = null;
+                                       reader.MoveToContent ();
+                                       
+                                       DiscoveryReference refe;
+                                       XmlSchema schema = XmlSchema.Read (reader, null);
+                                       refe = new SchemaReference ();
+                                       refe.ClientProtocol = prot;
+                                       refe.Url = url;
+                                       prot.Documents.Add (url, schema);
+                                       ((SchemaReference)refe).ResolveInternal (prot, schema);
+                                       
+                                       if (!prot.References.Contains (url))
+                                               prot.References.Add (refe);
+                                               
+                                       stream.Close ();
+                               }
+                               catch (Exception ex)
+                               {
+                                       ReportError (url, ex);
+                               }
+                       }
+               }
+
+               public override void WriteDocument (object document, Stream stream) 
+               {
+                       ((XmlSchema)document).Write (stream);
+               }
+
+               #endregion // Methods
+       }
+}
index 3ba6f903b584872c7b01a0fc8b25369e3c5cdf99..63d268bef640a22bfeae5bce84bca0136e58ffc5 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Discovery.SoapBinding.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.SoapBinding.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Discovery {\r
-\r
-       [XmlRootAttribute("soap", Namespace="http://schemas.xmlsoap.org/disco/soap/", IsNullable=true)]\r
-       public sealed class SoapBinding  {\r
-\r
-               #region Fields\r
-               \r
-               public const string Namespace = "http://schemas.xmlsoap.org/disco/soap/";\r
-\r
-               private string address;\r
-               private XmlQualifiedName binding;\r
-               \r
-               #endregion // Fields\r
-               \r
-               #region Constructors\r
-\r
-               public SoapBinding () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-               \r
-               [XmlAttribute("address")]\r
-               public string Address {\r
-                       get { return address; }\r
-                       set { address = value; }\r
-               }\r
-               \r
-               [XmlAttribute("binding")]\r
-               public XmlQualifiedName Binding {\r
-                       get { return binding; }\r
-                       set { binding = value; }\r
-               }\r
-               \r
-               #endregion // Properties\r
-\r
-       }\r
-}\r
+
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Discovery {
+
+       [XmlRootAttribute("soap", Namespace="http://schemas.xmlsoap.org/disco/soap/", IsNullable=true)]
+       public sealed class SoapBinding  {
+
+               #region Fields
+               
+               public const string Namespace = "http://schemas.xmlsoap.org/disco/soap/";
+
+               private string address;
+               private XmlQualifiedName binding;
+               
+               #endregion // Fields
+               
+               #region Constructors
+
+               public SoapBinding () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+               
+               [XmlAttribute("address")]
+               public string Address {
+                       get { return address; }
+                       set { address = value; }
+               }
+               
+               [XmlAttribute("binding")]
+               public XmlQualifiedName Binding {
+                       get { return binding; }
+                       set { binding = value; }
+               }
+               
+               #endregion // Properties
+
+       }
+}
index 4a190b1d6b745de84255d142451aef46b6a37d09..b2aa4475a5a25557ae8b253ec531095e0f6bc933 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Discovery.XmlSchemaSearchPattern.cs\r
-//\r
-// Author:\r
-//   Dave Bettin (javabettin@yahoo.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Dave Bettin, 2002\r
-//\r
+// 
+// System.Web.Services.Discovery.XmlSchemaSearchPattern.cs
+//
+// Author:
+//   Dave Bettin (javabettin@yahoo.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Dave Bettin, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Discovery {\r
-       public sealed class XmlSchemaSearchPattern : DiscoverySearchPattern {\r
-               \r
-               #region Fields\r
-               \r
-               private string pattern = "*.xsd";\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public XmlSchemaSearchPattern () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override string Pattern {\r
-                       get { return pattern; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override DiscoveryReference GetDiscoveryReference (string filename)\r
-               {\r
-                       SchemaReference refe = new SchemaReference ();\r
-                       refe.Url = filename;\r
-                       refe.Ref = filename;\r
-                       return refe;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+namespace System.Web.Services.Discovery {
+       public sealed class XmlSchemaSearchPattern : DiscoverySearchPattern {
+               
+               #region Fields
+               
+               private string pattern = "*.xsd";
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public XmlSchemaSearchPattern () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public override string Pattern {
+                       get { return pattern; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public override DiscoveryReference GetDiscoveryReference (string filename)
+               {
+                       SchemaReference refe = new SchemaReference ();
+                       refe.Url = filename;
+                       refe.Ref = filename;
+                       return refe;
+               }
+
+               #endregion // Methods
+       }
+}
index e5fec4a0e814b70182af00e53490c7d9c53e196d..969b318e2a39f0fa6cf1a5e5519305ec38dca33f 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.AnyReturnReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.AnyReturnReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Net;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class AnyReturnReader : MimeReturnReader {\r
-\r
-               #region Constructors\r
-\r
-               [MonoTODO]\r
-               public AnyReturnReader () \r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               [MonoTODO]\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public override void Initialize (object o)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-                       \r
-               [MonoTODO]\r
-               public override object Read (WebResponse response, Stream responseStream)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.IO;
+using System.Net;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class AnyReturnReader : MimeReturnReader {
+
+               #region Constructors
+
+               [MonoTODO]
+               public AnyReturnReader () 
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               [MonoTODO]
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public override void Initialize (object o)
+               {
+                       throw new NotImplementedException ();
+               }
+                       
+               [MonoTODO]
+               public override object Read (WebResponse response, Stream responseStream)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               #endregion // Methods
+       }
+}
index 6237639a0dac0803ae41a236e5dbe1294e869826..2bb9c7d576fd3d1d90c0a5e488de8b00e8751ee6 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.HtmlFormParameterReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HtmlFormParameterReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class HtmlFormParameterReader : ValueCollectionParameterReader {\r
-\r
-               #region Constructors\r
-\r
-               public HtmlFormParameterReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override object[] Read (HttpRequest request)\r
-               {\r
-                       return Read (request.Form);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Web;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class HtmlFormParameterReader : ValueCollectionParameterReader {
+
+               #region Constructors
+
+               public HtmlFormParameterReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override object[] Read (HttpRequest request)
+               {
+                       return Read (request.Form);
+               }
+
+               #endregion // Methods
+       }
 }
index 5d28e7d858a184e67bbe0db54a84032a1c760b9c..b255b36bd1421e815e4b8a26d57ed037ef9d6510 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.HtmlFormParameterWriter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HtmlFormParameterWriter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Net;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class HtmlFormParameterWriter : UrlEncodedParameterWriter {\r
-\r
-               #region Constructors\r
-\r
-               public HtmlFormParameterWriter () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override bool UsesWriteRequest {\r
-                       get { return true; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override void InitializeRequest (WebRequest request, object[] values)\r
-               {\r
-                       if (RequestEncoding == null) request.ContentType = "application/x-www-form-urlencoded";\r
-                       else request.ContentType = "application/x-www-form-urlencoded; charset=" + RequestEncoding.BodyName;\r
-               }\r
-\r
-               public override void WriteRequest (Stream requestStream, object[] values)\r
-               {\r
-                       StreamWriter sw = new StreamWriter (requestStream);\r
-                       Encode (sw, values);\r
-                       sw.Flush ();\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.IO;
+using System.Net;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class HtmlFormParameterWriter : UrlEncodedParameterWriter {
+
+               #region Constructors
+
+               public HtmlFormParameterWriter () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public override bool UsesWriteRequest {
+                       get { return true; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public override void InitializeRequest (WebRequest request, object[] values)
+               {
+                       if (RequestEncoding == null) request.ContentType = "application/x-www-form-urlencoded";
+                       else request.ContentType = "application/x-www-form-urlencoded; charset=" + RequestEncoding.BodyName;
+               }
+
+               public override void WriteRequest (Stream requestStream, object[] values)
+               {
+                       StreamWriter sw = new StreamWriter (requestStream);
+                       Encode (sw, values);
+                       sw.Flush ();
+               }
+
+               #endregion // Methods
+       }
 }
index 7b7ecb90289bc7ec666363cce5c4abcfe57843c5..dba0da2f58bde5546f23edd5a99b57104dc7d058 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.HttpGetClientProtocol.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HttpGetClientProtocol.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Net;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class HttpGetClientProtocol : HttpSimpleClientProtocol {\r
-\r
-               #region Constructors\r
-\r
-               public HttpGetClientProtocol () \r
-               {\r
-                       TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpGet");\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               protected override WebRequest GetWebRequest (Uri uri)\r
-               {\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
-                               \r
-                       WebRequest request = WebRequest.Create (uri);\r
-                       request.Method = "GET";\r
-                       return request;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Net;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class HttpGetClientProtocol : HttpSimpleClientProtocol {
+
+               #region Constructors
+
+               public HttpGetClientProtocol () 
+               {
+                       TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpGet");
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               protected override WebRequest GetWebRequest (Uri uri)
+               {
+                       if (uri == null)
+                               throw new InvalidOperationException ("The uri parameter is null.");
+                       if (uri.ToString () == String.Empty)
+                               throw new InvalidOperationException ("The uri parameter has a length of zero.");
+                               
+                       WebRequest request = WebRequest.Create (uri);
+                       request.Method = "GET";
+                       return request;
+               }
+
+               #endregion // Methods
+       }
 }
index 54b13ae0cd4ed43dd15a299eb43db91b4c593beb..b21b0aee7fd9b0875815e81a86d91ce6eeb38775 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.HttpMethodAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HttpMethodAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.Method, Inherited = true)]\r
-       public sealed class HttpMethodAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               Type parameterFormatter;\r
-               Type returnFormatter;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public HttpMethodAttribute () \r
-               {\r
-               }\r
-\r
-               public HttpMethodAttribute (Type returnFormatter, Type parameterFormatter) \r
-                       : this ()\r
-               {\r
-                       this.parameterFormatter = parameterFormatter;\r
-                       this.returnFormatter = returnFormatter;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public Type ParameterFormatter {\r
-                       get { return parameterFormatter; }\r
-                       set { parameterFormatter = value; }\r
-               }\r
-\r
-               public Type ReturnFormatter {\r
-                       get { return returnFormatter; }\r
-                       set { returnFormatter = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.Method, Inherited = true)]
+       public sealed class HttpMethodAttribute : Attribute {
+
+               #region Fields
+
+               Type parameterFormatter;
+               Type returnFormatter;
+
+               #endregion
+
+               #region Constructors
+
+               public HttpMethodAttribute () 
+               {
+               }
+
+               public HttpMethodAttribute (Type returnFormatter, Type parameterFormatter) 
+                       : this ()
+               {
+                       this.parameterFormatter = parameterFormatter;
+                       this.returnFormatter = returnFormatter;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public Type ParameterFormatter {
+                       get { return parameterFormatter; }
+                       set { parameterFormatter = value; }
+               }
+
+               public Type ReturnFormatter {
+                       get { return returnFormatter; }
+                       set { returnFormatter = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index d924b15212af126d318366dd757eb90e0be0fafd..3b491f7feceebf9a7ec3cf2461f8f98ed19f1369 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.HttpPostClientProtocol.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HttpPostClientProtocol.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Net;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class HttpPostClientProtocol : HttpSimpleClientProtocol {\r
-\r
-               #region Constructors\r
-\r
-               public HttpPostClientProtocol () \r
-               {\r
-                       TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpPost");\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               protected override WebRequest GetWebRequest (Uri uri)\r
-               {\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
-\r
-                       WebRequest request = WebRequest.Create (uri);\r
-                       request.Method = "POST";\r
-                       return request;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Net;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class HttpPostClientProtocol : HttpSimpleClientProtocol {
+
+               #region Constructors
+
+               public HttpPostClientProtocol () 
+               {
+                       TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpPost");
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               protected override WebRequest GetWebRequest (Uri uri)
+               {
+                       if (null == uri)
+                               throw new InvalidOperationException ("The uri parameter is a null reference.");
+                       if (String.Empty == uri.ToString ())
+                               throw new InvalidOperationException ("The uri parameter has a length of zero.");
+
+                       WebRequest request = WebRequest.Create (uri);
+                       request.Method = "POST";
+                       return request;
+               }
+
+               #endregion // Methods
+       }
 }
index 4a14762464fb8e8e4c41ee4269d512b94b979d4b..352643366d75ec713f5f33877d09e9c38ee75c79 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.HttpSimpleClientProtocol.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HttpSimpleClientProtocol.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Net;\r
-using System.IO;\r
-using System.Threading;\r
-\r
-namespace System.Web.Services.Protocols {\r
-#if NET_2_0\r
-       [System.Runtime.InteropServices.ComVisible (true)]\r
-#endif\r
-       public abstract class HttpSimpleClientProtocol : HttpWebClientProtocol {\r
-\r
-               #region Fields\r
-\r
-               internal HttpSimpleTypeStubInfo TypeStub;\r
-               \r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               protected HttpSimpleClientProtocol () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               protected IAsyncResult BeginInvoke (string methodName, string requestUrl, object[] parameters, AsyncCallback callback, object asyncState)\r
-               {\r
-                       HttpSimpleMethodStubInfo method = (HttpSimpleMethodStubInfo) TypeStub.GetMethod (methodName);\r
-                       SimpleWebClientAsyncResult ainfo = null;\r
-                       \r
-                       try\r
-                       {\r
-                               MimeParameterWriter parameterWriter = (MimeParameterWriter) method.ParameterWriterType.Create ();\r
-                               string url = parameterWriter.GetRequestUrl (requestUrl, parameters);\r
-                               WebRequest req = GetWebRequest (new Uri(url));\r
-                               \r
-                               ainfo = new SimpleWebClientAsyncResult (req, callback, asyncState);\r
-                               ainfo.Parameters = parameters;\r
-                               ainfo.ParameterWriter = parameterWriter;\r
-                               ainfo.Method = method;\r
-                               \r
-                               ainfo.Request = req;\r
-                               ainfo.Request.BeginGetRequestStream (new AsyncCallback (AsyncGetRequestStreamDone), ainfo);\r
-                       }\r
-                       catch (Exception ex)\r
-                       {\r
-                               if (ainfo != null)\r
-                                       ainfo.SetCompleted (null, ex, false);\r
-                               else\r
-                                       throw ex;\r
-                       }\r
-\r
-                       return ainfo;\r
-\r
-               }\r
-\r
-               void AsyncGetRequestStreamDone (IAsyncResult ar)\r
-               {\r
-                       SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) ar.AsyncState;\r
-                       try\r
-                       {\r
-                               if (ainfo.ParameterWriter.UsesWriteRequest)\r
-                               {\r
-                                       Stream stream = ainfo.Request.GetRequestStream ();\r
-                                       ainfo.ParameterWriter.WriteRequest (stream, ainfo.Parameters);\r
-                                       stream.Close ();\r
-                               }\r
-\r
-                               ainfo.Request.BeginGetResponse (new AsyncCallback (AsyncGetResponseDone), ainfo);\r
-                       }\r
-                       catch (Exception ex)\r
-                       {\r
-                               ainfo.SetCompleted (null, ex, true);\r
-                       }\r
-               }\r
-\r
-               void AsyncGetResponseDone (IAsyncResult ar)\r
-               {\r
-                       SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) ar.AsyncState;\r
-                       WebResponse response = null;\r
-\r
-                       try {\r
-                               response = GetWebResponse (ainfo.Request, ar);\r
-                       }\r
-                       catch (WebException ex) {\r
-                               response = ex.Response;\r
-                               HttpWebResponse http_response = response as HttpWebResponse;\r
-                               if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError) {\r
-                                       ainfo.SetCompleted (null, ex, true);\r
-                                       return;\r
-                               }\r
-                       }\r
-                       catch (Exception ex) {\r
-                               ainfo.SetCompleted (null, ex, true);\r
-                               return;\r
-                       }\r
-\r
-                       try {\r
-                               MimeReturnReader returnReader = (MimeReturnReader) ainfo.Method.ReturnReaderType.Create ();\r
-                               object result = returnReader.Read (response, response.GetResponseStream ());\r
-                               ainfo.SetCompleted (result, null, true);\r
-                       }\r
-                       catch (Exception ex) {\r
-                               ainfo.SetCompleted (null, ex, true);\r
-                       }\r
-               }\r
-\r
-\r
-               protected object EndInvoke (IAsyncResult asyncResult)\r
-               {\r
-                       if (!(asyncResult is SimpleWebClientAsyncResult)) throw new ArgumentException ("asyncResult is not the return value from BeginInvoke");\r
-\r
-                       SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) asyncResult;\r
-                       lock (ainfo)\r
-                       {\r
-                               if (!ainfo.IsCompleted) ainfo.WaitForComplete ();\r
-                               if (ainfo.Exception != null) throw ainfo.Exception;\r
-                               else return ainfo.Result;\r
-                       }\r
-               }\r
-\r
-               protected object Invoke (string methodName, string requestUrl, object[] parameters)\r
-               {\r
-                       HttpSimpleMethodStubInfo method = (HttpSimpleMethodStubInfo) TypeStub.GetMethod (methodName);\r
-                       MimeParameterWriter parameterWriter = (MimeParameterWriter) method.ParameterWriterType.Create ();\r
-                       \r
-                       string url = parameterWriter.GetRequestUrl (requestUrl, parameters);\r
-                       WebRequest request = GetWebRequest (new Uri(url, true));\r
-                       \r
-                       parameterWriter.InitializeRequest (request, parameters);\r
-                       \r
-                       if (parameterWriter.UsesWriteRequest)\r
-                       {\r
-                               Stream stream = request.GetRequestStream ();\r
-                               parameterWriter.WriteRequest (stream, parameters);\r
-                               stream.Close ();\r
-                       }\r
-                       \r
-                       WebResponse response = GetWebResponse (request);\r
-                       \r
-                       MimeReturnReader returnReader = (MimeReturnReader) method.ReturnReaderType.Create ();\r
-                       return returnReader.Read (response, response.GetResponseStream ());\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback)\r
-               {\r
-                       InvokeAsync (methodName, requestUrl, parameters, callback, null);\r
-               }\r
-\r
-               protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback, object userState)\r
-               {\r
-                       InvokeAsyncInfo info = new InvokeAsyncInfo (callback, userState);\r
-                       BeginInvoke (methodName, requestUrl, parameters, new AsyncCallback (InvokeAsyncCallback), info);\r
-               }\r
-\r
-               void InvokeAsyncCallback (IAsyncResult ar)\r
-               {\r
-                       InvokeAsyncInfo info = (InvokeAsyncInfo) ar.AsyncState;\r
-                       SimpleWebClientAsyncResult sar = (SimpleWebClientAsyncResult) ar;\r
-                       InvokeCompletedEventArgs args = new InvokeCompletedEventArgs (sar.Exception, false, info.UserState, (object[]) sar.Result);\r
-                       if (info.Context != null)\r
-                               info.Context.Send (info.Callback, args);\r
-                       else\r
-                               info.Callback (args);\r
-               }\r
-#endif\r
-               \r
-               #endregion // Methods\r
-       }\r
-       \r
-       internal class SimpleWebClientAsyncResult : WebClientAsyncResult\r
-       {\r
-               public SimpleWebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)\r
-               : base (request, callback, asyncState)\r
-               {\r
-               }\r
-               \r
-               public object[] Parameters;\r
-               public HttpSimpleMethodStubInfo Method;\r
-               public MimeParameterWriter ParameterWriter;\r
-       }\r
+
+using System.Web.Services;
+using System.Net;
+using System.IO;
+using System.Threading;
+
+namespace System.Web.Services.Protocols {
+#if NET_2_0
+       [System.Runtime.InteropServices.ComVisible (true)]
+#endif
+       public abstract class HttpSimpleClientProtocol : HttpWebClientProtocol {
+
+               #region Fields
+
+               internal HttpSimpleTypeStubInfo TypeStub;
+               
+               #endregion // Fields
+
+               #region Constructors
+
+               protected HttpSimpleClientProtocol () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               protected IAsyncResult BeginInvoke (string methodName, string requestUrl, object[] parameters, AsyncCallback callback, object asyncState)
+               {
+                       HttpSimpleMethodStubInfo method = (HttpSimpleMethodStubInfo) TypeStub.GetMethod (methodName);
+                       SimpleWebClientAsyncResult ainfo = null;
+                       
+                       try
+                       {
+                               MimeParameterWriter parameterWriter = (MimeParameterWriter) method.ParameterWriterType.Create ();
+                               string url = parameterWriter.GetRequestUrl (requestUrl, parameters);
+                               WebRequest req = GetWebRequest (new Uri(url));
+                               
+                               ainfo = new SimpleWebClientAsyncResult (req, callback, asyncState);
+                               ainfo.Parameters = parameters;
+                               ainfo.ParameterWriter = parameterWriter;
+                               ainfo.Method = method;
+                               
+                               ainfo.Request = req;
+                               ainfo.Request.BeginGetRequestStream (new AsyncCallback (AsyncGetRequestStreamDone), ainfo);
+                       }
+                       catch (Exception ex)
+                       {
+                               if (ainfo != null)
+                                       ainfo.SetCompleted (null, ex, false);
+                               else
+                                       throw ex;
+                       }
+
+                       return ainfo;
+
+               }
+
+               void AsyncGetRequestStreamDone (IAsyncResult ar)
+               {
+                       SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) ar.AsyncState;
+                       try
+                       {
+                               if (ainfo.ParameterWriter.UsesWriteRequest)
+                               {
+                                       Stream stream = ainfo.Request.GetRequestStream ();
+                                       ainfo.ParameterWriter.WriteRequest (stream, ainfo.Parameters);
+                                       stream.Close ();
+                               }
+
+                               ainfo.Request.BeginGetResponse (new AsyncCallback (AsyncGetResponseDone), ainfo);
+                       }
+                       catch (Exception ex)
+                       {
+                               ainfo.SetCompleted (null, ex, true);
+                       }
+               }
+
+               void AsyncGetResponseDone (IAsyncResult ar)
+               {
+                       SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) ar.AsyncState;
+                       WebResponse response = null;
+
+                       try {
+                               response = GetWebResponse (ainfo.Request, ar);
+                       }
+                       catch (WebException ex) {
+                               response = ex.Response;
+                               HttpWebResponse http_response = response as HttpWebResponse;
+                               if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError) {
+                                       ainfo.SetCompleted (null, ex, true);
+                                       return;
+                               }
+                       }
+                       catch (Exception ex) {
+                               ainfo.SetCompleted (null, ex, true);
+                               return;
+                       }
+
+                       try {
+                               MimeReturnReader returnReader = (MimeReturnReader) ainfo.Method.ReturnReaderType.Create ();
+                               object result = returnReader.Read (response, response.GetResponseStream ());
+                               ainfo.SetCompleted (result, null, true);
+                       }
+                       catch (Exception ex) {
+                               ainfo.SetCompleted (null, ex, true);
+                       }
+               }
+
+
+               protected object EndInvoke (IAsyncResult asyncResult)
+               {
+                       if (!(asyncResult is SimpleWebClientAsyncResult)) throw new ArgumentException ("asyncResult is not the return value from BeginInvoke");
+
+                       SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) asyncResult;
+                       lock (ainfo)
+                       {
+                               if (!ainfo.IsCompleted) ainfo.WaitForComplete ();
+                               if (ainfo.Exception != null) throw ainfo.Exception;
+                               else return ainfo.Result;
+                       }
+               }
+
+               protected object Invoke (string methodName, string requestUrl, object[] parameters)
+               {
+                       HttpSimpleMethodStubInfo method = (HttpSimpleMethodStubInfo) TypeStub.GetMethod (methodName);
+                       MimeParameterWriter parameterWriter = (MimeParameterWriter) method.ParameterWriterType.Create ();
+                       
+                       string url = parameterWriter.GetRequestUrl (requestUrl, parameters);
+                       WebRequest request = GetWebRequest (new Uri(url, true));
+                       
+                       parameterWriter.InitializeRequest (request, parameters);
+                       
+                       if (parameterWriter.UsesWriteRequest)
+                       {
+                               Stream stream = request.GetRequestStream ();
+                               parameterWriter.WriteRequest (stream, parameters);
+                               stream.Close ();
+                       }
+                       
+                       WebResponse response = GetWebResponse (request);
+                       
+                       MimeReturnReader returnReader = (MimeReturnReader) method.ReturnReaderType.Create ();
+                       return returnReader.Read (response, response.GetResponseStream ());
+               }
+               
+#if NET_2_0
+
+               protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback)
+               {
+                       InvokeAsync (methodName, requestUrl, parameters, callback, null);
+               }
+
+               protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback, object userState)
+               {
+                       InvokeAsyncInfo info = new InvokeAsyncInfo (callback, userState);
+                       BeginInvoke (methodName, requestUrl, parameters, new AsyncCallback (InvokeAsyncCallback), info);
+               }
+
+               void InvokeAsyncCallback (IAsyncResult ar)
+               {
+                       InvokeAsyncInfo info = (InvokeAsyncInfo) ar.AsyncState;
+                       SimpleWebClientAsyncResult sar = (SimpleWebClientAsyncResult) ar;
+                       InvokeCompletedEventArgs args = new InvokeCompletedEventArgs (sar.Exception, false, info.UserState, (object[]) sar.Result);
+                       if (info.Context != null)
+                               info.Context.Send (info.Callback, args);
+                       else
+                               info.Callback (args);
+               }
+#endif
+               
+               #endregion // Methods
+       }
+       
+       internal class SimpleWebClientAsyncResult : WebClientAsyncResult
+       {
+               public SimpleWebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)
+               : base (request, callback, asyncState)
+               {
+               }
+               
+               public object[] Parameters;
+               public HttpSimpleMethodStubInfo Method;
+               public MimeParameterWriter ParameterWriter;
+       }
 }
index 426d7d8d74ff8eb0d5f6a8c58ee097a70d672ce8..ba32c0cda81a32050f561318d3bb31a2d36224af 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.HttpWebClientProtocol.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.HttpWebClientProtocol.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\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
-using System.Collections;\r
-\r
-namespace System.Web.Services.Protocols {\r
-#if NET_2_0\r
-       [System.Runtime.InteropServices.ComVisible (true)]\r
-#endif\r
-       public abstract class HttpWebClientProtocol : WebClientProtocol {\r
-\r
-               #region Fields\r
-\r
-               bool allowAutoRedirect;\r
-               X509CertificateCollection clientCertificates;\r
-               CookieContainer cookieContainer;\r
-               IWebProxy proxy;\r
-               string userAgent;\r
-               \r
-#if NET_1_1\r
-               bool _unsafeAuthenticated;\r
-#endif\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               protected HttpWebClientProtocol () \r
-               {\r
-                       allowAutoRedirect = false;\r
-                       clientCertificates = null;\r
-                       cookieContainer = null;\r
-                       proxy = null; // FIXME\r
-                       userAgent = String.Format ("Mono Web Services Client Protocol {0}", Environment.Version);\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue (false)]\r
-               [WebServicesDescription ("Enable automatic handling of server redirects.")]\r
-               public bool AllowAutoRedirect {\r
-                       get { return allowAutoRedirect; }\r
-                       set { allowAutoRedirect = value; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               [WebServicesDescription ("The client certificates that will be sent to the server, if the server requests them.")]\r
-               public X509CertificateCollection ClientCertificates {\r
-                       get {\r
-                               if (clientCertificates == null)\r
-                                       clientCertificates = new X509CertificateCollection ();\r
-                               return clientCertificates;\r
-                       }\r
-               }\r
-\r
-               [DefaultValue (null)]\r
-               [WebServicesDescription ("A container for all cookies received from servers in the current session.")]\r
-               public CookieContainer CookieContainer {\r
-                       get { return cookieContainer; }\r
-                       set { cookieContainer = value; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public IWebProxy Proxy {\r
-                       get { return proxy; }\r
-                       set { proxy = value; }\r
-               }\r
-\r
-               [WebServicesDescription ("Sets the user agent http header for the request.")]\r
-#if NET_2_0\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-#endif\r
-               public string UserAgent {\r
-                       get { return userAgent; }\r
-                       set { userAgent = value; }\r
-               }\r
-               \r
-#if NET_1_1\r
-#if NET_2_0\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-#endif\r
-               public bool UnsafeAuthenticatedConnectionSharing\r
-               {\r
-                       get { return _unsafeAuthenticated; }\r
-                       set { _unsafeAuthenticated = value; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal virtual void CheckForCookies (HttpWebResponse response)\r
-               {\r
-                       CookieCollection cookies = response.Cookies;\r
-                       if (cookieContainer == null || cookies.Count == 0)\r
-                               return;\r
-\r
-                       CookieCollection coll = cookieContainer.GetCookies (uri);\r
-                       foreach (Cookie c in cookies) {\r
-                               bool add = true;\r
-                               foreach (Cookie prev in coll) {\r
-                                       if (c.Equals (prev)) {\r
-                                               add = false;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                               if (add)\r
-                                       cookieContainer.Add (c);\r
-                       }\r
-               }\r
-               \r
-               protected override WebRequest GetWebRequest (Uri uri)\r
-               {\r
-                       WebRequest req = base.GetWebRequest (uri);\r
-                       HttpWebRequest request = req as HttpWebRequest;\r
-                       if (request == null)\r
-                               return req;\r
-\r
-                       request.AllowAutoRedirect = allowAutoRedirect;\r
-                       if (clientCertificates != null)\r
-                               request.ClientCertificates.AddRange (clientCertificates);\r
-\r
-                       request.CookieContainer = cookieContainer;\r
-                       if (proxy != null)\r
-                               request.Proxy = proxy;\r
-\r
-                       request.UserAgent = userAgent;\r
-\r
-#if NET_1_1\r
-               //      request.UnsafeAuthenticatedConnectionSharing = _unsafeAuthenticated;\r
-#endif\r
-\r
-                       return request;\r
-               }\r
-\r
-               protected override WebResponse GetWebResponse (WebRequest request)\r
-               {\r
-                       WebResponse response = base.GetWebResponse (request);\r
-                       HttpWebResponse wr = response as HttpWebResponse;\r
-                       if (wr != null)\r
-                               CheckForCookies (wr);\r
-                               \r
-                       return response;\r
-               }\r
-\r
-               protected override WebResponse GetWebResponse (WebRequest request, IAsyncResult result)\r
-               {\r
-                       WebResponse response = base.GetWebResponse (request, result);\r
-                       HttpWebResponse wr = response as HttpWebResponse;\r
-                       if (wr != null)\r
-                               CheckForCookies (wr);\r
-                               \r
-                       return response;\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               [MonoTODO]\r
-               protected void CancelAsync (object userState)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public static bool GenerateXmlMappings (Type type, ArrayList mapping)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public static Hashtable GenerateXmlMappings (Type[] types, ArrayList mapping)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-#endif\r
-\r
-               #endregion // Methods\r
-       }\r
-       \r
-#if NET_2_0\r
-       internal class InvokeAsyncInfo\r
-       {\r
-               public SynchronizationContext Context;\r
-               public object UserState;\r
-               public SendOrPostCallback Callback;\r
-               \r
-               public InvokeAsyncInfo (SendOrPostCallback callback, object userState)\r
-               {\r
-                       Callback = callback;\r
-                       UserState = userState;\r
-                       Context = SynchronizationContext.Current;\r
-               }\r
-       }\r
-#endif\r
-}\r
+
+using System;
+using System.ComponentModel;
+using System.Net;
+using System.Security.Cryptography.X509Certificates;
+using System.Threading;
+using System.Web.Services;
+using System.Collections;
+
+namespace System.Web.Services.Protocols {
+#if NET_2_0
+       [System.Runtime.InteropServices.ComVisible (true)]
+#endif
+       public abstract class HttpWebClientProtocol : WebClientProtocol {
+
+               #region Fields
+
+               bool allowAutoRedirect;
+               X509CertificateCollection clientCertificates;
+               CookieContainer cookieContainer;
+               IWebProxy proxy;
+               string userAgent;
+               
+#if NET_1_1
+               bool _unsafeAuthenticated;
+#endif
+               #endregion
+
+               #region Constructors
+
+               protected HttpWebClientProtocol () 
+               {
+                       allowAutoRedirect = false;
+                       clientCertificates = null;
+                       cookieContainer = null;
+                       proxy = null; // FIXME
+                       userAgent = String.Format ("Mono Web Services Client Protocol {0}", Environment.Version);
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue (false)]
+               [WebServicesDescription ("Enable automatic handling of server redirects.")]
+               public bool AllowAutoRedirect {
+                       get { return allowAutoRedirect; }
+                       set { allowAutoRedirect = value; }
+               }
+
+               [Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [WebServicesDescription ("The client certificates that will be sent to the server, if the server requests them.")]
+               public X509CertificateCollection ClientCertificates {
+                       get {
+                               if (clientCertificates == null)
+                                       clientCertificates = new X509CertificateCollection ();
+                               return clientCertificates;
+                       }
+               }
+
+               [DefaultValue (null)]
+               [WebServicesDescription ("A container for all cookies received from servers in the current session.")]
+               public CookieContainer CookieContainer {
+                       get { return cookieContainer; }
+                       set { cookieContainer = value; }
+               }
+
+               [Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public IWebProxy Proxy {
+                       get { return proxy; }
+                       set { proxy = value; }
+               }
+
+               [WebServicesDescription ("Sets the user agent http header for the request.")]
+#if NET_2_0
+               [Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+#endif
+               public string UserAgent {
+                       get { return userAgent; }
+                       set { userAgent = value; }
+               }
+               
+#if NET_1_1
+#if NET_2_0
+               [Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+#endif
+               public bool UnsafeAuthenticatedConnectionSharing
+               {
+                       get { return _unsafeAuthenticated; }
+                       set { _unsafeAuthenticated = value; }
+               }
+#endif
+
+               #endregion // Properties
+
+               #region Methods
+
+               internal virtual void CheckForCookies (HttpWebResponse response)
+               {
+                       CookieCollection cookies = response.Cookies;
+                       if (cookieContainer == null || cookies.Count == 0)
+                               return;
+
+                       CookieCollection coll = cookieContainer.GetCookies (uri);
+                       foreach (Cookie c in cookies) {
+                               bool add = true;
+                               foreach (Cookie prev in coll) {
+                                       if (c.Equals (prev)) {
+                                               add = false;
+                                               break;
+                                       }
+                               }
+                               if (add)
+                                       cookieContainer.Add (c);
+                       }
+               }
+               
+               protected override WebRequest GetWebRequest (Uri uri)
+               {
+                       WebRequest req = base.GetWebRequest (uri);
+                       HttpWebRequest request = req as HttpWebRequest;
+                       if (request == null)
+                               return req;
+
+                       request.AllowAutoRedirect = allowAutoRedirect;
+                       if (clientCertificates != null)
+                               request.ClientCertificates.AddRange (clientCertificates);
+
+                       request.CookieContainer = cookieContainer;
+                       if (proxy != null)
+                               request.Proxy = proxy;
+
+                       request.UserAgent = userAgent;
+
+#if NET_1_1
+               //      request.UnsafeAuthenticatedConnectionSharing = _unsafeAuthenticated;
+#endif
+
+                       return request;
+               }
+
+               protected override WebResponse GetWebResponse (WebRequest request)
+               {
+                       WebResponse response = base.GetWebResponse (request);
+                       HttpWebResponse wr = response as HttpWebResponse;
+                       if (wr != null)
+                               CheckForCookies (wr);
+                               
+                       return response;
+               }
+
+               protected override WebResponse GetWebResponse (WebRequest request, IAsyncResult result)
+               {
+                       WebResponse response = base.GetWebResponse (request, result);
+                       HttpWebResponse wr = response as HttpWebResponse;
+                       if (wr != null)
+                               CheckForCookies (wr);
+                               
+                       return response;
+               }
+               
+#if NET_2_0
+
+               [MonoTODO]
+               protected void CancelAsync (object userState)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static bool GenerateXmlMappings (Type type, ArrayList mapping)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static Hashtable GenerateXmlMappings (Type[] types, ArrayList mapping)
+               {
+                       throw new NotImplementedException ();
+               }
+#endif
+
+               #endregion // Methods
+       }
+       
+#if NET_2_0
+       internal class InvokeAsyncInfo
+       {
+               public SynchronizationContext Context;
+               public object UserState;
+               public SendOrPostCallback Callback;
+               
+               public InvokeAsyncInfo (SendOrPostCallback callback, object userState)
+               {
+                       Callback = callback;
+                       UserState = userState;
+                       Context = SynchronizationContext.Current;
+               }
+       }
+#endif
+}
index af3c478ac1871713a42b2650ba3c004504f3f904..019daeedd8c631de9da7afdd120bc55b0d5b37d5 100644 (file)
@@ -1,26 +1,26 @@
-// \r
-// System.Web.Services.Protocols.LogicalMethodInfo.cs\r
-//\r
-// Authors:\r
-//   Miguel de Icaza (miguel@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-// Copyright (C) Ximian, Inc,  2003\r
-//\r
-// TODO:\r
-//    BeginInvoke, EndInvoke are missing.\r
-//    AsyncResultParameter\r
-//\r
-// WILD GUESS:\r
-//   The reason for this class is so that it can cluster method/begin/end methods\r
-//   together, as the begin/end methods in generated files from WSDL does *NOT*\r
-//   contain all the information required to make a request.\r
-//\r
-//   Either that, or the Begin*/End* versions probe the attributes on the regular\r
-//   method (which seems simpler). \r
-//\r
+// 
+// System.Web.Services.Protocols.LogicalMethodInfo.cs
+//
+// Authors:
+//   Miguel de Icaza (miguel@ximian.com)
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+// Copyright (C) Ximian, Inc,  2003
+//
+// TODO:
+//    BeginInvoke, EndInvoke are missing.
+//    AsyncResultParameter
+//
+// WILD GUESS:
+//   The reason for this class is so that it can cluster method/begin/end methods
+//   together, as the begin/end methods in generated files from WSDL does *NOT*
+//   contain all the information required to make a request.
+//
+//   Either that, or the Begin*/End* versions probe the attributes on the regular
+//   method (which seems simpler). 
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Reflection;\r
-using System.Collections;\r
-using System.Text;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public sealed class LogicalMethodInfo {\r
-                #region Fields\r
-\r
-               MethodInfo method_info, end_method_info;\r
-               ParameterInfo [] parameters;\r
-               ParameterInfo [] out_parameters;\r
-               ParameterInfo [] in_parameters;\r
-               WebMethodAttribute attribute;\r
-\r
-               #endregion // Fields.\r
-               \r
-               #region Constructors\r
-       \r
-               public LogicalMethodInfo (MethodInfo method_info)\r
-               {\r
-                       if (method_info == null)\r
-                               throw new ArgumentNullException ("method_info should be non-null");\r
-                       if (method_info.IsStatic)\r
-                               throw new InvalidOperationException ("method is static");\r
-                       \r
-                       this.method_info = method_info;\r
-               }\r
-\r
-               //\r
-               // Only an internal contructor, called from "Create"\r
-               //\r
-               LogicalMethodInfo (MethodInfo method_info, MethodInfo end_method_info)\r
-               {\r
-                       if (method_info == null)\r
-                               throw new ArgumentNullException ("method_info should be non-null");\r
-                       if (method_info.IsStatic)\r
-                               throw new InvalidOperationException ("method is static");\r
-                       \r
-                       this.end_method_info = end_method_info;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               //\r
-               // Signatures for Begin/End methods:\r
-               //\r
-               //        public System.IAsyncResult BeginHelloWorld(ARG1, ARG2, System.AsyncCallback callback, object asyncState) {\r
-               //        public string EndHelloWorld(System.IAsyncResult asyncResult) {\r
-\r
-               public ParameterInfo AsyncCallbackParameter {\r
-                       get {\r
-                               ParameterInfo [] pi = method_info.GetParameters ();\r
-                               return pi [pi.Length-2];\r
-                       }\r
-               }\r
-\r
-               public ParameterInfo AsyncResultParameter {\r
-                       get {\r
-                               ParameterInfo [] pi = end_method_info.GetParameters ();\r
-                               return pi [pi.Length-1];\r
-                       }\r
-               }\r
-\r
-               public ParameterInfo AsyncStateParameter {\r
-                       get {\r
-                               ParameterInfo [] pi = method_info.GetParameters ();\r
-                               return pi [pi.Length-1];\r
-                       }\r
-               }\r
-\r
-               public MethodInfo BeginMethodInfo {\r
-                       get {\r
-                               if (IsBeginMethod (method_info))\r
-                                       return method_info;\r
-                               return null;\r
-                       }\r
-               }\r
-\r
-               public ICustomAttributeProvider CustomAttributeProvider {\r
-                       get {\r
-                               return method_info;\r
-                       }\r
-               }\r
-\r
-               public Type DeclaringType {\r
-                       get {\r
-                               return method_info.DeclaringType;\r
-                       }\r
-               }\r
-\r
-               public MethodInfo EndMethodInfo {\r
-                       get {\r
-                               return end_method_info;\r
-                       }\r
-               }\r
-\r
-               public ParameterInfo[] InParameters {\r
-                       get {\r
-                               if (parameters == null)\r
-                                       ComputeParameters ();\r
-                               return in_parameters;\r
-                       }\r
-               }\r
-\r
-               public bool IsAsync {\r
-                       get {\r
-                               return end_method_info != null;\r
-                       }\r
-               }\r
-\r
-               public bool IsVoid {\r
-                       get {\r
-                               return ReturnType == typeof (void);\r
-                       }\r
-               }\r
-\r
-               public MethodInfo MethodInfo {\r
-                       get {\r
-                               return method_info;\r
-                       }\r
-               }\r
-\r
-               public string Name {\r
-                       get {\r
-                               return method_info.Name;\r
-                       }\r
-               }\r
-\r
-               void ComputeParameters ()\r
-               {\r
-                       ParameterInfo[] pars = method_info.GetParameters ();\r
-                       if (IsAsync)\r
-                       {\r
-                               parameters = new ParameterInfo [pars.Length - 2];\r
-                               Array.Copy (pars, 0, parameters, 0, pars.Length - 2);\r
-                               in_parameters = new ParameterInfo [parameters.Length];\r
-                               parameters.CopyTo (in_parameters, 0);\r
-                               \r
-                               ParameterInfo[] outPars = end_method_info.GetParameters ();\r
-                               out_parameters = new ParameterInfo [outPars.Length - 1];\r
-                               Array.Copy (outPars, 0, out_parameters, 0, out_parameters.Length);\r
-                       }\r
-                       else\r
-                       {\r
-                               parameters = pars;\r
-                               int out_count = 0;\r
-                               int in_count = 0;\r
-                               \r
-                               foreach (ParameterInfo p in parameters){\r
-                                       Type ptype = p.ParameterType;\r
-                                       if (ptype.IsByRef){\r
-                                               out_count++;\r
-                                               if (!p.IsOut)\r
-                                                       in_count++;\r
-                                       } else\r
-                                               in_count++;\r
-                               }\r
-                               out_parameters = new ParameterInfo [out_count];\r
-                               int i = 0;\r
-                               for (int j = 0; j < parameters.Length; j++){\r
-                                       if (parameters [j].ParameterType.IsByRef)\r
-                                               out_parameters [i++] = parameters [j];\r
-                               }\r
-                               in_parameters = new ParameterInfo [in_count];\r
-                               i = 0;\r
-                               for (int j = 0; j < parameters.Length; j++){\r
-                                       if (parameters [j].ParameterType.IsByRef){\r
-                                               if (!parameters [j].IsOut)\r
-                                                       in_parameters [i++] = parameters [j];\r
-                                       } else\r
-                                               in_parameters [i++] = parameters [j];\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               public ParameterInfo[] OutParameters {\r
-                       get {\r
-                               if (parameters == null)\r
-                                       ComputeParameters ();\r
-                               return out_parameters;\r
-                       }\r
-               }\r
-\r
-               public ParameterInfo[] Parameters {\r
-                       get {\r
-                               if (parameters == null)\r
-                                       ComputeParameters ();\r
-                               return parameters;\r
-                       }\r
-               }\r
-\r
-               public Type ReturnType {\r
-                       get {\r
-                               if (IsAsync)\r
-                                       return end_method_info.ReturnType;\r
-                               else\r
-                                       return method_info.ReturnType;\r
-                       }\r
-               }\r
-\r
-               public ICustomAttributeProvider ReturnTypeCustomAttributeProvider {\r
-                       get {\r
-                               return method_info.ReturnTypeCustomAttributes;\r
-                       }\r
-               }\r
-\r
-               internal bool EnableSession {\r
-                       get {\r
-                               if (method_info == null)\r
-                                       return false;\r
-\r
-                               if (attribute == null) {\r
-                                       object [] o = method_info.GetCustomAttributes (false);\r
-                                       foreach (Attribute att in o) {\r
-                                               if (att is WebMethodAttribute) {\r
-                                                       attribute = (WebMethodAttribute) att;\r
-                                                       break;\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               return (attribute != null) ? attribute.EnableSession : false;\r
-                       }\r
-               }\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public IAsyncResult BeginInvoke (object target, object[] values, AsyncCallback callback, object asyncState)\r
-               {\r
-                       int len = (values!=null) ? values.Length : 0;\r
-                       object[] pars = new object [len + 2];\r
-                       \r
-                       if (len > 0)\r
-                               values.CopyTo (pars, 0);\r
-                       \r
-                       pars [len] = callback;\r
-                       pars [len+1] = asyncState;\r
-                               \r
-                       return (IAsyncResult) method_info.Invoke (target, pars);\r
-               }\r
-\r
-               public static LogicalMethodInfo[] Create (MethodInfo[] method_infos)\r
-               {\r
-                       return Create (method_infos, LogicalMethodTypes.Sync | LogicalMethodTypes.Async);\r
-               }\r
-\r
-               public static LogicalMethodInfo[] Create (MethodInfo[] method_infos, LogicalMethodTypes types)\r
-               {\r
-                       ArrayList sync = ((types & LogicalMethodTypes.Sync) != 0) ? new ArrayList () : null;\r
-                       ArrayList begin, end;\r
-\r
-                       if ((types & LogicalMethodTypes.Async) != 0){\r
-                               begin = new ArrayList ();\r
-                               end = new ArrayList ();\r
-                       } else \r
-                               begin = end = null;\r
-\r
-                       foreach (MethodInfo mi in method_infos){\r
-                               if (IsBeginMethod (mi) && begin != null)\r
-                                       begin.Add (mi);\r
-                               else if (IsEndMethod (mi) && end != null)\r
-                                       end.Add (mi);\r
-                               else if (sync != null)\r
-                                       sync.Add (mi);\r
-                       }\r
-\r
-                       int bcount = 0, count = 0;\r
-                       if (begin != null){\r
-                               bcount = count = begin.Count;\r
-                               if (count != end.Count)\r
-                                       throw new InvalidOperationException ("Imbalance of begin/end methods");\r
-                       }\r
-                       if (sync != null)\r
-                               count += sync.Count;\r
-\r
-                       LogicalMethodInfo [] res = new LogicalMethodInfo [count];\r
-                       int dest = 0;\r
-                       if (begin != null){\r
-                               foreach (MethodInfo bm in begin){\r
-                                       string end_name = "End" + bm.Name.Substring (5);\r
-\r
-                                       for (int i = 0; i < bcount; i++){\r
-                                               MethodInfo em = (MethodInfo) end [i];\r
-                                               if (em.Name == end_name){\r
-                                                       res [dest++] = new LogicalMethodInfo (bm, em);\r
-                                                       break;\r
-                                               }\r
-                                               throw new InvalidOperationException ("Imbalance of begin/end methods");\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-\r
-                       if (sync != null)\r
-                               foreach (MethodInfo mi in sync){\r
-                                       res [dest++] = new LogicalMethodInfo (mi);\r
-                               }\r
-                       \r
-                       return res;\r
-               }\r
-\r
-               public object[] EndInvoke (object target, IAsyncResult asyncResult)\r
-               {\r
-                       if (parameters == null)\r
-                               ComputeParameters ();\r
-\r
-                       object[] values = new object [out_parameters.Length + 1];\r
-                       values [values.Length - 1] = asyncResult;\r
-                       object res = end_method_info.Invoke (target, values);\r
-                       \r
-                       int retc = IsVoid ? 0 : 1;\r
-                       object [] ret = new object [retc + out_parameters.Length];\r
-                       \r
-                       if (retc == 1) ret [0] = res;\r
-                       \r
-                       Array.Copy (values, 0, ret, retc, out_parameters.Length);\r
-                       return ret;\r
-               }\r
-\r
-               public object GetCustomAttribute (Type type)\r
-               {\r
-                       return Attribute.GetCustomAttribute (method_info, type, false);\r
-               }\r
-\r
-               public object[] GetCustomAttributes (Type type)\r
-               {\r
-                       return method_info.GetCustomAttributes (type, false);\r
-               }\r
-\r
-               public object[] Invoke (object target, object[] values)\r
-               {\r
-                       if (parameters == null)\r
-                               ComputeParameters ();\r
-\r
-                       int retc = IsVoid ? 0 : 1;\r
-                       object [] ret = new object [retc + out_parameters.Length];\r
-                       object res = method_info.Invoke (target, values);\r
-                       if (retc == 1) ret [0] = res;\r
-\r
-                       int j = retc;\r
-                       for (int i = 0; i < parameters.Length; i++){\r
-                               if (parameters [i].ParameterType.IsByRef)\r
-                                       ret [j++] = values [i];\r
-                       }\r
-\r
-                       return ret;\r
-               }\r
-\r
-               public static bool IsBeginMethod (MethodInfo method_info)\r
-               {\r
-                       if (method_info == null)\r
-                               throw new ArgumentNullException ("method_info can not be null");\r
-\r
-                       if (method_info.ReturnType != typeof (IAsyncResult))\r
-                               return false;\r
-\r
-                       if (method_info.Name.StartsWith ("Begin"))\r
-                               return true;\r
-\r
-                       return false;\r
-               }\r
-\r
-               public static bool IsEndMethod (MethodInfo method_info)\r
-               {\r
-                       if (method_info == null)\r
-                               throw new ArgumentNullException ("method_info can not be null");\r
-\r
-                       ParameterInfo [] parameter_info = method_info.GetParameters ();\r
-                       if (parameter_info.Length != 1)\r
-                               return false;\r
-                       if (parameter_info [0].ParameterType != typeof (IAsyncResult))\r
-                               return false;\r
-                       if (method_info.Name.StartsWith ("End"))\r
-                               return true;\r
-\r
-                       return false;\r
-               }\r
-\r
-               public override string ToString ()\r
-               {\r
-                       StringBuilder sb = new StringBuilder ();\r
-                       if (parameters == null)\r
-                               ComputeParameters ();\r
-                       \r
-                       for (int i = 0; i < parameters.Length; i++){\r
-                               sb.Append (parameters [i].ParameterType);\r
-                               if (parameters [i].ParameterType.IsByRef)\r
-                                       sb.Append (" ByRef");\r
-                               \r
-                               if (i+1 != parameters.Length)\r
-                                       sb.Append (", ");\r
-                       }\r
-                       \r
-                       return String.Format (\r
-                               "{0} {1} ({2})",\r
-                               method_info.ReturnType, method_info.Name,\r
-                               sb.ToString ());\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Reflection;
+using System.Collections;
+using System.Text;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public sealed class LogicalMethodInfo {
+                #region Fields
+
+               MethodInfo method_info, end_method_info;
+               ParameterInfo [] parameters;
+               ParameterInfo [] out_parameters;
+               ParameterInfo [] in_parameters;
+               WebMethodAttribute attribute;
+
+               #endregion // Fields.
+               
+               #region Constructors
+       
+               public LogicalMethodInfo (MethodInfo method_info)
+               {
+                       if (method_info == null)
+                               throw new ArgumentNullException ("method_info should be non-null");
+                       if (method_info.IsStatic)
+                               throw new InvalidOperationException ("method is static");
+                       
+                       this.method_info = method_info;
+               }
+
+               //
+               // Only an internal contructor, called from "Create"
+               //
+               LogicalMethodInfo (MethodInfo method_info, MethodInfo end_method_info)
+               {
+                       if (method_info == null)
+                               throw new ArgumentNullException ("method_info should be non-null");
+                       if (method_info.IsStatic)
+                               throw new InvalidOperationException ("method is static");
+                       
+                       this.end_method_info = end_method_info;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               //
+               // Signatures for Begin/End methods:
+               //
+               //        public System.IAsyncResult BeginHelloWorld(ARG1, ARG2, System.AsyncCallback callback, object asyncState) {
+               //        public string EndHelloWorld(System.IAsyncResult asyncResult) {
+
+               public ParameterInfo AsyncCallbackParameter {
+                       get {
+                               ParameterInfo [] pi = method_info.GetParameters ();
+                               return pi [pi.Length-2];
+                       }
+               }
+
+               public ParameterInfo AsyncResultParameter {
+                       get {
+                               ParameterInfo [] pi = end_method_info.GetParameters ();
+                               return pi [pi.Length-1];
+                       }
+               }
+
+               public ParameterInfo AsyncStateParameter {
+                       get {
+                               ParameterInfo [] pi = method_info.GetParameters ();
+                               return pi [pi.Length-1];
+                       }
+               }
+
+               public MethodInfo BeginMethodInfo {
+                       get {
+                               if (IsBeginMethod (method_info))
+                                       return method_info;
+                               return null;
+                       }
+               }
+
+               public ICustomAttributeProvider CustomAttributeProvider {
+                       get {
+                               return method_info;
+                       }
+               }
+
+               public Type DeclaringType {
+                       get {
+                               return method_info.DeclaringType;
+                       }
+               }
+
+               public MethodInfo EndMethodInfo {
+                       get {
+                               return end_method_info;
+                       }
+               }
+
+               public ParameterInfo[] InParameters {
+                       get {
+                               if (parameters == null)
+                                       ComputeParameters ();
+                               return in_parameters;
+                       }
+               }
+
+               public bool IsAsync {
+                       get {
+                               return end_method_info != null;
+                       }
+               }
+
+               public bool IsVoid {
+                       get {
+                               return ReturnType == typeof (void);
+                       }
+               }
+
+               public MethodInfo MethodInfo {
+                       get {
+                               return method_info;
+                       }
+               }
+
+               public string Name {
+                       get {
+                               return method_info.Name;
+                       }
+               }
+
+               void ComputeParameters ()
+               {
+                       ParameterInfo[] pars = method_info.GetParameters ();
+                       if (IsAsync)
+                       {
+                               parameters = new ParameterInfo [pars.Length - 2];
+                               Array.Copy (pars, 0, parameters, 0, pars.Length - 2);
+                               in_parameters = new ParameterInfo [parameters.Length];
+                               parameters.CopyTo (in_parameters, 0);
+                               
+                               ParameterInfo[] outPars = end_method_info.GetParameters ();
+                               out_parameters = new ParameterInfo [outPars.Length - 1];
+                               Array.Copy (outPars, 0, out_parameters, 0, out_parameters.Length);
+                       }
+                       else
+                       {
+                               parameters = pars;
+                               int out_count = 0;
+                               int in_count = 0;
+                               
+                               foreach (ParameterInfo p in parameters){
+                                       Type ptype = p.ParameterType;
+                                       if (ptype.IsByRef){
+                                               out_count++;
+                                               if (!p.IsOut)
+                                                       in_count++;
+                                       } else
+                                               in_count++;
+                               }
+                               out_parameters = new ParameterInfo [out_count];
+                               int i = 0;
+                               for (int j = 0; j < parameters.Length; j++){
+                                       if (parameters [j].ParameterType.IsByRef)
+                                               out_parameters [i++] = parameters [j];
+                               }
+                               in_parameters = new ParameterInfo [in_count];
+                               i = 0;
+                               for (int j = 0; j < parameters.Length; j++){
+                                       if (parameters [j].ParameterType.IsByRef){
+                                               if (!parameters [j].IsOut)
+                                                       in_parameters [i++] = parameters [j];
+                                       } else
+                                               in_parameters [i++] = parameters [j];
+                               }
+                       }
+               }
+               
+               public ParameterInfo[] OutParameters {
+                       get {
+                               if (parameters == null)
+                                       ComputeParameters ();
+                               return out_parameters;
+                       }
+               }
+
+               public ParameterInfo[] Parameters {
+                       get {
+                               if (parameters == null)
+                                       ComputeParameters ();
+                               return parameters;
+                       }
+               }
+
+               public Type ReturnType {
+                       get {
+                               if (IsAsync)
+                                       return end_method_info.ReturnType;
+                               else
+                                       return method_info.ReturnType;
+                       }
+               }
+
+               public ICustomAttributeProvider ReturnTypeCustomAttributeProvider {
+                       get {
+                               return method_info.ReturnTypeCustomAttributes;
+                       }
+               }
+
+               internal bool EnableSession {
+                       get {
+                               if (method_info == null)
+                                       return false;
+
+                               if (attribute == null) {
+                                       object [] o = method_info.GetCustomAttributes (false);
+                                       foreach (Attribute att in o) {
+                                               if (att is WebMethodAttribute) {
+                                                       attribute = (WebMethodAttribute) att;
+                                                       break;
+                                               }
+                                       }
+                               }
+
+                               return (attribute != null) ? attribute.EnableSession : false;
+                       }
+               }
+               #endregion // Properties
+
+               #region Methods
+
+               public IAsyncResult BeginInvoke (object target, object[] values, AsyncCallback callback, object asyncState)
+               {
+                       int len = (values!=null) ? values.Length : 0;
+                       object[] pars = new object [len + 2];
+                       
+                       if (len > 0)
+                               values.CopyTo (pars, 0);
+                       
+                       pars [len] = callback;
+                       pars [len+1] = asyncState;
+                               
+                       return (IAsyncResult) method_info.Invoke (target, pars);
+               }
+
+               public static LogicalMethodInfo[] Create (MethodInfo[] method_infos)
+               {
+                       return Create (method_infos, LogicalMethodTypes.Sync | LogicalMethodTypes.Async);
+               }
+
+               public static LogicalMethodInfo[] Create (MethodInfo[] method_infos, LogicalMethodTypes types)
+               {
+                       ArrayList sync = ((types & LogicalMethodTypes.Sync) != 0) ? new ArrayList () : null;
+                       ArrayList begin, end;
+
+                       if ((types & LogicalMethodTypes.Async) != 0){
+                               begin = new ArrayList ();
+                               end = new ArrayList ();
+                       } else 
+                               begin = end = null;
+
+                       foreach (MethodInfo mi in method_infos){
+                               if (IsBeginMethod (mi) && begin != null)
+                                       begin.Add (mi);
+                               else if (IsEndMethod (mi) && end != null)
+                                       end.Add (mi);
+                               else if (sync != null)
+                                       sync.Add (mi);
+                       }
+
+                       int bcount = 0, count = 0;
+                       if (begin != null){
+                               bcount = count = begin.Count;
+                               if (count != end.Count)
+                                       throw new InvalidOperationException ("Imbalance of begin/end methods");
+                       }
+                       if (sync != null)
+                               count += sync.Count;
+
+                       LogicalMethodInfo [] res = new LogicalMethodInfo [count];
+                       int dest = 0;
+                       if (begin != null){
+                               foreach (MethodInfo bm in begin){
+                                       string end_name = "End" + bm.Name.Substring (5);
+
+                                       for (int i = 0; i < bcount; i++){
+                                               MethodInfo em = (MethodInfo) end [i];
+                                               if (em.Name == end_name){
+                                                       res [dest++] = new LogicalMethodInfo (bm, em);
+                                                       break;
+                                               }
+                                               throw new InvalidOperationException ("Imbalance of begin/end methods");
+                                       }
+                               }
+                       }
+
+
+                       if (sync != null)
+                               foreach (MethodInfo mi in sync){
+                                       res [dest++] = new LogicalMethodInfo (mi);
+                               }
+                       
+                       return res;
+               }
+
+               public object[] EndInvoke (object target, IAsyncResult asyncResult)
+               {
+                       if (parameters == null)
+                               ComputeParameters ();
+
+                       object[] values = new object [out_parameters.Length + 1];
+                       values [values.Length - 1] = asyncResult;
+                       object res = end_method_info.Invoke (target, values);
+                       
+                       int retc = IsVoid ? 0 : 1;
+                       object [] ret = new object [retc + out_parameters.Length];
+                       
+                       if (retc == 1) ret [0] = res;
+                       
+                       Array.Copy (values, 0, ret, retc, out_parameters.Length);
+                       return ret;
+               }
+
+               public object GetCustomAttribute (Type type)
+               {
+                       return Attribute.GetCustomAttribute (method_info, type, false);
+               }
+
+               public object[] GetCustomAttributes (Type type)
+               {
+                       return method_info.GetCustomAttributes (type, false);
+               }
+
+               public object[] Invoke (object target, object[] values)
+               {
+                       if (parameters == null)
+                               ComputeParameters ();
+
+                       int retc = IsVoid ? 0 : 1;
+                       object [] ret = new object [retc + out_parameters.Length];
+                       object res = method_info.Invoke (target, values);
+                       if (retc == 1) ret [0] = res;
+
+                       int j = retc;
+                       for (int i = 0; i < parameters.Length; i++){
+                               if (parameters [i].ParameterType.IsByRef)
+                                       ret [j++] = values [i];
+                       }
+
+                       return ret;
+               }
+
+               public static bool IsBeginMethod (MethodInfo method_info)
+               {
+                       if (method_info == null)
+                               throw new ArgumentNullException ("method_info can not be null");
+
+                       if (method_info.ReturnType != typeof (IAsyncResult))
+                               return false;
+
+                       if (method_info.Name.StartsWith ("Begin"))
+                               return true;
+
+                       return false;
+               }
+
+               public static bool IsEndMethod (MethodInfo method_info)
+               {
+                       if (method_info == null)
+                               throw new ArgumentNullException ("method_info can not be null");
+
+                       ParameterInfo [] parameter_info = method_info.GetParameters ();
+                       if (parameter_info.Length != 1)
+                               return false;
+                       if (parameter_info [0].ParameterType != typeof (IAsyncResult))
+                               return false;
+                       if (method_info.Name.StartsWith ("End"))
+                               return true;
+
+                       return false;
+               }
+
+               public override string ToString ()
+               {
+                       StringBuilder sb = new StringBuilder ();
+                       if (parameters == null)
+                               ComputeParameters ();
+                       
+                       for (int i = 0; i < parameters.Length; i++){
+                               sb.Append (parameters [i].ParameterType);
+                               if (parameters [i].ParameterType.IsByRef)
+                                       sb.Append (" ByRef");
+                               
+                               if (i+1 != parameters.Length)
+                                       sb.Append (", ");
+                       }
+                       
+                       return String.Format (
+                               "{0} {1} ({2})",
+                               method_info.ReturnType, method_info.Name,
+                               sb.ToString ());
+               }
+
+               #endregion // Methods
+       }
+}
index 6cf251171e3431bc320facf2a9c3d8c4c8d23879..0655184b032fedd56104a34e0ef8436046b66636 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.LogicalMethodTypes.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.LogicalMethodTypes.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       public enum LogicalMethodTypes {\r
-               Async = 0x2,\r
-               Sync = 0x1\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       public enum LogicalMethodTypes {
+               Async = 0x2,
+               Sync = 0x1
+       }
+}
index b7fa1ca09d14995059d35dfa6e8f6becfafef0e6..5b7858be02223a5bace9fb2e4914c5bc776ab907 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.MatchAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.MatchAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.All, Inherited = true)]\r
-       public sealed class MatchAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               int capture;\r
-               int group;\r
-               bool ignoreCase;\r
-               int maxRepeats;\r
-               string pattern;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public MatchAttribute (string pattern) \r
-               {\r
-                       ignoreCase = false;\r
-                       maxRepeats = -1;\r
-                       this.pattern = pattern;\r
-                       group = 1;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public int Capture {\r
-                       get { return capture; }\r
-                       set { capture = value; }\r
-               }\r
-\r
-               public int Group {\r
-                       get { return group; }\r
-                       set { group = value; }\r
-               }\r
-\r
-               public bool IgnoreCase {\r
-                       get { return ignoreCase; }\r
-                       set { ignoreCase = value; }\r
-               }\r
-\r
-               public int MaxRepeats {\r
-                       get { return maxRepeats; }\r
-                       set { maxRepeats = value; }\r
-               }\r
-\r
-               public string Pattern {\r
-                       get { return pattern; }\r
-                       set { pattern = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.All, Inherited = true)]
+       public sealed class MatchAttribute : Attribute {
+
+               #region Fields
+
+               int capture;
+               int group;
+               bool ignoreCase;
+               int maxRepeats;
+               string pattern;
+
+               #endregion
+
+               #region Constructors
+
+               public MatchAttribute (string pattern) 
+               {
+                       ignoreCase = false;
+                       maxRepeats = -1;
+                       this.pattern = pattern;
+                       group = 1;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public int Capture {
+                       get { return capture; }
+                       set { capture = value; }
+               }
+
+               public int Group {
+                       get { return group; }
+                       set { group = value; }
+               }
+
+               public bool IgnoreCase {
+                       get { return ignoreCase; }
+                       set { ignoreCase = value; }
+               }
+
+               public int MaxRepeats {
+                       get { return maxRepeats; }
+                       set { maxRepeats = value; }
+               }
+
+               public string Pattern {
+                       get { return pattern; }
+                       set { pattern = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index aa0232d4dc3184af58c44d39ff90fc63fa6b9552..bc402f12ec2147535d84bfc3b1b90c25eb561d4b 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.MimeFormatter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.MimeFormatter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class MimeFormatter {\r
-\r
-               #region Constructors\r
-\r
-               protected MimeFormatter () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public static MimeFormatter CreateInstance (Type type, object initializer)\r
-               {\r
-                       MimeFormatter ob = (MimeFormatter) Activator.CreateInstance (type);\r
-                       ob.Initialize (initializer);\r
-                       return ob;\r
-               }\r
-\r
-               public abstract object GetInitializer (LogicalMethodInfo methodInfo);\r
-\r
-               public static object GetInitializer (Type type, LogicalMethodInfo methodInfo)\r
-               {\r
-                       MimeFormatter ob = (MimeFormatter) Activator.CreateInstance (type);\r
-                       return ob.GetInitializer (methodInfo);\r
-               }\r
-\r
-               public virtual object[] GetInitializers (LogicalMethodInfo[] methodInfos)\r
-               {\r
-                       object[] initializers = new object [methodInfos.Length];\r
-                       for (int n=0; n<methodInfos.Length; n++)\r
-                               initializers [n] = GetInitializer (methodInfos[n]);\r
-                               \r
-                       return initializers;\r
-               }\r
-\r
-               public static object[] GetInitializers (Type type, LogicalMethodInfo[] methodInfos)\r
-               {\r
-                       MimeFormatter ob = (MimeFormatter) Activator.CreateInstance (type);\r
-                       return ob.GetInitializers (methodInfos);\r
-               }\r
-\r
-               public abstract void Initialize (object initializer);   \r
-\r
-               internal static object StringToObj (Type type, string value)\r
+
+using System.Web.Services;
+using System.Xml;
+
+namespace System.Web.Services.Protocols {
+       public abstract class MimeFormatter {
+
+               #region Constructors
+
+               protected MimeFormatter () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public static MimeFormatter CreateInstance (Type type, object initializer)
+               {
+                       MimeFormatter ob = (MimeFormatter) Activator.CreateInstance (type);
+                       ob.Initialize (initializer);
+                       return ob;
+               }
+
+               public abstract object GetInitializer (LogicalMethodInfo methodInfo);
+
+               public static object GetInitializer (Type type, LogicalMethodInfo methodInfo)
+               {
+                       MimeFormatter ob = (MimeFormatter) Activator.CreateInstance (type);
+                       return ob.GetInitializer (methodInfo);
+               }
+
+               public virtual object[] GetInitializers (LogicalMethodInfo[] methodInfos)
+               {
+                       object[] initializers = new object [methodInfos.Length];
+                       for (int n=0; n<methodInfos.Length; n++)
+                               initializers [n] = GetInitializer (methodInfos[n]);
+                               
+                       return initializers;
+               }
+
+               public static object[] GetInitializers (Type type, LogicalMethodInfo[] methodInfos)
+               {
+                       MimeFormatter ob = (MimeFormatter) Activator.CreateInstance (type);
+                       return ob.GetInitializers (methodInfos);
+               }
+
+               public abstract void Initialize (object initializer);   
+
+               internal static object StringToObj (Type type, string value)
                {
                        if (type.IsEnum)
                                return Enum.Parse (type, value);
-                       \r
-                       switch (Type.GetTypeCode (type))\r
-                       {\r
-                               case TypeCode.Boolean: return XmlConvert.ToBoolean (value);\r
-                               case TypeCode.Byte: return XmlConvert.ToByte (value);\r
-                               case TypeCode.DateTime: return XmlConvert.ToDateTime (value);\r
-                               case TypeCode.Decimal: return XmlConvert.ToDecimal (value);\r
-                               case TypeCode.Double: return XmlConvert.ToDouble (value);\r
-                               case TypeCode.Int16: return XmlConvert.ToInt16 (value);\r
-                               case TypeCode.Int32: return XmlConvert.ToInt32 (value);\r
-                               case TypeCode.Int64: return XmlConvert.ToInt64 (value);\r
-                               case TypeCode.SByte: return XmlConvert.ToSByte (value);\r
-                               case TypeCode.Single: return XmlConvert.ToSingle (value);\r
-                               case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);\r
-                               case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);\r
-                               case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);\r
-                               case TypeCode.String: return value;\r
-                               case TypeCode.Char:\r
-                                       if (value.Length != 1) throw new InvalidOperationException ("Invalid char value");\r
-                                       return value [0];\r
-                       }\r
-                       throw new InvalidOperationException ("Type not supported");\r
-               }\r
-\r
-               internal static string ObjToString (object value)\r
-               {\r
-                       if (value == null) return "";\r
-                       switch (Type.GetTypeCode (value.GetType ()))\r
-                       {\r
-                               case TypeCode.Boolean: return XmlConvert.ToString ((bool)value);\r
-                               case TypeCode.Byte: return XmlConvert.ToString ((byte)value);\r
-                               case TypeCode.Char: return XmlConvert.ToString ((char)value);\r
-                               case TypeCode.DateTime: return XmlConvert.ToString ((DateTime)value);\r
-                               case TypeCode.Decimal: return XmlConvert.ToString ((decimal)value);\r
-                               case TypeCode.Double: return XmlConvert.ToString ((double)value);\r
-                               case TypeCode.Int16: return XmlConvert.ToString ((Int16)value);\r
-                               case TypeCode.Int32: return XmlConvert.ToString ((Int32)value);\r
-                               case TypeCode.Int64: return XmlConvert.ToString ((Int64)value);\r
-                               case TypeCode.SByte: return XmlConvert.ToString ((sbyte)value);\r
-                               case TypeCode.Single: return XmlConvert.ToString ((Single)value);\r
-                               case TypeCode.UInt16: return XmlConvert.ToString ((UInt16)value);\r
-                               case TypeCode.UInt32: return XmlConvert.ToString ((UInt32)value);\r
-                               case TypeCode.UInt64: return XmlConvert.ToString ((UInt64)value);\r
-                               case TypeCode.String: return value as string;\r
+                       
+                       switch (Type.GetTypeCode (type))
+                       {
+                               case TypeCode.Boolean: return XmlConvert.ToBoolean (value);
+                               case TypeCode.Byte: return XmlConvert.ToByte (value);
+                               case TypeCode.DateTime: return XmlConvert.ToDateTime (value);
+                               case TypeCode.Decimal: return XmlConvert.ToDecimal (value);
+                               case TypeCode.Double: return XmlConvert.ToDouble (value);
+                               case TypeCode.Int16: return XmlConvert.ToInt16 (value);
+                               case TypeCode.Int32: return XmlConvert.ToInt32 (value);
+                               case TypeCode.Int64: return XmlConvert.ToInt64 (value);
+                               case TypeCode.SByte: return XmlConvert.ToSByte (value);
+                               case TypeCode.Single: return XmlConvert.ToSingle (value);
+                               case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);
+                               case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);
+                               case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);
+                               case TypeCode.String: return value;
+                               case TypeCode.Char:
+                                       if (value.Length != 1) throw new InvalidOperationException ("Invalid char value");
+                                       return value [0];
+                       }
+                       throw new InvalidOperationException ("Type not supported");
+               }
+
+               internal static string ObjToString (object value)
+               {
+                       if (value == null) return "";
+                       switch (Type.GetTypeCode (value.GetType ()))
+                       {
+                               case TypeCode.Boolean: return XmlConvert.ToString ((bool)value);
+                               case TypeCode.Byte: return XmlConvert.ToString ((byte)value);
+                               case TypeCode.Char: return XmlConvert.ToString ((char)value);
+                               case TypeCode.DateTime: return XmlConvert.ToString ((DateTime)value);
+                               case TypeCode.Decimal: return XmlConvert.ToString ((decimal)value);
+                               case TypeCode.Double: return XmlConvert.ToString ((double)value);
+                               case TypeCode.Int16: return XmlConvert.ToString ((Int16)value);
+                               case TypeCode.Int32: return XmlConvert.ToString ((Int32)value);
+                               case TypeCode.Int64: return XmlConvert.ToString ((Int64)value);
+                               case TypeCode.SByte: return XmlConvert.ToString ((sbyte)value);
+                               case TypeCode.Single: return XmlConvert.ToString ((Single)value);
+                               case TypeCode.UInt16: return XmlConvert.ToString ((UInt16)value);
+                               case TypeCode.UInt32: return XmlConvert.ToString ((UInt32)value);
+                               case TypeCode.UInt64: return XmlConvert.ToString ((UInt64)value);
+                               case TypeCode.String: return value as string;
                        }
                        if (value.GetType().IsEnum)
                                return value.ToString ();
-\r
-                       throw new InvalidOperationException ("Type not supported");\r
-               }\r
-               \r
-               #endregion // Methods\r
-       }\r
+
+                       throw new InvalidOperationException ("Type not supported");
+               }
+               
+               #endregion // Methods
+       }
 }
index 6834f5c55c38fc85b422ad9dd1ab9644f0fb8384..29c56d5a9b1fe7c3bbeb14a73fde9aaaa67c0d2d 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.MimeParameterReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.MimeParameterReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class MimeParameterReader : MimeFormatter {\r
-\r
-               #region Constructors\r
-\r
-               protected MimeParameterReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public abstract object[] Read (HttpRequest request);\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Web;
+
+namespace System.Web.Services.Protocols {
+       public abstract class MimeParameterReader : MimeFormatter {
+
+               #region Constructors
+
+               protected MimeParameterReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public abstract object[] Read (HttpRequest request);
+
+               #endregion // Methods
+       }
+}
index fda3df1cc1e7a4a1f698a9ac1fa94b578b3dd297..4a6ba14d3123dd7e143a0828b4e005549983890f 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.MimeParameterWriter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.MimeParameterWriter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Net;\r
-using System.Text;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class MimeParameterWriter : MimeFormatter {\r
-\r
-               #region Constructors\r
-\r
-               protected MimeParameterWriter () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties \r
-\r
-               public virtual Encoding RequestEncoding {\r
-                       get { return null; }\r
-                       set { ; }\r
-               }\r
-\r
-               public virtual bool UsesWriteRequest {\r
-                       get { return false; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public virtual string GetRequestUrl (string url, object[] parameters)\r
-               {\r
-                       return url;\r
-               }\r
-\r
-               public virtual void InitializeRequest (WebRequest request, object[] values)\r
-               {\r
-               }\r
-\r
-               public virtual void WriteRequest (Stream requestStream, object[] values)\r
-               {\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.IO;
+using System.Net;
+using System.Text;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public abstract class MimeParameterWriter : MimeFormatter {
+
+               #region Constructors
+
+               protected MimeParameterWriter () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties 
+
+               public virtual Encoding RequestEncoding {
+                       get { return null; }
+                       set { ; }
+               }
+
+               public virtual bool UsesWriteRequest {
+                       get { return false; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public virtual string GetRequestUrl (string url, object[] parameters)
+               {
+                       return url;
+               }
+
+               public virtual void InitializeRequest (WebRequest request, object[] values)
+               {
+               }
+
+               public virtual void WriteRequest (Stream requestStream, object[] values)
+               {
+               }
+
+               #endregion // Methods
+       }
 }
index bba4a1847aecf74af732ebed724f7a50605b778a..05c4526922861490b2ebc2e3956dd66f93fe2406 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.MimeReturnReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.MimeReturnReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Net;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class MimeReturnReader : MimeFormatter {\r
-\r
-               #region Constructors\r
-\r
-               protected MimeReturnReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public abstract object Read (WebResponse response, Stream responseStream);\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.IO;
+using System.Net;
+
+namespace System.Web.Services.Protocols {
+       public abstract class MimeReturnReader : MimeFormatter {
+
+               #region Constructors
+
+               protected MimeReturnReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public abstract object Read (WebResponse response, Stream responseStream);
+
+               #endregion // Methods
+       }
+}
index 789fbfcda2d8e27671e403caec59cc1b3632e0e3..2c17ecf86e5372950aaf3f7f5877185c33337de9 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.MimeReturnWriter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.MimeReturnWriter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Web;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       internal abstract class MimeReturnWriter : MimeFormatter {\r
-\r
-               #region Methods \r
-\r
-               public abstract void Write (HttpResponse response, Stream outputStream, object returnValue);\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.IO;
+using System.Web;
+
+namespace System.Web.Services.Protocols {
+       internal abstract class MimeReturnWriter : MimeFormatter {
+
+               #region Methods 
+
+               public abstract void Write (HttpResponse response, Stream outputStream, object returnValue);
+
+               #endregion // Methods
+       }
+}
index 7de344b9f7b66bc49da22f22515eaf79720c4966..2c858d84d92362472626bdd69d4066c230dc3af1 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.NopReturnReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.NopReturnReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Net;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class NopReturnReader : MimeReturnReader {\r
-\r
-               #region Constructors\r
-\r
-               public NopReturnReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
-                       return this;\r
-               }\r
-\r
-               public override void Initialize (object initializer)\r
-               {\r
-               }\r
-\r
-               public override object Read (WebResponse response, Stream responseStream)\r
-               {\r
-                       responseStream.Close ();\r
-                       return null;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.IO;
+using System.Net;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class NopReturnReader : MimeReturnReader {
+
+               #region Constructors
+
+               public NopReturnReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
+                       return this;
+               }
+
+               public override void Initialize (object initializer)
+               {
+               }
+
+               public override object Read (WebResponse response, Stream responseStream)
+               {
+                       responseStream.Close ();
+                       return null;
+               }
+
+               #endregion // Methods
+       }
 }
index a1f4e1eb924dd0130333a44e4b62375d275da268..8d9c844c65691e97be96c476eb7853a1fc246267 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.PatternMatcher.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.PatternMatcher.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Reflection;\r
-using System.Text.RegularExpressions;\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Protocols \r
-{\r
-       public sealed class PatternMatcher \r
-       {\r
-               Type _returnType;\r
-               MatchInfo[] _matchInfos;\r
-               \r
-               public PatternMatcher (Type type) \r
-               {\r
-                       _returnType = type;\r
-                       \r
-                       FieldInfo[] fields = type.GetFields ();\r
-                       ArrayList matchInfos = new ArrayList ();\r
-                       \r
-                       foreach (FieldInfo field in fields)\r
-                       {\r
-                               object[] ats = field.GetCustomAttributes (typeof(MatchAttribute), true);\r
-                               if (ats.Length == 0) continue;\r
-                               \r
-                               MatchInfo mi = new MatchInfo ();\r
-                               mi.Field = field;\r
-                               mi.Match = (MatchAttribute) ats[0];\r
-                               \r
-                               RegexOptions opts = RegexOptions.Multiline;\r
-                               if (mi.Match.IgnoreCase) opts |= RegexOptions.IgnoreCase;\r
-                               mi.Regex = new Regex (mi.Match.Pattern, opts);\r
-                               \r
-                               matchInfos.Add (mi);\r
-                       }\r
-                       _matchInfos = (MatchInfo[]) matchInfos.ToArray (typeof(MatchInfo));\r
-               }\r
-               \r
-               public object Match (string text)\r
-               {\r
-                       object ob = Activator.CreateInstance (_returnType);\r
-                       \r
-                       foreach (MatchInfo mi in _matchInfos)\r
-                       {\r
-                               MatchCollection matches = mi.Regex.Matches (text);\r
-                               \r
-                               object res = null;\r
-                               \r
-                               if (mi.Field.FieldType.IsArray)\r
-                               {\r
-                                       int max = mi.Match.MaxRepeats;\r
-                                       if (max == -1) max = matches.Count;\r
-                                       \r
-                                       Type elemType = mi.Field.FieldType.GetElementType();\r
-                                       Array array = Array.CreateInstance (elemType, max);\r
-                                       for (int n=0; n<max; n++)\r
-                                               array.SetValue (mi.GetMatchValue (matches[n], elemType), n);\r
-                                       res = array;\r
-                               }\r
-                               else if (matches.Count > 0)\r
-                                       res = mi.GetMatchValue (matches[0], mi.Field.FieldType);\r
-                                       \r
-                               mi.Field.SetValue (ob, res);\r
-                       }\r
-                       return ob;\r
-               }\r
-\r
-       }\r
-\r
-       class MatchInfo\r
-       {\r
-               public FieldInfo Field;\r
-               public MatchAttribute Match;\r
-               public Regex Regex;\r
-               \r
-               const string GroupError = "{0} is not a valid group index for match '{1}'. The highest valid group index for this match is {2}";\r
-               const string CaptureError = "{0} is not a valid capture index for match '{1}'. The highest valid capture index for this match is {2}";\r
-               \r
-               public object GetMatchValue (Match match, Type castType)\r
-               {\r
-                       if (Match.Group >= match.Groups.Count)\r
-                               throw new Exception (string.Format (GroupError, Match.Group, Field.Name, match.Groups.Count-1));\r
-                               \r
-                       Group group = match.Groups [Match.Group];\r
-                       if (Match.Capture >= group.Captures.Count)\r
-                               throw new Exception (string.Format (CaptureError, Match.Capture, Field.Name, group.Captures.Count-1));\r
-                               \r
-                       string val = group.Captures [Match.Capture].Value;\r
-                       return Convert.ChangeType (val, castType);\r
-               }\r
-       }\r
-\r
-}\r
+
+using System.Web.Services;
+using System.Reflection;
+using System.Text.RegularExpressions;
+using System.Collections;
+
+namespace System.Web.Services.Protocols 
+{
+       public sealed class PatternMatcher 
+       {
+               Type _returnType;
+               MatchInfo[] _matchInfos;
+               
+               public PatternMatcher (Type type) 
+               {
+                       _returnType = type;
+                       
+                       FieldInfo[] fields = type.GetFields ();
+                       ArrayList matchInfos = new ArrayList ();
+                       
+                       foreach (FieldInfo field in fields)
+                       {
+                               object[] ats = field.GetCustomAttributes (typeof(MatchAttribute), true);
+                               if (ats.Length == 0) continue;
+                               
+                               MatchInfo mi = new MatchInfo ();
+                               mi.Field = field;
+                               mi.Match = (MatchAttribute) ats[0];
+                               
+                               RegexOptions opts = RegexOptions.Multiline;
+                               if (mi.Match.IgnoreCase) opts |= RegexOptions.IgnoreCase;
+                               mi.Regex = new Regex (mi.Match.Pattern, opts);
+                               
+                               matchInfos.Add (mi);
+                       }
+                       _matchInfos = (MatchInfo[]) matchInfos.ToArray (typeof(MatchInfo));
+               }
+               
+               public object Match (string text)
+               {
+                       object ob = Activator.CreateInstance (_returnType);
+                       
+                       foreach (MatchInfo mi in _matchInfos)
+                       {
+                               MatchCollection matches = mi.Regex.Matches (text);
+                               
+                               object res = null;
+                               
+                               if (mi.Field.FieldType.IsArray)
+                               {
+                                       int max = mi.Match.MaxRepeats;
+                                       if (max == -1) max = matches.Count;
+                                       
+                                       Type elemType = mi.Field.FieldType.GetElementType();
+                                       Array array = Array.CreateInstance (elemType, max);
+                                       for (int n=0; n<max; n++)
+                                               array.SetValue (mi.GetMatchValue (matches[n], elemType), n);
+                                       res = array;
+                               }
+                               else if (matches.Count > 0)
+                                       res = mi.GetMatchValue (matches[0], mi.Field.FieldType);
+                                       
+                               mi.Field.SetValue (ob, res);
+                       }
+                       return ob;
+               }
+
+       }
+
+       class MatchInfo
+       {
+               public FieldInfo Field;
+               public MatchAttribute Match;
+               public Regex Regex;
+               
+               const string GroupError = "{0} is not a valid group index for match '{1}'. The highest valid group index for this match is {2}";
+               const string CaptureError = "{0} is not a valid capture index for match '{1}'. The highest valid capture index for this match is {2}";
+               
+               public object GetMatchValue (Match match, Type castType)
+               {
+                       if (Match.Group >= match.Groups.Count)
+                               throw new Exception (string.Format (GroupError, Match.Group, Field.Name, match.Groups.Count-1));
+                               
+                       Group group = match.Groups [Match.Group];
+                       if (Match.Capture >= group.Captures.Count)
+                               throw new Exception (string.Format (CaptureError, Match.Capture, Field.Name, group.Captures.Count-1));
+                               
+                       string val = group.Captures [Match.Capture].Value;
+                       return Convert.ChangeType (val, castType);
+               }
+       }
+
+}
index a92c87418bd597bd17740db3454848f5028b8bd6..cd0b1ff24167be2fd3beec35cfbda134908da02f 100644 (file)
-// \r
-// System.Web.Services.Protocols.SoapClientMessage.cs\r
-//\r
-// Authors:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Miguel de Icaza (miguel@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-// Copyright (C) Ximian, Inc. 2003\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Web.Services;\r
-using System.Web.Services.Protocols;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public sealed class SoapClientMessage : SoapMessage {\r
-\r
-               #region Fields\r
-\r
-               SoapHttpClientProtocol client;\r
-               string url;\r
-               internal SoapMethodStubInfo MethodStubInfo;\r
-\r
-               //\r
-               // Expose this one internally\r
-               //\r
-               internal object [] Parameters;\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               //\r
-               // Constructs the SoapClientMessage\r
-               //\r
-               internal SoapClientMessage (SoapHttpClientProtocol client, SoapMethodStubInfo msi, string url, object [] parameters)\r
-               {\r
-                       this.MethodStubInfo = msi;\r
-                       this.client = client;\r
-                       this.url = url;\r
-                       Parameters = parameters;\r
-               }\r
-\r
-               #endregion \r
-\r
-               #region Properties\r
-\r
-               public override string Action {\r
-                       get { return MethodStubInfo.Action; }\r
-               }\r
-\r
-               public SoapHttpClientProtocol Client {\r
-                       get { return client; }\r
-               }\r
-\r
-               public override LogicalMethodInfo MethodInfo {\r
-                       get { return MethodStubInfo.MethodInfo; }\r
-               }\r
-\r
-               public override bool OneWay {\r
-                       get { return MethodStubInfo.OneWay; }\r
-               }\r
-\r
-               public override string Url {\r
-                       get { return url; }\r
-               }\r
-               \r
-#if NET_2_0\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public override SoapProtocolVersion SoapVersion {\r
-                       get { return client.SoapVersion; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               protected override void EnsureInStage ()\r
-               {\r
-                       EnsureStage (SoapMessageStage.BeforeSerialize);\r
-               }\r
-\r
-               protected override void EnsureOutStage ()\r
-               {\r
-                       EnsureStage (SoapMessageStage.AfterDeserialize);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+// 
+// System.Web.Services.Protocols.SoapClientMessage.cs
+//
+// Authors:
+//   Tim Coleman (tim@timcoleman.com)
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+// Copyright (C) Ximian, Inc. 2003
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Web.Services;
+using System.Web.Services.Protocols;
+
+namespace System.Web.Services.Protocols {
+       public sealed class SoapClientMessage : SoapMessage {
+
+               #region Fields
+
+               SoapHttpClientProtocol client;
+               string url;
+               internal SoapMethodStubInfo MethodStubInfo;
+
+               //
+               // Expose this one internally
+               //
+               internal object [] Parameters;
+               #endregion
+
+               #region Constructors
+
+               //
+               // Constructs the SoapClientMessage
+               //
+               internal SoapClientMessage (SoapHttpClientProtocol client, SoapMethodStubInfo msi, string url, object [] parameters)
+               {
+                       this.MethodStubInfo = msi;
+                       this.client = client;
+                       this.url = url;
+                       Parameters = parameters;
+               }
+
+               #endregion 
+
+               #region Properties
+
+               public override string Action {
+                       get { return MethodStubInfo.Action; }
+               }
+
+               public SoapHttpClientProtocol Client {
+                       get { return client; }
+               }
+
+               public override LogicalMethodInfo MethodInfo {
+                       get { return MethodStubInfo.MethodInfo; }
+               }
+
+               public override bool OneWay {
+                       get { return MethodStubInfo.OneWay; }
+               }
+
+               public override string Url {
+                       get { return url; }
+               }
+               
+#if NET_2_0
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public override SoapProtocolVersion SoapVersion {
+                       get { return client.SoapVersion; }
+               }
+#endif
+
+               #endregion // Properties
+
+               #region Methods
+
+               protected override void EnsureInStage ()
+               {
+                       EnsureStage (SoapMessageStage.BeforeSerialize);
+               }
+
+               protected override void EnsureOutStage ()
+               {
+                       EnsureStage (SoapMessageStage.AfterDeserialize);
+               }
+
+               #endregion // Methods
+       }
+}
index dc00073f7f8656dac419ec46f1ced0b9cf4da784..443cb46836566fa93d89dba9066e31d2b437f56a 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapClientMethod.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapClientMethod.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.Web.Services.Description;\r
-\r
-namespace System.Web.Services.Protocols {\r
-\r
-       internal class SoapClientMethod {\r
-\r
-               #region Fields\r
-\r
-               public string action;\r
-               public LogicalMethodInfo methodInfo;\r
-               public bool oneWay;\r
-               public bool rpc;\r
-               public SoapBindingUse use;\r
-\r
-               #endregion // Fields\r
-       }\r
-}\r
+
+using System.Web.Services;
+using System.Web.Services.Description;
+
+namespace System.Web.Services.Protocols {
+
+       internal class SoapClientMethod {
+
+               #region Fields
+
+               public string action;
+               public LogicalMethodInfo methodInfo;
+               public bool oneWay;
+               public bool rpc;
+               public SoapBindingUse use;
+
+               #endregion // Fields
+       }
+}
index b70fb603467c9fde6c6427611414bf4ba87c83a8..0539c2ab007c550d5db991d839f48393e55356d8 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapDocumentMethodAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapDocumentMethodAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Description;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.Method, Inherited = true)]\r
-       public sealed class SoapDocumentMethodAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               string action;\r
-               string binding;\r
-               bool oneWay;\r
-               SoapParameterStyle parameterStyle;\r
-               string requestElementName;\r
-               string requestNamespace;\r
-               string responseElementName;\r
-               string responseNamespace;\r
-               SoapBindingUse use;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public SoapDocumentMethodAttribute () \r
-               {\r
-               }\r
-\r
-               public SoapDocumentMethodAttribute (string action)\r
-                       : this ()\r
-               {\r
-                       this.action = action;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Action {\r
-                       get { return action; }\r
-                       set { action = value; }\r
-               }\r
-\r
-               public string Binding {\r
-                       get {\r
-                               if (binding != null)\r
-                                       return binding;\r
-                               return "";\r
-                       }\r
-                       set { binding = value; }\r
-               }\r
-\r
-               public bool OneWay {\r
-                       get { return oneWay; }\r
-                       set { oneWay = value; }\r
-               }\r
-\r
-               public SoapParameterStyle ParameterStyle {\r
-                       get { return parameterStyle; }\r
-                       set { parameterStyle = value; }\r
-               }\r
-\r
-               public string RequestElementName {\r
-                       get {\r
-                               if (requestElementName == null)\r
-                                       return "";\r
-                               return requestElementName;\r
-                       }\r
-                       set { requestElementName = value; }\r
-               }\r
-\r
-               public string RequestNamespace {\r
-                       get {\r
-                               if (requestNamespace == null)\r
-                                       return "";\r
-                               \r
-                               return requestNamespace;\r
-                       }\r
-                       set { requestNamespace = value; }\r
-               }\r
-\r
-               public string ResponseElementName {\r
-                       get {\r
-                               if (responseElementName == null)\r
-                                       return "";\r
-                               return responseElementName;\r
-                       }\r
-                       set { responseElementName = value; }\r
-               }\r
-\r
-               public string ResponseNamespace {\r
-                       get {\r
-                               if (responseNamespace == null)\r
-                                       return "";\r
-                               return responseNamespace;\r
-                       }\r
-                       set { responseNamespace = value; }\r
-               }\r
-\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Description;
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.Method, Inherited = true)]
+       public sealed class SoapDocumentMethodAttribute : Attribute {
+
+               #region Fields
+
+               string action;
+               string binding;
+               bool oneWay;
+               SoapParameterStyle parameterStyle;
+               string requestElementName;
+               string requestNamespace;
+               string responseElementName;
+               string responseNamespace;
+               SoapBindingUse use;
+
+               #endregion
+
+               #region Constructors
+
+               public SoapDocumentMethodAttribute () 
+               {
+               }
+
+               public SoapDocumentMethodAttribute (string action)
+                       : this ()
+               {
+                       this.action = action;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public string Action {
+                       get { return action; }
+                       set { action = value; }
+               }
+
+               public string Binding {
+                       get {
+                               if (binding != null)
+                                       return binding;
+                               return "";
+                       }
+                       set { binding = value; }
+               }
+
+               public bool OneWay {
+                       get { return oneWay; }
+                       set { oneWay = value; }
+               }
+
+               public SoapParameterStyle ParameterStyle {
+                       get { return parameterStyle; }
+                       set { parameterStyle = value; }
+               }
+
+               public string RequestElementName {
+                       get {
+                               if (requestElementName == null)
+                                       return "";
+                               return requestElementName;
+                       }
+                       set { requestElementName = value; }
+               }
+
+               public string RequestNamespace {
+                       get {
+                               if (requestNamespace == null)
+                                       return "";
+                               
+                               return requestNamespace;
+                       }
+                       set { requestNamespace = value; }
+               }
+
+               public string ResponseElementName {
+                       get {
+                               if (responseElementName == null)
+                                       return "";
+                               return responseElementName;
+                       }
+                       set { responseElementName = value; }
+               }
+
+               public string ResponseNamespace {
+                       get {
+                               if (responseNamespace == null)
+                                       return "";
+                               return responseNamespace;
+                       }
+                       set { responseNamespace = value; }
+               }
+
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index adf20c74706c1d439776a7489eecb46221f04d9c..651bde96e03aab2ff1a6bc7a34f96e41c5530f86 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapDocumentServiceAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapDocumentServiceAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Description;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.Class, Inherited = true)]\r
-       public sealed class SoapDocumentServiceAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               SoapParameterStyle paramStyle;\r
-               SoapServiceRoutingStyle routingStyle;\r
-               SoapBindingUse use;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public SoapDocumentServiceAttribute () \r
-               {\r
-                       paramStyle = SoapParameterStyle.Wrapped;\r
-                       routingStyle = SoapServiceRoutingStyle.SoapAction;\r
-                       use = SoapBindingUse.Literal;\r
-               }\r
-\r
-               public SoapDocumentServiceAttribute (SoapBindingUse use) \r
-                       : this ()\r
-               {\r
-                       this.use = use;\r
-               }\r
-\r
-               public SoapDocumentServiceAttribute (SoapBindingUse use, SoapParameterStyle paramStyle) \r
-                       : this ()\r
-               {\r
-                       this.use = use;\r
-                       this.paramStyle = paramStyle;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public SoapParameterStyle ParameterStyle {\r
-                       get { return paramStyle; }\r
-                       set { paramStyle = value; }\r
-               }\r
-\r
-               public SoapServiceRoutingStyle RoutingStyle {\r
-                       get { return routingStyle; }\r
-                       set { routingStyle = value; }\r
-               }\r
-\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Description;
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.Class, Inherited = true)]
+       public sealed class SoapDocumentServiceAttribute : Attribute {
+
+               #region Fields
+
+               SoapParameterStyle paramStyle;
+               SoapServiceRoutingStyle routingStyle;
+               SoapBindingUse use;
+
+               #endregion
+
+               #region Constructors
+
+               public SoapDocumentServiceAttribute () 
+               {
+                       paramStyle = SoapParameterStyle.Wrapped;
+                       routingStyle = SoapServiceRoutingStyle.SoapAction;
+                       use = SoapBindingUse.Literal;
+               }
+
+               public SoapDocumentServiceAttribute (SoapBindingUse use) 
+                       : this ()
+               {
+                       this.use = use;
+               }
+
+               public SoapDocumentServiceAttribute (SoapBindingUse use, SoapParameterStyle paramStyle) 
+                       : this ()
+               {
+                       this.use = use;
+                       this.paramStyle = paramStyle;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public SoapParameterStyle ParameterStyle {
+                       get { return paramStyle; }
+                       set { paramStyle = value; }
+               }
+
+               public SoapServiceRoutingStyle RoutingStyle {
+                       get { return routingStyle; }
+                       set { routingStyle = value; }
+               }
+
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index b328464b423f00ac1fd047cf4258bb5afefdd78a..7624421c9ae64584fe14d28acbfd8d07ad3e4972 100644 (file)
-// \r
-// System.Web.Services.Protocols.SoapException.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@novell.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.IO;\r
-using System.Runtime.Serialization;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Protocols \r
-{\r
-#if NET_2_0\r
-       [Serializable]\r
-#endif\r
-       public class SoapException : SystemException \r
-       {\r
-               #region Fields\r
-\r
-               public static readonly XmlQualifiedName ClientFaultCode = new XmlQualifiedName ("Client", "http://schemas.xmlsoap.org/soap/envelope/");\r
-               public static readonly XmlQualifiedName DetailElementName = new XmlQualifiedName ("detail");\r
-               public static readonly XmlQualifiedName MustUnderstandFaultCode = new XmlQualifiedName ("MustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/");\r
-               public static readonly XmlQualifiedName ServerFaultCode = new XmlQualifiedName ("Server", "http://schemas.xmlsoap.org/soap/envelope/");\r
-               public static readonly XmlQualifiedName VersionMismatchFaultCode = new XmlQualifiedName ("VersionMismatch", "http://schemas.xmlsoap.org/soap/envelope/");\r
-\r
-               string actor;\r
-               XmlQualifiedName code;\r
-               XmlNode detail;\r
-               \r
-#if NET_2_0\r
-               string lang;\r
-               string role;\r
-               SoapFaultSubCode subcode;\r
-#endif\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-#if NET_2_0\r
-               public SoapException ()\r
-                       : this ("SOAP error", XmlQualifiedName.Empty)\r
-               {\r
-               }\r
-#endif\r
-\r
-               public SoapException (string message, XmlQualifiedName code)\r
-                       : base (message)\r
-               {\r
-                       this.code = code;\r
-               }\r
-\r
-               public SoapException (string message, XmlQualifiedName code, Exception innerException)\r
-                       : base (message, innerException)\r
-               {\r
-                       this.code = code;\r
-               }\r
-\r
-               public SoapException (string message, XmlQualifiedName code, string actor)\r
-                       : base (message)\r
-               {\r
-                       this.code = code;\r
-                       this.actor = actor;\r
-               }\r
-\r
-               public SoapException (string message, XmlQualifiedName code, string actor, Exception innerException)\r
-                       : base (message, innerException)\r
-               {\r
-                       this.code = code;\r
-                       this.actor = actor;\r
-               }\r
-\r
-               public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail)\r
-                       : base (message)\r
-               {\r
-                       this.code = code;\r
-                       this.actor = actor;\r
-                       this.detail = detail;\r
-               }\r
-\r
-               public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail, Exception innerException)\r
-                       : base (message, innerException)\r
-               {\r
-                       this.code = code;\r
-                       this.actor = actor;\r
-                       this.detail = detail;\r
-               }\r
-\r
-#if NET_2_0\r
-               public SoapException (string message, XmlQualifiedName code, SoapFaultSubCode subcode)\r
-                       : base (message)\r
-               {\r
-                       this.code = code;\r
-                       this.subcode = subcode;\r
-               }\r
-               \r
-               public SoapException (string message, XmlQualifiedName code, string actor, string role, XmlNode detail, SoapFaultSubCode subcode, Exception innerException)\r
-                       : base (message, innerException)\r
-               {\r
-                       this.code = code;\r
-                       this.subcode = subcode;\r
-                       this.detail = detail;\r
-                       this.actor = actor;\r
-                       this.role = role;\r
-               }\r
-               \r
-               public SoapException (string message, XmlQualifiedName code, string actor, string role, string lang, XmlNode detail, SoapFaultSubCode subcode, Exception innerException)\r
-               {\r
-                       this.code = code;\r
-                       this.subcode = subcode;\r
-                       this.detail = detail;\r
-                       this.actor = actor;\r
-                       this.role = role;\r
-                       this.lang = lang;\r
-               }\r
-\r
-#if NET_2_0\r
-               protected SoapException (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       actor = info.GetString ("actor");\r
-                       code = (XmlQualifiedName) info.GetValue ("code", typeof (XmlQualifiedName));\r
-                       detail = new XmlDocument ().ReadNode (\r
-                               XmlReader.Create (new StringReader (info.GetString ("detailString"))));\r
-                       lang = info.GetString ("lang");\r
-                       role = info.GetString ("role");\r
-                       subcode = (SoapFaultSubCode) info.GetValue ("subcode", typeof (SoapFaultSubCode));\r
-               }\r
-\r
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       base.GetObjectData (info, context);\r
-                       info.AddValue ("actor", actor);\r
-                       info.AddValue ("code", code);\r
-                       info.AddValue ("detailString", detail.OuterXml);\r
-                       info.AddValue ("lang", lang);\r
-                       info.AddValue ("role", role);\r
-                       info.AddValue ("subcode", subcode);\r
-               }\r
-#endif\r
-\r
-               public static bool IsClientFaultCode (XmlQualifiedName code)\r
-               {\r
-                       if (code == ClientFaultCode) return true;\r
-                       if (code == Soap12FaultCodes.SenderFaultCode) return true;\r
-                       return false;\r
-               }\r
-\r
-               public static bool IsMustUnderstandFaultCode (XmlQualifiedName code)\r
-               {\r
-                       if (code == MustUnderstandFaultCode) return true;\r
-                       if (code == Soap12FaultCodes.MustUnderstandFaultCode) return true;\r
-                       return false;\r
-               }\r
-                               \r
-               public static bool IsServerFaultCode (XmlQualifiedName code)\r
-               {\r
-                       if (code == ServerFaultCode) return true;\r
-                       if (code == Soap12FaultCodes.ReceiverFaultCode) return true;\r
-                       return false;\r
-               }\r
-                               \r
-               public static bool IsVersionMismatchFaultCode (XmlQualifiedName code)\r
-               {\r
-                       if (code == VersionMismatchFaultCode) return true;\r
-                       if (code == Soap12FaultCodes.VersionMismatchFaultCode) return true;\r
-                       return false;\r
-               }\r
-\r
-#endif\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Actor {\r
-                       get { return actor; }\r
-               }\r
-\r
-               public XmlQualifiedName Code {\r
-                       get { return code; }\r
-               }\r
-\r
-               public XmlNode Detail {\r
-                       get { return detail; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public string Lang {\r
-                       get { return lang; }\r
-               }\r
-               \r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public string Role {\r
-                       get { return role; }\r
-               }\r
-               \r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public SoapFaultSubCode SubCode {\r
-                       get { return subcode; }\r
-               }\r
-               \r
-               // Same value as actor\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public string Node {\r
-                       get { return actor; }\r
-               }\r
-#endif\r
-               #endregion // Properties\r
-       }\r
-}\r
+// 
+// System.Web.Services.Protocols.SoapException.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@novell.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.IO;
+using System.Runtime.Serialization;
+using System.Xml;
+
+namespace System.Web.Services.Protocols 
+{
+#if NET_2_0
+       [Serializable]
+#endif
+       public class SoapException : SystemException 
+       {
+               #region Fields
+
+               public static readonly XmlQualifiedName ClientFaultCode = new XmlQualifiedName ("Client", "http://schemas.xmlsoap.org/soap/envelope/");
+               public static readonly XmlQualifiedName DetailElementName = new XmlQualifiedName ("detail");
+               public static readonly XmlQualifiedName MustUnderstandFaultCode = new XmlQualifiedName ("MustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/");
+               public static readonly XmlQualifiedName ServerFaultCode = new XmlQualifiedName ("Server", "http://schemas.xmlsoap.org/soap/envelope/");
+               public static readonly XmlQualifiedName VersionMismatchFaultCode = new XmlQualifiedName ("VersionMismatch", "http://schemas.xmlsoap.org/soap/envelope/");
+
+               string actor;
+               XmlQualifiedName code;
+               XmlNode detail;
+               
+#if NET_2_0
+               string lang;
+               string role;
+               SoapFaultSubCode subcode;
+#endif
+               #endregion
+
+               #region Constructors
+
+#if NET_2_0
+               public SoapException ()
+                       : this ("SOAP error", XmlQualifiedName.Empty)
+               {
+               }
+#endif
+
+               public SoapException (string message, XmlQualifiedName code)
+                       : base (message)
+               {
+                       this.code = code;
+               }
+
+               public SoapException (string message, XmlQualifiedName code, Exception innerException)
+                       : base (message, innerException)
+               {
+                       this.code = code;
+               }
+
+               public SoapException (string message, XmlQualifiedName code, string actor)
+                       : base (message)
+               {
+                       this.code = code;
+                       this.actor = actor;
+               }
+
+               public SoapException (string message, XmlQualifiedName code, string actor, Exception innerException)
+                       : base (message, innerException)
+               {
+                       this.code = code;
+                       this.actor = actor;
+               }
+
+               public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail)
+                       : base (message)
+               {
+                       this.code = code;
+                       this.actor = actor;
+                       this.detail = detail;
+               }
+
+               public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail, Exception innerException)
+                       : base (message, innerException)
+               {
+                       this.code = code;
+                       this.actor = actor;
+                       this.detail = detail;
+               }
+
+#if NET_2_0
+               public SoapException (string message, XmlQualifiedName code, SoapFaultSubCode subcode)
+                       : base (message)
+               {
+                       this.code = code;
+                       this.subcode = subcode;
+               }
+               
+               public SoapException (string message, XmlQualifiedName code, string actor, string role, XmlNode detail, SoapFaultSubCode subcode, Exception innerException)
+                       : base (message, innerException)
+               {
+                       this.code = code;
+                       this.subcode = subcode;
+                       this.detail = detail;
+                       this.actor = actor;
+                       this.role = role;
+               }
+               
+               public SoapException (string message, XmlQualifiedName code, string actor, string role, string lang, XmlNode detail, SoapFaultSubCode subcode, Exception innerException)
+               {
+                       this.code = code;
+                       this.subcode = subcode;
+                       this.detail = detail;
+                       this.actor = actor;
+                       this.role = role;
+                       this.lang = lang;
+               }
+
+#if NET_2_0
+               protected SoapException (SerializationInfo info, StreamingContext context)
+               {
+                       actor = info.GetString ("actor");
+                       code = (XmlQualifiedName) info.GetValue ("code", typeof (XmlQualifiedName));
+                       detail = new XmlDocument ().ReadNode (
+                               XmlReader.Create (new StringReader (info.GetString ("detailString"))));
+                       lang = info.GetString ("lang");
+                       role = info.GetString ("role");
+                       subcode = (SoapFaultSubCode) info.GetValue ("subcode", typeof (SoapFaultSubCode));
+               }
+
+               public override void GetObjectData (SerializationInfo info, StreamingContext context)
+               {
+                       base.GetObjectData (info, context);
+                       info.AddValue ("actor", actor);
+                       info.AddValue ("code", code);
+                       info.AddValue ("detailString", detail.OuterXml);
+                       info.AddValue ("lang", lang);
+                       info.AddValue ("role", role);
+                       info.AddValue ("subcode", subcode);
+               }
+#endif
+
+               public static bool IsClientFaultCode (XmlQualifiedName code)
+               {
+                       if (code == ClientFaultCode) return true;
+                       if (code == Soap12FaultCodes.SenderFaultCode) return true;
+                       return false;
+               }
+
+               public static bool IsMustUnderstandFaultCode (XmlQualifiedName code)
+               {
+                       if (code == MustUnderstandFaultCode) return true;
+                       if (code == Soap12FaultCodes.MustUnderstandFaultCode) return true;
+                       return false;
+               }
+                               
+               public static bool IsServerFaultCode (XmlQualifiedName code)
+               {
+                       if (code == ServerFaultCode) return true;
+                       if (code == Soap12FaultCodes.ReceiverFaultCode) return true;
+                       return false;
+               }
+                               
+               public static bool IsVersionMismatchFaultCode (XmlQualifiedName code)
+               {
+                       if (code == VersionMismatchFaultCode) return true;
+                       if (code == Soap12FaultCodes.VersionMismatchFaultCode) return true;
+                       return false;
+               }
+
+#endif
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public string Actor {
+                       get { return actor; }
+               }
+
+               public XmlQualifiedName Code {
+                       get { return code; }
+               }
+
+               public XmlNode Detail {
+                       get { return detail; }
+               }
+
+#if NET_2_0
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public string Lang {
+                       get { return lang; }
+               }
+               
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public string Role {
+                       get { return role; }
+               }
+               
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public SoapFaultSubCode SubCode {
+                       get { return subcode; }
+               }
+               
+               // Same value as actor
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public string Node {
+                       get { return actor; }
+               }
+#endif
+               #endregion // Properties
+       }
+}
index bbd0b4c07b81ea7797367c96fb5ac3d19d3718a4..e26d602a525f844fc4d708673887e1a88627eac6 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapExtension.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapExtension.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Collections;\r
-using System.Web.Services.Configuration;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class SoapExtension {\r
-\r
-               #region Fields\r
-\r
-               Stream stream;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               protected SoapExtension ()\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public virtual Stream ChainStream (Stream stream)\r
-               {\r
-                       return stream;\r
-               }\r
-\r
-               public abstract object GetInitializer (Type serviceType);\r
-               public abstract object GetInitializer (LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute);\r
-               public abstract void Initialize (object initializer);\r
-               public abstract void ProcessMessage (SoapMessage message);\r
-\r
-\r
+
+using System.IO;
+using System.Collections;
+using System.Web.Services.Configuration;
+
+namespace System.Web.Services.Protocols {
+       public abstract class SoapExtension {
+
+               #region Fields
+
+               Stream stream;
+
+               #endregion
+
+               #region Constructors
+
+               protected SoapExtension ()
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Methods
+
+               public virtual Stream ChainStream (Stream stream)
+               {
+                       return stream;
+               }
+
+               public abstract object GetInitializer (Type serviceType);
+               public abstract object GetInitializer (LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute);
+               public abstract void Initialize (object initializer);
+               public abstract void ProcessMessage (SoapMessage message);
+
+
 #if !TARGET_JVM
-               static ArrayList[] globalExtensions;\r
+               static ArrayList[] globalExtensions;
 #else
                static ArrayList[] globalExtensions {
                        get {
@@ -74,159 +74,159 @@ namespace System.Web.Services.Protocols {
                        }
                }
 #endif
-\r
-               internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs)\r
-               {\r
-                       if (extensionConfigs == null) return null;\r
-                       SoapExtension[] res = new SoapExtension [extensionConfigs.Length];\r
-                       CreateExtensionChain (extensionConfigs, res, 0);\r
-                       return res;\r
-               }\r
-\r
-               internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] hiPrioExts, SoapExtensionRuntimeConfig[] medPrioExts, SoapExtensionRuntimeConfig[] lowPrioExts)\r
-               {\r
-                       int len = 0;\r
-                       if (hiPrioExts != null) len += hiPrioExts.Length;\r
-                       if (medPrioExts != null) len += medPrioExts.Length;\r
-                       if (lowPrioExts != null) len += lowPrioExts.Length;\r
-                       if (len == 0) return null;\r
-\r
-                       SoapExtension[] res = new SoapExtension [len];\r
-                       int pos = 0;\r
-                       if (hiPrioExts != null) pos = CreateExtensionChain (hiPrioExts, res, pos);\r
-                       if (medPrioExts != null) pos = CreateExtensionChain (medPrioExts, res, pos);\r
-                       if (lowPrioExts != null) pos = CreateExtensionChain (lowPrioExts, res, pos);\r
-                       return res;\r
-               }\r
-\r
-               static int CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs, SoapExtension[] destArray, int pos)\r
-               {\r
-                       for (int n=0; n<extensionConfigs.Length; n++)\r
-                       {\r
-                               SoapExtensionRuntimeConfig econf = extensionConfigs [n];\r
-                               SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);\r
-                               ext.Initialize (econf.InitializationInfo);\r
-                               destArray [pos++] = ext;\r
-                       }\r
-                       return pos;\r
-               }\r
-\r
-               static void InitializeGlobalExtensions ()\r
-               {\r
-                       globalExtensions = new ArrayList[2];\r
-                       \r
+
+               internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs)
+               {
+                       if (extensionConfigs == null) return null;
+                       SoapExtension[] res = new SoapExtension [extensionConfigs.Length];
+                       CreateExtensionChain (extensionConfigs, res, 0);
+                       return res;
+               }
+
+               internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] hiPrioExts, SoapExtensionRuntimeConfig[] medPrioExts, SoapExtensionRuntimeConfig[] lowPrioExts)
+               {
+                       int len = 0;
+                       if (hiPrioExts != null) len += hiPrioExts.Length;
+                       if (medPrioExts != null) len += medPrioExts.Length;
+                       if (lowPrioExts != null) len += lowPrioExts.Length;
+                       if (len == 0) return null;
+
+                       SoapExtension[] res = new SoapExtension [len];
+                       int pos = 0;
+                       if (hiPrioExts != null) pos = CreateExtensionChain (hiPrioExts, res, pos);
+                       if (medPrioExts != null) pos = CreateExtensionChain (medPrioExts, res, pos);
+                       if (lowPrioExts != null) pos = CreateExtensionChain (lowPrioExts, res, pos);
+                       return res;
+               }
+
+               static int CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs, SoapExtension[] destArray, int pos)
+               {
+                       for (int n=0; n<extensionConfigs.Length; n++)
+                       {
+                               SoapExtensionRuntimeConfig econf = extensionConfigs [n];
+                               SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);
+                               ext.Initialize (econf.InitializationInfo);
+                               destArray [pos++] = ext;
+                       }
+                       return pos;
+               }
+
+               static void InitializeGlobalExtensions ()
+               {
+                       globalExtensions = new ArrayList[2];
+                       
 #if NET_2_0
-                       SoapExtensionTypeElementCollection exts = WebServicesSection.Instance.SoapExtensionTypes;\r
+                       SoapExtensionTypeElementCollection exts = WebServicesSection.Instance.SoapExtensionTypes;
 #else
-                       ArrayList exts = WSConfig.Instance.ExtensionTypes;\r
-                       if (exts == null) return;\r
+                       ArrayList exts = WSConfig.Instance.ExtensionTypes;
+                       if (exts == null) return;
 #endif
-\r
+
 #if NET_2_0
-                       foreach (SoapExtensionTypeElement econf in exts)\r
+                       foreach (SoapExtensionTypeElement econf in exts)
 #else
-                       foreach (WSExtensionConfig econf in exts)\r
+                       foreach (WSExtensionConfig econf in exts)
 #endif
-                       {\r
-                               if (globalExtensions [(int)econf.Group] == null) globalExtensions [(int)econf.Group] = new ArrayList ();\r
-                               ArrayList destList = globalExtensions [(int) econf.Group];\r
-                               bool added = false;\r
-                               for (int n=0; n<destList.Count && !added; n++)\r
+                       {
+                               if (globalExtensions [(int)econf.Group] == null) globalExtensions [(int)econf.Group] = new ArrayList ();
+                               ArrayList destList = globalExtensions [(int) econf.Group];
+                               bool added = false;
+                               for (int n=0; n<destList.Count && !added; n++)
 #if NET_2_0
-                                       if (((SoapExtensionTypeElement)destList [n]).Priority > econf.Priority) {\r
+                                       if (((SoapExtensionTypeElement)destList [n]).Priority > econf.Priority) {
 #else
-                                       if (((WSExtensionConfig)destList [n]).Priority > econf.Priority) {\r
+                                       if (((WSExtensionConfig)destList [n]).Priority > econf.Priority) {
 #endif
-                                               destList.Insert (n, econf);\r
-                                               added = true;\r
-                                       }\r
-                               if (!added) destList.Add (econf);\r
-                       }\r
-               }\r
-\r
-               internal static SoapExtensionRuntimeConfig[][] GetTypeExtensions (Type serviceType)\r
-               {\r
-                       if (globalExtensions == null) InitializeGlobalExtensions();\r
-                       \r
-                       SoapExtensionRuntimeConfig[][] exts = new SoapExtensionRuntimeConfig[2][];\r
-\r
-                       for (int group = 0; group < 2; group++)\r
-                       {\r
-                               ArrayList globList = globalExtensions[group];\r
-                               if (globList == null) continue;\r
-                               exts [group] = new SoapExtensionRuntimeConfig [globList.Count];\r
-                               for (int n=0; n<globList.Count; n++)\r
-                               {\r
+                                               destList.Insert (n, econf);
+                                               added = true;
+                                       }
+                               if (!added) destList.Add (econf);
+                       }
+               }
+
+               internal static SoapExtensionRuntimeConfig[][] GetTypeExtensions (Type serviceType)
+               {
+                       if (globalExtensions == null) InitializeGlobalExtensions();
+                       
+                       SoapExtensionRuntimeConfig[][] exts = new SoapExtensionRuntimeConfig[2][];
+
+                       for (int group = 0; group < 2; group++)
+                       {
+                               ArrayList globList = globalExtensions[group];
+                               if (globList == null) continue;
+                               exts [group] = new SoapExtensionRuntimeConfig [globList.Count];
+                               for (int n=0; n<globList.Count; n++)
+                               {
 #if NET_2_0
-                                       SoapExtensionTypeElement econf = (SoapExtensionTypeElement) globList [n];\r
+                                       SoapExtensionTypeElement econf = (SoapExtensionTypeElement) globList [n];
 #else
-                                       WSExtensionConfig econf = (WSExtensionConfig) globList [n];\r
+                                       WSExtensionConfig econf = (WSExtensionConfig) globList [n];
 #endif
-                                       SoapExtensionRuntimeConfig typeconf = new SoapExtensionRuntimeConfig ();\r
-                                       typeconf.Type = econf.Type;\r
-                                       SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);\r
-                                       typeconf.InitializationInfo = ext.GetInitializer (serviceType);\r
-                                       exts [group][n] = typeconf;\r
-                               }\r
-                       }\r
-                       return exts;\r
-               }\r
-\r
-               internal static SoapExtensionRuntimeConfig[] GetMethodExtensions (LogicalMethodInfo method)\r
-               {\r
-                       object[] ats = method.GetCustomAttributes (typeof (SoapExtensionAttribute));\r
-                       SoapExtensionRuntimeConfig[] exts = new SoapExtensionRuntimeConfig [ats.Length];\r
-                       int[] priorities = new int[ats.Length];\r
-\r
-                       for (int n=0; n<ats.Length; n++)\r
-                       {\r
-                               SoapExtensionAttribute at = (SoapExtensionAttribute) ats[n];\r
-                               SoapExtensionRuntimeConfig econf = new SoapExtensionRuntimeConfig ();\r
-                               econf.Type = at.ExtensionType;\r
-                               priorities [n] = at.Priority;\r
-                               SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);\r
-                               econf.InitializationInfo = ext.GetInitializer (method, at);\r
-                               exts [n] = econf;\r
-                       }\r
-                       Array.Sort (priorities, exts);\r
-                       return exts;\r
-               }\r
-\r
-               internal static Stream ExecuteChainStream (SoapExtension[] extensions, Stream stream)\r
-               {\r
-                       if (extensions == null) return stream;\r
-\r
-                       Stream newStream = stream;\r
-                       foreach (SoapExtension ext in extensions)\r
-                               newStream = ext.ChainStream (newStream);\r
-                       return newStream;\r
-               }\r
-\r
-               internal static void ExecuteProcessMessage(SoapExtension[] extensions, SoapMessage message, Stream stream, bool inverseOrder) \r
-               {\r
-                       if (extensions == null) return;\r
-\r
-                       message.InternalStream = stream;\r
-\r
-                       if (inverseOrder)\r
-                       {\r
-                               for (int n = extensions.Length-1; n >= 0; n--)\r
-                                       extensions[n].ProcessMessage (message);\r
-                       }\r
-                       else\r
-                       {\r
-                               for (int n = 0; n < extensions.Length; n++)\r
-                                       extensions[n].ProcessMessage (message);\r
-                       }\r
+                                       SoapExtensionRuntimeConfig typeconf = new SoapExtensionRuntimeConfig ();
+                                       typeconf.Type = econf.Type;
+                                       SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);
+                                       typeconf.InitializationInfo = ext.GetInitializer (serviceType);
+                                       exts [group][n] = typeconf;
+                               }
+                       }
+                       return exts;
+               }
+
+               internal static SoapExtensionRuntimeConfig[] GetMethodExtensions (LogicalMethodInfo method)
+               {
+                       object[] ats = method.GetCustomAttributes (typeof (SoapExtensionAttribute));
+                       SoapExtensionRuntimeConfig[] exts = new SoapExtensionRuntimeConfig [ats.Length];
+                       int[] priorities = new int[ats.Length];
+
+                       for (int n=0; n<ats.Length; n++)
+                       {
+                               SoapExtensionAttribute at = (SoapExtensionAttribute) ats[n];
+                               SoapExtensionRuntimeConfig econf = new SoapExtensionRuntimeConfig ();
+                               econf.Type = at.ExtensionType;
+                               priorities [n] = at.Priority;
+                               SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);
+                               econf.InitializationInfo = ext.GetInitializer (method, at);
+                               exts [n] = econf;
+                       }
+                       Array.Sort (priorities, exts);
+                       return exts;
+               }
+
+               internal static Stream ExecuteChainStream (SoapExtension[] extensions, Stream stream)
+               {
+                       if (extensions == null) return stream;
+
+                       Stream newStream = stream;
+                       foreach (SoapExtension ext in extensions)
+                               newStream = ext.ChainStream (newStream);
+                       return newStream;
+               }
+
+               internal static void ExecuteProcessMessage(SoapExtension[] extensions, SoapMessage message, Stream stream, bool inverseOrder) 
+               {
+                       if (extensions == null) return;
+
+                       message.InternalStream = stream;
+
+                       if (inverseOrder)
+                       {
+                               for (int n = extensions.Length-1; n >= 0; n--)
+                                       extensions[n].ProcessMessage (message);
+                       }
+                       else
+                       {
+                               for (int n = 0; n < extensions.Length; n++)
+                                       extensions[n].ProcessMessage (message);
+                       }
                }
-\r
-               #endregion // Methods\r
-       }\r
-\r
-       internal class SoapExtensionRuntimeConfig\r
-       {\r
-               public Type Type;\r
-               public int Priority;\r
-               public object InitializationInfo;\r
-       }\r
+
+               #endregion // Methods
+       }
+
+       internal class SoapExtensionRuntimeConfig
+       {
+               public Type Type;
+               public int Priority;
+               public object InitializationInfo;
+       }
 }
index 8dc5f1db03eab173975ae7cdb52590706f8b6ba0..cad033820c866acb365b063e76f160a719f18912 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapExtensionAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapExtensionAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class SoapExtensionAttribute : Attribute {\r
-\r
-               #region Constructors\r
-\r
-               protected SoapExtensionAttribute () \r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public abstract Type ExtensionType {\r
-                       get;\r
-               }\r
-\r
-               public abstract int Priority {\r
-                       get;\r
-                       set;\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       public abstract class SoapExtensionAttribute : Attribute {
+
+               #region Constructors
+
+               protected SoapExtensionAttribute () 
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public abstract Type ExtensionType {
+                       get;
+               }
+
+               public abstract int Priority {
+                       get;
+                       set;
+               }
+
+               #endregion // Properties
+       }
+}
index eadfb9e1d0dc8d4e1028a00d593bde0298044f66..648de319be97137bd4bb99bd32839fe060f58d4b 100644 (file)
-// \r
-// System.Web.Services.Protocols.SoapHeader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.ComponentModel;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       [SoapType (IncludeInSchema = false)]\r
-       [XmlType (IncludeInSchema = false)]\r
-       public abstract class SoapHeader {\r
-\r
-               #region Fields\r
-\r
-               string actor;\r
-               bool didUnderstand;\r
-               bool mustUnderstand;\r
-               \r
-#if NET_2_0\r
-               string role;\r
-               bool relay;\r
-#endif\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               protected SoapHeader ()\r
-               {\r
-                       actor = String.Empty; \r
-                       didUnderstand = false;\r
-                       mustUnderstand = false;\r
-               }\r
-\r
-               internal SoapHeader (XmlElement elem)\r
-               {\r
-                       actor = elem.GetAttribute ("actor", WebServiceHelper.SoapEnvelopeNamespace);\r
-                       string me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.SoapEnvelopeNamespace);\r
-                       if (me != "") EncodedMustUnderstand = me;\r
-#if NET_2_0\r
-                       role = elem.GetAttribute ("role", WebServiceHelper.Soap12EnvelopeNamespace);\r
-                       me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.Soap12EnvelopeNamespace);\r
-                       if (me != "") EncodedMustUnderstand12 = me;\r
-#endif\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue ("")]\r
-               [SoapAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]\r
-               [XmlAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]\r
-               public string Actor {   \r
-                       get { return actor; }\r
-                       set { actor = value; }\r
-               }\r
-\r
-               [SoapIgnore]\r
-               [XmlIgnore]\r
-               public bool DidUnderstand {\r
-                       get { return didUnderstand; }\r
-                       set { didUnderstand = value; }\r
-               }\r
-\r
-               [DefaultValue ("0")]\r
-               [SoapAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]\r
-               [XmlAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]\r
-               public string EncodedMustUnderstand {\r
-                       get { return (MustUnderstand ? "1" : "0"); }\r
-                       set {   \r
-                               if (value == "true" || value == "1") \r
-                                       MustUnderstand = true;\r
-                               else if (value == "false" || value == "0")\r
-                                       MustUnderstand = false;\r
-                               else\r
-                                       throw new ArgumentException ();\r
-                       }\r
-               }\r
-\r
-               [SoapIgnore]\r
-               [XmlIgnore]\r
-               public bool MustUnderstand {\r
-                       get { return mustUnderstand; }\r
-                       set { mustUnderstand = value; }\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               [DefaultValue ("0")]\r
-               [SoapAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]\r
-               [XmlAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public string EncodedMustUnderstand12 {\r
-                       get { return (MustUnderstand ? "1" : "0"); }\r
-                       set {   \r
-                               if (value == "true" || value == "1") \r
-                                       MustUnderstand = true;\r
-                               else if (value == "false" || value == "0")\r
-                                       MustUnderstand = false;\r
-                               else\r
-                                       throw new ArgumentException ();\r
-                       }\r
-               }\r
-\r
-               [DefaultValue ("0")]\r
-               [SoapAttribute ("relay", Namespace = "http://www.w3.org/2003/05/soap-envelope")]\r
-               [XmlAttribute ("relay", Namespace = "http://www.w3.org/2003/05/soap-envelope")]\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public string EncodedRelay\r
-               {\r
-                       get { return (Relay ? "1" : "0"); }\r
-                       set {   \r
-                               if (value == "true" || value == "1") \r
-                                       Relay = true;\r
-                               else if (value == "false" || value == "0")\r
-                                       Relay = false;\r
-                               else\r
-                                       throw new ArgumentException ();\r
-                       }\r
-               }\r
-               \r
-               [SoapIgnore]\r
-               [XmlIgnore]\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public bool Relay {\r
-                       get { return relay; }\r
-                       set { relay = value; }\r
-               }\r
-               \r
-               [DefaultValue ("")]\r
-               [SoapAttribute ("role", Namespace = "http://www.w3.org/2003/05/soap-envelope")]\r
-               [XmlAttribute ("role", Namespace = "http://www.w3.org/2003/05/soap-envelope")]\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public string Role {\r
-                       get { return role; }\r
-                       set { role = value; }\r
-               }\r
-               \r
-#endif\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+// 
+// System.Web.Services.Protocols.SoapHeader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.Xml.Serialization;
+using System.Xml;
+
+namespace System.Web.Services.Protocols {
+       [SoapType (IncludeInSchema = false)]
+       [XmlType (IncludeInSchema = false)]
+       public abstract class SoapHeader {
+
+               #region Fields
+
+               string actor;
+               bool didUnderstand;
+               bool mustUnderstand;
+               
+#if NET_2_0
+               string role;
+               bool relay;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+
+               protected SoapHeader ()
+               {
+                       actor = String.Empty; 
+                       didUnderstand = false;
+                       mustUnderstand = false;
+               }
+
+               internal SoapHeader (XmlElement elem)
+               {
+                       actor = elem.GetAttribute ("actor", WebServiceHelper.SoapEnvelopeNamespace);
+                       string me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.SoapEnvelopeNamespace);
+                       if (me != "") EncodedMustUnderstand = me;
+#if NET_2_0
+                       role = elem.GetAttribute ("role", WebServiceHelper.Soap12EnvelopeNamespace);
+                       me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.Soap12EnvelopeNamespace);
+                       if (me != "") EncodedMustUnderstand12 = me;
+#endif
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue ("")]
+               [SoapAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
+               [XmlAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
+               public string Actor {   
+                       get { return actor; }
+                       set { actor = value; }
+               }
+
+               [SoapIgnore]
+               [XmlIgnore]
+               public bool DidUnderstand {
+                       get { return didUnderstand; }
+                       set { didUnderstand = value; }
+               }
+
+               [DefaultValue ("0")]
+               [SoapAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
+               [XmlAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
+               public string EncodedMustUnderstand {
+                       get { return (MustUnderstand ? "1" : "0"); }
+                       set {   
+                               if (value == "true" || value == "1") 
+                                       MustUnderstand = true;
+                               else if (value == "false" || value == "0")
+                                       MustUnderstand = false;
+                               else
+                                       throw new ArgumentException ();
+                       }
+               }
+
+               [SoapIgnore]
+               [XmlIgnore]
+               public bool MustUnderstand {
+                       get { return mustUnderstand; }
+                       set { mustUnderstand = value; }
+               }
+               
+#if NET_2_0
+
+               [DefaultValue ("0")]
+               [SoapAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
+               [XmlAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public string EncodedMustUnderstand12 {
+                       get { return (MustUnderstand ? "1" : "0"); }
+                       set {   
+                               if (value == "true" || value == "1") 
+                                       MustUnderstand = true;
+                               else if (value == "false" || value == "0")
+                                       MustUnderstand = false;
+                               else
+                                       throw new ArgumentException ();
+                       }
+               }
+
+               [DefaultValue ("0")]
+               [SoapAttribute ("relay", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
+               [XmlAttribute ("relay", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public string EncodedRelay
+               {
+                       get { return (Relay ? "1" : "0"); }
+                       set {   
+                               if (value == "true" || value == "1") 
+                                       Relay = true;
+                               else if (value == "false" || value == "0")
+                                       Relay = false;
+                               else
+                                       throw new ArgumentException ();
+                       }
+               }
+               
+               [SoapIgnore]
+               [XmlIgnore]
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public bool Relay {
+                       get { return relay; }
+                       set { relay = value; }
+               }
+               
+               [DefaultValue ("")]
+               [SoapAttribute ("role", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
+               [XmlAttribute ("role", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public string Role {
+                       get { return role; }
+                       set { role = value; }
+               }
+               
+#endif
+
+               #endregion // Properties
+       }
+}
index 45b260ce3eab57b89ec622fed8439577d1d0dda5..88719295f15b1e0f818b16d33ebf883efa36aa2c 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapHeaderAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapHeaderAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.Method, AllowMultiple = true, Inherited = true)]\r
-       public sealed class SoapHeaderAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               SoapHeaderDirection direction;\r
-               string memberName;\r
-               bool required;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public SoapHeaderAttribute (string memberName) \r
-               {\r
-                       direction = SoapHeaderDirection.In;\r
-                       this.memberName = memberName;\r
-                       required = true;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public SoapHeaderDirection Direction {\r
-                       get { return direction; }\r
-                       set { direction = value; }\r
-               }\r
-\r
-               public string MemberName {      \r
-                       get { return memberName; }\r
-                       set { memberName = value; }\r
-               }\r
-\r
-#if NET_1_1\r
-               [Obsolete ("This property will be removed from a future"\r
-                       + " version. The presence of a particular header"\r
-                       + " in a SOAP message is no longer enforced", false)]\r
-#endif\r
-               public bool Required {\r
-                       get { return required; }\r
-                       set { required = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
+       public sealed class SoapHeaderAttribute : Attribute {
+
+               #region Fields
+
+               SoapHeaderDirection direction;
+               string memberName;
+               bool required;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public SoapHeaderAttribute (string memberName) 
+               {
+                       direction = SoapHeaderDirection.In;
+                       this.memberName = memberName;
+                       required = true;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public SoapHeaderDirection Direction {
+                       get { return direction; }
+                       set { direction = value; }
+               }
+
+               public string MemberName {      
+                       get { return memberName; }
+                       set { memberName = value; }
+               }
+
+#if NET_1_1
+               [Obsolete ("This property will be removed from a future"
+                       + " version. The presence of a particular header"
+                       + " in a SOAP message is no longer enforced", false)]
+#endif
+               public bool Required {
+                       get { return required; }
+                       set { required = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index e9608e1a28522f1f2ff1fa746367654d3d6f2d51..3c6b52ef52a41c73495e124323a5af6bd48d103e 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapHeaderCollection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapHeaderCollection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class SoapHeaderCollection : CollectionBase {\r
-\r
-               #region Constructors\r
-\r
-               public SoapHeaderCollection ()\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public SoapHeader this [int index] {\r
-                       get { return (SoapHeader) List[index]; }\r
-                       set { List[index] = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public int Add (SoapHeader header)\r
-               {\r
-                       Insert (Count, header);\r
-                       return (Count - 1);\r
-               }\r
-\r
-               public bool Contains (SoapHeader header)\r
-               {\r
-                       return List.Contains (header);\r
-               }\r
-\r
-               public void CopyTo (SoapHeader[] array, int index)\r
-               {\r
-                       List.CopyTo (array, index);\r
-               }\r
-\r
-               public int IndexOf (SoapHeader header)\r
-               {\r
-                       return List.IndexOf (header);\r
-               }\r
-\r
-               public void Insert (int index, SoapHeader header)\r
-               {\r
-                       if (index < 0 || index > Count)\r
-                               throw new ArgumentOutOfRangeException ();\r
-                       List.Insert (index, header);\r
-               }\r
-\r
-               public void Remove (SoapHeader header)\r
-               {\r
-                       List.Remove (header);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+
+using System.Collections;
+
+namespace System.Web.Services.Protocols {
+       public class SoapHeaderCollection : CollectionBase {
+
+               #region Constructors
+
+               public SoapHeaderCollection ()
+               {
+               }
+
+               #endregion
+
+               #region Properties
+
+               public SoapHeader this [int index] {
+                       get { return (SoapHeader) List[index]; }
+                       set { List[index] = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public int Add (SoapHeader header)
+               {
+                       Insert (Count, header);
+                       return (Count - 1);
+               }
+
+               public bool Contains (SoapHeader header)
+               {
+                       return List.Contains (header);
+               }
+
+               public void CopyTo (SoapHeader[] array, int index)
+               {
+                       List.CopyTo (array, index);
+               }
+
+               public int IndexOf (SoapHeader header)
+               {
+                       return List.IndexOf (header);
+               }
+
+               public void Insert (int index, SoapHeader header)
+               {
+                       if (index < 0 || index > Count)
+                               throw new ArgumentOutOfRangeException ();
+                       List.Insert (index, header);
+               }
+
+               public void Remove (SoapHeader header)
+               {
+                       List.Remove (header);
+               }
+
+               #endregion // Methods
+       }
+}
index c6ce4a3ac369bfaf18213f7ef40fe85b9ddecede..c21f8ff83a132a3cb59e0de9454029e6e0a5daee 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapHeaderDirection.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapHeaderDirection.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       [Flags]\r
-       public enum SoapHeaderDirection {\r
-               In = 0x1,\r
-               InOut = 0x3,\r
-               Out = 0x2,\r
-#if NET_1_1\r
-               Fault = 0x4\r
-#endif\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       [Flags]
+       public enum SoapHeaderDirection {
+               In = 0x1,
+               InOut = 0x3,
+               Out = 0x2,
+#if NET_1_1
+               Fault = 0x4
+#endif
+       }
+}
index 829e48a82c7d2467a117bbdd4ac8e77054a445d0..6e4236a2f7a2298e4eb77556c43685ab055563bd 100644 (file)
-// \r
-// System.Web.Services.Protocols.SoapHeaderException.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Runtime.Serialization;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Protocols \r
-{\r
-#if NET_2_0\r
-       [Serializable]\r
-#endif\r
-       public class SoapHeaderException : SoapException {\r
-\r
-               #region Constructors\r
-\r
-#if NET_2_0\r
-               public SoapHeaderException ()\r
-                       : this ("SOAP header error", XmlQualifiedName.Empty)\r
-               {\r
-               }\r
-#endif\r
-\r
-               public SoapHeaderException (string message, XmlQualifiedName code)\r
-                       : base (message, code)\r
-               {\r
-               }\r
-\r
-               public SoapHeaderException (string message, XmlQualifiedName code, Exception innerException)\r
-                       : base (message, code, innerException)\r
-               {\r
-               }\r
-\r
-               public SoapHeaderException (string message, XmlQualifiedName code, string actor)\r
-                       : base (message, code, actor)\r
-               {\r
-               }\r
-\r
-               public SoapHeaderException (string message, XmlQualifiedName code, string actor, Exception innerException)\r
-                       : base (message, code, actor, innerException)\r
-               {\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               public SoapHeaderException (\r
-                       string message, \r
-                       XmlQualifiedName code, \r
-                       string actor, \r
-                       string role, \r
-                       string lang, \r
-                       SoapFaultSubCode subcode, \r
-                       Exception innerException)\r
-                       \r
-               : base (message, code, actor, role, lang, null, subcode, innerException)\r
-               {\r
-                       \r
-               }\r
-\r
-               public SoapHeaderException (\r
-                       string message, \r
-                       XmlQualifiedName code, \r
-                       string actor, \r
-                       string role, \r
-                       SoapFaultSubCode subcode, \r
-                       Exception innerException)\r
-                       \r
-               : base (message, code, actor, role, null, subcode, innerException)\r
-               {\r
-                       \r
-               }\r
-\r
-               protected SoapHeaderException (SerializationInfo info, StreamingContext context)\r
-                       : base (info, context)\r
-               {\r
-               }\r
-#endif\r
-\r
-               #endregion // Constructors\r
-       }\r
-}\r
+// 
+// System.Web.Services.Protocols.SoapHeaderException.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Runtime.Serialization;
+using System.Xml;
+
+namespace System.Web.Services.Protocols 
+{
+#if NET_2_0
+       [Serializable]
+#endif
+       public class SoapHeaderException : SoapException {
+
+               #region Constructors
+
+#if NET_2_0
+               public SoapHeaderException ()
+                       : this ("SOAP header error", XmlQualifiedName.Empty)
+               {
+               }
+#endif
+
+               public SoapHeaderException (string message, XmlQualifiedName code)
+                       : base (message, code)
+               {
+               }
+
+               public SoapHeaderException (string message, XmlQualifiedName code, Exception innerException)
+                       : base (message, code, innerException)
+               {
+               }
+
+               public SoapHeaderException (string message, XmlQualifiedName code, string actor)
+                       : base (message, code, actor)
+               {
+               }
+
+               public SoapHeaderException (string message, XmlQualifiedName code, string actor, Exception innerException)
+                       : base (message, code, actor, innerException)
+               {
+               }
+               
+#if NET_2_0
+
+               public SoapHeaderException (
+                       string message, 
+                       XmlQualifiedName code, 
+                       string actor, 
+                       string role, 
+                       string lang, 
+                       SoapFaultSubCode subcode, 
+                       Exception innerException)
+                       
+               : base (message, code, actor, role, lang, null, subcode, innerException)
+               {
+                       
+               }
+
+               public SoapHeaderException (
+                       string message, 
+                       XmlQualifiedName code, 
+                       string actor, 
+                       string role, 
+                       SoapFaultSubCode subcode, 
+                       Exception innerException)
+                       
+               : base (message, code, actor, role, null, subcode, innerException)
+               {
+                       
+               }
+
+               protected SoapHeaderException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
+               {
+               }
+#endif
+
+               #endregion // Constructors
+       }
+}
index 5a5cf0aa7d49347f3d45a1b80e4104f9e150f03b..9376a87a1beb1c560c1bd4dc433bdac8c0583686 100644 (file)
-// \r
-// System.Web.Services.Protocols.SoapHttpClientProtocol.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Miguel de Icaza (miguel@ximian.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-// Copyright (C) Ximian, Inc, 2003\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.ComponentModel;\r
-using System.IO;\r
-using System.Net;\r
-using System.Web;\r
-using System.Xml;\r
-using System.Text;\r
-using System.Reflection;\r
-using System.Web.Services;\r
-using System.Diagnostics;\r
-using System.Runtime.CompilerServices;\r
-using System.Web.Services.Description;\r
-using System.Web.Services.Discovery;\r
-using System.Xml.Serialization;\r
-using System.Xml.Schema;\r
-using System.Collections;\r
-using System.Threading;\r
-\r
-namespace System.Web.Services.Protocols \r
-{\r
-#if NET_2_0\r
-       [System.Runtime.InteropServices.ComVisible (true)]\r
-#endif\r
-       public class SoapHttpClientProtocol : HttpWebClientProtocol \r
-       {\r
-               SoapTypeStubInfo type_info;\r
-#if NET_2_0\r
-               SoapProtocolVersion soapVersion;\r
-#endif\r
-\r
-               #region SoapWebClientAsyncResult class\r
-\r
-               internal class SoapWebClientAsyncResult: WebClientAsyncResult\r
-               {\r
-                       public SoapWebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)\r
-                       : base (request, callback, asyncState)\r
-                       {\r
-                       }\r
-               \r
-                       public SoapClientMessage Message;\r
-                       public SoapExtension[] Extensions;\r
-               }\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public SoapHttpClientProtocol () \r
-               {\r
-                       type_info = (SoapTypeStubInfo) TypeStubManager.GetTypeStub (this.GetType (), "Soap");\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               protected IAsyncResult BeginInvoke (string methodName, object[] parameters, AsyncCallback callback, object asyncState)\r
-               {\r
-                       SoapMethodStubInfo msi = (SoapMethodStubInfo) type_info.GetMethod (methodName);\r
-\r
-                       SoapWebClientAsyncResult ainfo = null;\r
-                       try\r
-                       {\r
-                               SoapClientMessage message = new SoapClientMessage (this, msi, Url, parameters);\r
-                               message.CollectHeaders (this, message.MethodStubInfo.Headers, SoapHeaderDirection.In);\r
-                               \r
-                               WebRequest request = GetRequestForMessage (uri, message);\r
-                               \r
-                               ainfo = new SoapWebClientAsyncResult (request, callback, asyncState);\r
-                               ainfo.Message = message;\r
-                               ainfo.Extensions = SoapExtension.CreateExtensionChain (type_info.SoapExtensions[0], msi.SoapExtensions, type_info.SoapExtensions[1]);\r
-\r
-                               ainfo.Request.BeginGetRequestStream (new AsyncCallback (AsyncGetRequestStreamDone), ainfo);\r
-                       }\r
-                       catch (Exception ex)\r
-                       {\r
-                               if (ainfo != null)\r
-                                       ainfo.SetCompleted (null, ex, false);\r
-                       }\r
-\r
-                       return ainfo;\r
-               }\r
-\r
-               void AsyncGetRequestStreamDone (IAsyncResult ar)\r
-               {\r
-                       SoapWebClientAsyncResult ainfo = (SoapWebClientAsyncResult) ar.AsyncState;\r
-                       try\r
-                       {\r
-                               SendRequest (ainfo.Request.EndGetRequestStream (ar), ainfo.Message, ainfo.Extensions);\r
-                               ainfo.Request.BeginGetResponse (new AsyncCallback (AsyncGetResponseDone), ainfo);\r
-                       }\r
-                       catch (Exception ex)\r
-                       {\r
-                               ainfo.SetCompleted (null, ex, true);\r
-                       }\r
-               }\r
-\r
-               void AsyncGetResponseDone (IAsyncResult ar)\r
-               {\r
-                       SoapWebClientAsyncResult ainfo = (SoapWebClientAsyncResult) ar.AsyncState;\r
-                       WebResponse response = null;\r
-\r
-                       try {\r
-                               response = GetWebResponse (ainfo.Request, ar);\r
-                       }\r
-                       catch (WebException ex) {\r
-                               response = ex.Response;\r
-                               HttpWebResponse http_response = response as HttpWebResponse;\r
-                               if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError) {\r
-                                       ainfo.SetCompleted (null, ex, true);\r
-                                       return;\r
-                               }\r
-                       }\r
-                       catch (Exception ex) {\r
-                               ainfo.SetCompleted (null, ex, true);\r
-                               return;\r
-                       }\r
-\r
-                       try {\r
-                               object[] result = ReceiveResponse (response, ainfo.Message, ainfo.Extensions);\r
-                               ainfo.SetCompleted (result, null, true);\r
-                       }\r
-                       catch (Exception ex) {\r
-                               ainfo.SetCompleted (null, ex, true);\r
-                       }\r
-                       finally {\r
-                               response.Close();\r
-                       }\r
-               }\r
-\r
-               protected object[] EndInvoke (IAsyncResult asyncResult)\r
-               {\r
-                       if (!(asyncResult is SoapWebClientAsyncResult)) throw new ArgumentException ("asyncResult is not the return value from BeginInvoke");\r
-\r
-                       SoapWebClientAsyncResult ainfo = (SoapWebClientAsyncResult) asyncResult;\r
-                       lock (ainfo)\r
-                       {\r
-                               if (!ainfo.IsCompleted) ainfo.WaitForComplete ();\r
-                               if (ainfo.Exception != null) throw ainfo.Exception;\r
-                               else return (object[]) ainfo.Result;\r
-                       }\r
-               }\r
-\r
-               public void Discover ()\r
-               {\r
-                       BindingInfo bnd = (BindingInfo) type_info.Bindings [0];\r
-                       \r
-                       DiscoveryClientProtocol discoverer = new DiscoveryClientProtocol ();\r
-                       discoverer.Discover (Url);\r
-                       \r
-                       foreach (object info in discoverer.AdditionalInformation)\r
-                       {\r
-                               System.Web.Services.Discovery.SoapBinding sb = info as System.Web.Services.Discovery.SoapBinding;\r
-                               if (sb != null && sb.Binding.Name == bnd.Name && sb.Binding.Namespace == bnd.Namespace) {\r
-                                       Url = sb.Address;\r
-                                       return;\r
-                               }\r
-                       }\r
-                       \r
-                       string msg = string.Format ("The binding named '{0}' from namespace '{1}' was not found in the discovery document at '{2}'", bnd.Name, bnd.Namespace, Url);\r
-                       throw new Exception (msg);\r
-               }\r
-\r
-               protected override WebRequest GetWebRequest (Uri uri)\r
-               {\r
-                       return base.GetWebRequest (uri);\r
-               }\r
-\r
-               WebRequest GetRequestForMessage (Uri uri, SoapClientMessage message)\r
-               {\r
-                       WebRequest request = GetWebRequest (uri);\r
-                       request.Method = "POST";\r
-                       WebHeaderCollection headers = request.Headers;\r
-                       headers.Add ("SOAPAction", "\"" + message.Action + "\"");\r
-                       request.ContentType = message.ContentType + "; charset=utf-8";\r
-                       return request;\r
-               }\r
-               \r
-               void SendRequest (Stream s, SoapClientMessage message, SoapExtension[] extensions)\r
-               {\r
-                       using (s) {\r
-\r
-                               if (extensions != null) {\r
-                                       s = SoapExtension.ExecuteChainStream (extensions, s);\r
-                                       message.SetStage (SoapMessageStage.BeforeSerialize);\r
-                                       SoapExtension.ExecuteProcessMessage (extensions, message, s, true);\r
-                               }\r
-\r
-                               XmlTextWriter xtw = WebServiceHelper.CreateXmlWriter (s);\r
-#if NET_2_0\r
-                               bool soap12 = message.SoapVersion == SoapProtocolVersion.Soap12;\r
-#else\r
-                               bool soap12 = false;\r
-#endif\r
-                               WebServiceHelper.WriteSoapMessage (xtw, message.MethodStubInfo, SoapHeaderDirection.In, message.Parameters, message.Headers, soap12);\r
-\r
-                               if (extensions != null) {\r
-                                       message.SetStage (SoapMessageStage.AfterSerialize);\r
-                                       SoapExtension.ExecuteProcessMessage (extensions, message, s, true);\r
-                               }\r
-\r
-                               xtw.Flush ();\r
-                               xtw.Close ();\r
-                        }\r
-               }\r
-\r
-\r
-               //\r
-               // TODO:\r
-               //    Handle other web responses (multi-output?)\r
-               //    \r
-               object [] ReceiveResponse (WebResponse response, SoapClientMessage message, SoapExtension[] extensions)\r
-               {\r
-                       SoapMethodStubInfo msi = message.MethodStubInfo;\r
-                       HttpWebResponse http_response = response as HttpWebResponse;\r
-                       \r
-                       if (http_response != null)\r
-                       {\r
-                               HttpStatusCode code = http_response.StatusCode;\r
-       \r
-                               if (!(code == HttpStatusCode.Accepted || code == HttpStatusCode.OK || code == HttpStatusCode.InternalServerError)) {\r
-                                       string msg = "The request failed with HTTP status {0}: {1}";\r
-                                       msg = String.Format (msg, (int) code, code);\r
-                                       throw new WebException (msg, null, WebExceptionStatus.ProtocolError, http_response);\r
-                               }\r
-                               if (message.OneWay && response.ContentLength <= 0 && (code == HttpStatusCode.Accepted || code == HttpStatusCode.OK)) {\r
-                                       return new object[0];\r
-                               }\r
-                       }\r
-                       \r
-                       //\r
-                       // Remove optional encoding\r
-                       //\r
-                       string ctype;\r
-                       Encoding encoding = WebServiceHelper.GetContentEncoding (response.ContentType, out ctype);\r
-                       if (ctype != "text/xml")\r
-                               WebServiceHelper.InvalidOperation (\r
-                                       "Content is not 'text/xml' but '" + response.ContentType + "'",\r
-                                       response, encoding);\r
-\r
-                       message.ContentType = ctype;\r
-                       message.ContentEncoding = encoding.WebName;\r
-                       \r
-                       Stream stream = response.GetResponseStream ();\r
-\r
-                       if (extensions != null) {\r
-                               stream = SoapExtension.ExecuteChainStream (extensions, stream);\r
-                               message.SetStage (SoapMessageStage.BeforeDeserialize);\r
-                               SoapExtension.ExecuteProcessMessage (extensions, message, stream, false);\r
-                       }\r
-                       \r
-                       // Deserialize the response\r
-\r
-                       SoapHeaderCollection headers;\r
-                       object content;\r
-\r
-                       using (StreamReader reader = new StreamReader (stream, encoding, false)) {\r
-                               XmlTextReader xml_reader = new XmlTextReader (reader);\r
-\r
-                               WebServiceHelper.ReadSoapMessage (xml_reader, msi, SoapHeaderDirection.Out, out content, out headers);\r
-                       }\r
-\r
-                       \r
-                       if (content is Fault)\r
-                       {\r
-                               Fault fault = (Fault) content;\r
-                               SoapException ex = new SoapException (fault.faultstring, fault.faultcode, fault.faultactor, fault.detail);\r
-                               message.SetException (ex);\r
-                       }\r
-                       else\r
-                               message.OutParameters = (object[]) content;\r
-                       \r
-                       message.SetHeaders (headers);\r
-                       message.UpdateHeaderValues (this, message.MethodStubInfo.Headers);\r
-\r
-                       if (extensions != null) {\r
-                               message.SetStage (SoapMessageStage.AfterDeserialize);\r
-                               SoapExtension.ExecuteProcessMessage (extensions, message, stream, false);\r
-                       }\r
-\r
-                       if (message.Exception == null)\r
-                               return message.OutParameters;\r
-                       else\r
-                               throw message.Exception;\r
-               }\r
-\r
-               protected object[] Invoke (string method_name, object[] parameters)\r
-               {\r
-                       SoapMethodStubInfo msi = (SoapMethodStubInfo) type_info.GetMethod (method_name);\r
-                       \r
-                       SoapClientMessage message = new SoapClientMessage (this, msi, Url, parameters);\r
-                       message.CollectHeaders (this, message.MethodStubInfo.Headers, SoapHeaderDirection.In);\r
-\r
-                       SoapExtension[] extensions = SoapExtension.CreateExtensionChain (type_info.SoapExtensions[0], msi.SoapExtensions, type_info.SoapExtensions[1]);\r
-\r
-                       WebResponse response;\r
-                       try\r
-                       {\r
-                               WebRequest request = GetRequestForMessage (uri, message);\r
-                               SendRequest (request.GetRequestStream (), message, extensions);\r
-                               response = GetWebResponse (request);\r
-                       }\r
-                       catch (WebException ex)\r
-                       {\r
-                               response = ex.Response;\r
-                               HttpWebResponse http_response = response as HttpWebResponse;\r
-                               if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError)\r
-                                       throw ex;\r
-                       }\r
-\r
-                       try {\r
-                               return ReceiveResponse (response, message, extensions);\r
-                       }\r
-                       finally {\r
-                               response.Close();\r
-                       }\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               [MonoTODO ("Do something with this")]\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               [DefaultValue (SoapProtocolVersion.Default)]\r
-               public SoapProtocolVersion SoapVersion {\r
-                       get { return soapVersion; }\r
-                       set { soapVersion = value; }\r
-               }\r
-               \r
-               protected void InvokeAsync (string methodName, object[] parameters, SendOrPostCallback callback)\r
-               {\r
-                       InvokeAsync (methodName, parameters, callback, null);\r
-               }\r
-\r
-               protected void InvokeAsync (string methodName, object[] parameters, SendOrPostCallback callback, object userState)\r
-               {\r
-                       InvokeAsyncInfo info = new InvokeAsyncInfo (callback, userState);\r
-                       BeginInvoke (methodName, parameters, new AsyncCallback (InvokeAsyncCallback), info);\r
-               }\r
-               \r
-               void InvokeAsyncCallback (IAsyncResult ar)\r
-               {\r
-                       InvokeAsyncInfo info = (InvokeAsyncInfo) ar.AsyncState;\r
-                       SoapWebClientAsyncResult sar = (SoapWebClientAsyncResult) ar;\r
-                       InvokeCompletedEventArgs args = new InvokeCompletedEventArgs (sar.Exception, false, info.UserState, (object[]) sar.Result);\r
-                       if (info.Context != null)\r
-                               info.Context.Send (info.Callback, args);\r
-                       else\r
-                               info.Callback (args);\r
-               }\r
-\r
-#endif\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
-\r
+// 
+// System.Web.Services.Protocols.SoapHttpClientProtocol.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Miguel de Icaza (miguel@ximian.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+// Copyright (C) Ximian, Inc, 2003
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.IO;
+using System.Net;
+using System.Web;
+using System.Xml;
+using System.Text;
+using System.Reflection;
+using System.Web.Services;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Web.Services.Description;
+using System.Web.Services.Discovery;
+using System.Xml.Serialization;
+using System.Xml.Schema;
+using System.Collections;
+using System.Threading;
+
+namespace System.Web.Services.Protocols 
+{
+#if NET_2_0
+       [System.Runtime.InteropServices.ComVisible (true)]
+#endif
+       public class SoapHttpClientProtocol : HttpWebClientProtocol 
+       {
+               SoapTypeStubInfo type_info;
+#if NET_2_0
+               SoapProtocolVersion soapVersion;
+#endif
+
+               #region SoapWebClientAsyncResult class
+
+               internal class SoapWebClientAsyncResult: WebClientAsyncResult
+               {
+                       public SoapWebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)
+                       : base (request, callback, asyncState)
+                       {
+                       }
+               
+                       public SoapClientMessage Message;
+                       public SoapExtension[] Extensions;
+               }
+               #endregion
+
+               #region Constructors
+
+               public SoapHttpClientProtocol () 
+               {
+                       type_info = (SoapTypeStubInfo) TypeStubManager.GetTypeStub (this.GetType (), "Soap");
+               }
+
+               #endregion // Constructors
+
+               #region Methods
+
+               protected IAsyncResult BeginInvoke (string methodName, object[] parameters, AsyncCallback callback, object asyncState)
+               {
+                       SoapMethodStubInfo msi = (SoapMethodStubInfo) type_info.GetMethod (methodName);
+
+                       SoapWebClientAsyncResult ainfo = null;
+                       try
+                       {
+                               SoapClientMessage message = new SoapClientMessage (this, msi, Url, parameters);
+                               message.CollectHeaders (this, message.MethodStubInfo.Headers, SoapHeaderDirection.In);
+                               
+                               WebRequest request = GetRequestForMessage (uri, message);
+                               
+                               ainfo = new SoapWebClientAsyncResult (request, callback, asyncState);
+                               ainfo.Message = message;
+                               ainfo.Extensions = SoapExtension.CreateExtensionChain (type_info.SoapExtensions[0], msi.SoapExtensions, type_info.SoapExtensions[1]);
+
+                               ainfo.Request.BeginGetRequestStream (new AsyncCallback (AsyncGetRequestStreamDone), ainfo);
+                       }
+                       catch (Exception ex)
+                       {
+                               if (ainfo != null)
+                                       ainfo.SetCompleted (null, ex, false);
+                       }
+
+                       return ainfo;
+               }
+
+               void AsyncGetRequestStreamDone (IAsyncResult ar)
+               {
+                       SoapWebClientAsyncResult ainfo = (SoapWebClientAsyncResult) ar.AsyncState;
+                       try
+                       {
+                               SendRequest (ainfo.Request.EndGetRequestStream (ar), ainfo.Message, ainfo.Extensions);
+                               ainfo.Request.BeginGetResponse (new AsyncCallback (AsyncGetResponseDone), ainfo);
+                       }
+                       catch (Exception ex)
+                       {
+                               ainfo.SetCompleted (null, ex, true);
+                       }
+               }
+
+               void AsyncGetResponseDone (IAsyncResult ar)
+               {
+                       SoapWebClientAsyncResult ainfo = (SoapWebClientAsyncResult) ar.AsyncState;
+                       WebResponse response = null;
+
+                       try {
+                               response = GetWebResponse (ainfo.Request, ar);
+                       }
+                       catch (WebException ex) {
+                               response = ex.Response;
+                               HttpWebResponse http_response = response as HttpWebResponse;
+                               if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError) {
+                                       ainfo.SetCompleted (null, ex, true);
+                                       return;
+                               }
+                       }
+                       catch (Exception ex) {
+                               ainfo.SetCompleted (null, ex, true);
+                               return;
+                       }
+
+                       try {
+                               object[] result = ReceiveResponse (response, ainfo.Message, ainfo.Extensions);
+                               ainfo.SetCompleted (result, null, true);
+                       }
+                       catch (Exception ex) {
+                               ainfo.SetCompleted (null, ex, true);
+                       }
+                       finally {
+                               response.Close();
+                       }
+               }
+
+               protected object[] EndInvoke (IAsyncResult asyncResult)
+               {
+                       if (!(asyncResult is SoapWebClientAsyncResult)) throw new ArgumentException ("asyncResult is not the return value from BeginInvoke");
+
+                       SoapWebClientAsyncResult ainfo = (SoapWebClientAsyncResult) asyncResult;
+                       lock (ainfo)
+                       {
+                               if (!ainfo.IsCompleted) ainfo.WaitForComplete ();
+                               if (ainfo.Exception != null) throw ainfo.Exception;
+                               else return (object[]) ainfo.Result;
+                       }
+               }
+
+               public void Discover ()
+               {
+                       BindingInfo bnd = (BindingInfo) type_info.Bindings [0];
+                       
+                       DiscoveryClientProtocol discoverer = new DiscoveryClientProtocol ();
+                       discoverer.Discover (Url);
+                       
+                       foreach (object info in discoverer.AdditionalInformation)
+                       {
+                               System.Web.Services.Discovery.SoapBinding sb = info as System.Web.Services.Discovery.SoapBinding;
+                               if (sb != null && sb.Binding.Name == bnd.Name && sb.Binding.Namespace == bnd.Namespace) {
+                                       Url = sb.Address;
+                                       return;
+                               }
+                       }
+                       
+                       string msg = string.Format ("The binding named '{0}' from namespace '{1}' was not found in the discovery document at '{2}'", bnd.Name, bnd.Namespace, Url);
+                       throw new Exception (msg);
+               }
+
+               protected override WebRequest GetWebRequest (Uri uri)
+               {
+                       return base.GetWebRequest (uri);
+               }
+
+               WebRequest GetRequestForMessage (Uri uri, SoapClientMessage message)
+               {
+                       WebRequest request = GetWebRequest (uri);
+                       request.Method = "POST";
+                       WebHeaderCollection headers = request.Headers;
+                       headers.Add ("SOAPAction", "\"" + message.Action + "\"");
+                       request.ContentType = message.ContentType + "; charset=utf-8";
+                       return request;
+               }
+               
+               void SendRequest (Stream s, SoapClientMessage message, SoapExtension[] extensions)
+               {
+                       using (s) {
+
+                               if (extensions != null) {
+                                       s = SoapExtension.ExecuteChainStream (extensions, s);
+                                       message.SetStage (SoapMessageStage.BeforeSerialize);
+                                       SoapExtension.ExecuteProcessMessage (extensions, message, s, true);
+                               }
+
+                               XmlTextWriter xtw = WebServiceHelper.CreateXmlWriter (s);
+#if NET_2_0
+                               bool soap12 = message.SoapVersion == SoapProtocolVersion.Soap12;
+#else
+                               bool soap12 = false;
+#endif
+                               WebServiceHelper.WriteSoapMessage (xtw, message.MethodStubInfo, SoapHeaderDirection.In, message.Parameters, message.Headers, soap12);
+
+                               if (extensions != null) {
+                                       message.SetStage (SoapMessageStage.AfterSerialize);
+                                       SoapExtension.ExecuteProcessMessage (extensions, message, s, true);
+                               }
+
+                               xtw.Flush ();
+                               xtw.Close ();
+                        }
+               }
+
+
+               //
+               // TODO:
+               //    Handle other web responses (multi-output?)
+               //    
+               object [] ReceiveResponse (WebResponse response, SoapClientMessage message, SoapExtension[] extensions)
+               {
+                       SoapMethodStubInfo msi = message.MethodStubInfo;
+                       HttpWebResponse http_response = response as HttpWebResponse;
+                       
+                       if (http_response != null)
+                       {
+                               HttpStatusCode code = http_response.StatusCode;
+       
+                               if (!(code == HttpStatusCode.Accepted || code == HttpStatusCode.OK || code == HttpStatusCode.InternalServerError)) {
+                                       string msg = "The request failed with HTTP status {0}: {1}";
+                                       msg = String.Format (msg, (int) code, code);
+                                       throw new WebException (msg, null, WebExceptionStatus.ProtocolError, http_response);
+                               }
+                               if (message.OneWay && response.ContentLength <= 0 && (code == HttpStatusCode.Accepted || code == HttpStatusCode.OK)) {
+                                       return new object[0];
+                               }
+                       }
+                       
+                       //
+                       // Remove optional encoding
+                       //
+                       string ctype;
+                       Encoding encoding = WebServiceHelper.GetContentEncoding (response.ContentType, out ctype);
+                       if (ctype != "text/xml")
+                               WebServiceHelper.InvalidOperation (
+                                       "Content is not 'text/xml' but '" + response.ContentType + "'",
+                                       response, encoding);
+
+                       message.ContentType = ctype;
+                       message.ContentEncoding = encoding.WebName;
+                       
+                       Stream stream = response.GetResponseStream ();
+
+                       if (extensions != null) {
+                               stream = SoapExtension.ExecuteChainStream (extensions, stream);
+                               message.SetStage (SoapMessageStage.BeforeDeserialize);
+                               SoapExtension.ExecuteProcessMessage (extensions, message, stream, false);
+                       }
+                       
+                       // Deserialize the response
+
+                       SoapHeaderCollection headers;
+                       object content;
+
+                       using (StreamReader reader = new StreamReader (stream, encoding, false)) {
+                               XmlTextReader xml_reader = new XmlTextReader (reader);
+
+                               WebServiceHelper.ReadSoapMessage (xml_reader, msi, SoapHeaderDirection.Out, out content, out headers);
+                       }
+
+                       
+                       if (content is Fault)
+                       {
+                               Fault fault = (Fault) content;
+                               SoapException ex = new SoapException (fault.faultstring, fault.faultcode, fault.faultactor, fault.detail);
+                               message.SetException (ex);
+                       }
+                       else
+                               message.OutParameters = (object[]) content;
+                       
+                       message.SetHeaders (headers);
+                       message.UpdateHeaderValues (this, message.MethodStubInfo.Headers);
+
+                       if (extensions != null) {
+                               message.SetStage (SoapMessageStage.AfterDeserialize);
+                               SoapExtension.ExecuteProcessMessage (extensions, message, stream, false);
+                       }
+
+                       if (message.Exception == null)
+                               return message.OutParameters;
+                       else
+                               throw message.Exception;
+               }
+
+               protected object[] Invoke (string method_name, object[] parameters)
+               {
+                       SoapMethodStubInfo msi = (SoapMethodStubInfo) type_info.GetMethod (method_name);
+                       
+                       SoapClientMessage message = new SoapClientMessage (this, msi, Url, parameters);
+                       message.CollectHeaders (this, message.MethodStubInfo.Headers, SoapHeaderDirection.In);
+
+                       SoapExtension[] extensions = SoapExtension.CreateExtensionChain (type_info.SoapExtensions[0], msi.SoapExtensions, type_info.SoapExtensions[1]);
+
+                       WebResponse response;
+                       try
+                       {
+                               WebRequest request = GetRequestForMessage (uri, message);
+                               SendRequest (request.GetRequestStream (), message, extensions);
+                               response = GetWebResponse (request);
+                       }
+                       catch (WebException ex)
+                       {
+                               response = ex.Response;
+                               HttpWebResponse http_response = response as HttpWebResponse;
+                               if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError)
+                                       throw ex;
+                       }
+
+                       try {
+                               return ReceiveResponse (response, message, extensions);
+                       }
+                       finally {
+                               response.Close();
+                       }
+               }
+               
+#if NET_2_0
+
+               [MonoTODO ("Do something with this")]
+               [System.Runtime.InteropServices.ComVisible(false)]
+               [DefaultValue (SoapProtocolVersion.Default)]
+               public SoapProtocolVersion SoapVersion {
+                       get { return soapVersion; }
+                       set { soapVersion = value; }
+               }
+               
+               protected void InvokeAsync (string methodName, object[] parameters, SendOrPostCallback callback)
+               {
+                       InvokeAsync (methodName, parameters, callback, null);
+               }
+
+               protected void InvokeAsync (string methodName, object[] parameters, SendOrPostCallback callback, object userState)
+               {
+                       InvokeAsyncInfo info = new InvokeAsyncInfo (callback, userState);
+                       BeginInvoke (methodName, parameters, new AsyncCallback (InvokeAsyncCallback), info);
+               }
+               
+               void InvokeAsyncCallback (IAsyncResult ar)
+               {
+                       InvokeAsyncInfo info = (InvokeAsyncInfo) ar.AsyncState;
+                       SoapWebClientAsyncResult sar = (SoapWebClientAsyncResult) ar;
+                       InvokeCompletedEventArgs args = new InvokeCompletedEventArgs (sar.Exception, false, info.UserState, (object[]) sar.Result);
+                       if (info.Context != null)
+                               info.Context.Send (info.Callback, args);
+                       else
+                               info.Callback (args);
+               }
+
+#endif
+
+               #endregion // Methods
+       }
+}
+
index f2cb0357c9e907ba2a0c2ac08adedf494be60b45..eb03e61fd47948bfcb438b77b4fe81bfc7f6470a 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.SoapMessage.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapMessage.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.IO;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class SoapMessage {\r
-\r
-               #region Fields\r
-\r
-               string content_type = "text/xml";\r
-               string content_encoding;\r
-               SoapException exception = null;\r
-               SoapHeaderCollection headers;\r
-               SoapMessageStage stage;\r
-               Stream stream;\r
-               object[] inParameters;\r
-               object[] outParameters;\r
-               \r
-#if NET_2_0\r
-               SoapProtocolVersion soapVersion;\r
-#endif\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               internal SoapMessage ()\r
-               {\r
-                       headers = new SoapHeaderCollection ();\r
-               }\r
-\r
-               internal SoapMessage (Stream stream, SoapException exception)\r
-               {\r
-                       this.exception = exception;\r
-                       this.stream = stream;\r
-                       headers = new SoapHeaderCollection ();\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               internal object[] InParameters \r
-               {\r
-                       get { return inParameters; }\r
-                       set { inParameters = value; }\r
-               }\r
-\r
-               internal object[] OutParameters \r
-               {\r
-                       get { return outParameters; }\r
-                       set { outParameters = value; }\r
-               }\r
-\r
-               public abstract string Action \r
-               {\r
-                       get;\r
-               }\r
-\r
-               public string ContentType {\r
-                       get { return content_type; }\r
-                       set { content_type = value; }\r
-               }\r
-\r
-               public SoapException Exception {\r
-                       get { return exception; }\r
-#if NET_2_0\r
-                       set { exception = value; }\r
-#endif\r
-               }\r
-\r
-               public SoapHeaderCollection Headers {\r
-                       get { return headers; }\r
-               }\r
-\r
-               public abstract LogicalMethodInfo MethodInfo {\r
-                       get;\r
-               }\r
-\r
-               public abstract bool OneWay {\r
-                       get;\r
-               }\r
-\r
-               public SoapMessageStage Stage {\r
-                       get { return stage; }\r
-               }\r
-\r
-               internal void SetStage (SoapMessageStage stage)\r
-               {\r
-                       this.stage = stage;\r
-               }\r
-               \r
-               public Stream Stream {\r
-                       get {\r
-                               return stream;\r
-                       }\r
-               }\r
-\r
-               public abstract string Url {\r
-                       get;\r
-               }\r
-               \r
-#if NET_1_1\r
-               public string ContentEncoding\r
-               {\r
-                       get { return content_encoding; }\r
-                       set { content_encoding = value; }\r
-               }\r
-#else\r
-               internal string ContentEncoding\r
-               {\r
-                       get { return content_encoding; }\r
-                       set { content_encoding = value; }\r
-               }\r
-#endif\r
-\r
-#if NET_2_0\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               [DefaultValue (SoapProtocolVersion.Default)]\r
-               public virtual SoapProtocolVersion SoapVersion {\r
-                       get { return soapVersion; }\r
-               }\r
-#endif\r
\r
-               internal Stream InternalStream \r
-               { \r
-                       // for getter use public stream property\r
-                       set {\r
-                               stream = value;\r
-                       }\r
-               }\r
-\r
-               #endregion Properties\r
-\r
-               #region Methods\r
-\r
-               protected abstract void EnsureInStage ();\r
-               protected abstract void EnsureOutStage ();\r
-\r
-               protected void EnsureStage (SoapMessageStage stage) \r
-               {\r
-                       if ((((int) stage) & ((int) Stage)) == 0)\r
-                               throw new InvalidOperationException ("The current SoapMessageStage is not the asserted stage or stages.");\r
-               }\r
-\r
-               public object GetInParameterValue (int index) \r
-               {\r
-                       return inParameters [index];\r
-               }\r
-\r
-               public object GetOutParameterValue (int index) \r
-               {\r
-                       if (MethodInfo.IsVoid) return outParameters [index];\r
-                       else return outParameters [index + 1];\r
-               }\r
-\r
-               public object GetReturnValue ()\r
-               {\r
-                       if (!MethodInfo.IsVoid && exception == null) return outParameters [0];\r
-                       else return null;\r
-               }\r
-\r
-               internal void SetHeaders (SoapHeaderCollection headers)\r
-               {\r
-                       this.headers = headers;\r
-               }\r
-\r
-               internal void SetException (SoapException ex)\r
-               {\r
-                       exception = ex;\r
-               }\r
-\r
-               internal void CollectHeaders (object target, HeaderInfo[] headers, SoapHeaderDirection direction)\r
-               {\r
-                       Headers.Clear ();\r
-                       foreach (HeaderInfo hi in headers) \r
-                       {\r
-                               if ((hi.Direction & direction) != 0 && !hi.IsUnknownHeader) \r
-                               {\r
-                                       SoapHeader headerVal = hi.GetHeaderValue (target) as SoapHeader;\r
-                                       if (headerVal != null)\r
-                                               Headers.Add (headerVal);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               internal void UpdateHeaderValues (object target, HeaderInfo[] headersInfo)\r
-               {\r
-                       foreach (SoapHeader header in Headers)\r
-                       {\r
-                               HeaderInfo hinfo = FindHeader (headersInfo, header.GetType ());\r
-                               if (hinfo != null) {\r
+
+using System.ComponentModel;
+using System.IO;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public abstract class SoapMessage {
+
+               #region Fields
+
+               string content_type = "text/xml";
+               string content_encoding;
+               SoapException exception = null;
+               SoapHeaderCollection headers;
+               SoapMessageStage stage;
+               Stream stream;
+               object[] inParameters;
+               object[] outParameters;
+               
+#if NET_2_0
+               SoapProtocolVersion soapVersion;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+
+               internal SoapMessage ()
+               {
+                       headers = new SoapHeaderCollection ();
+               }
+
+               internal SoapMessage (Stream stream, SoapException exception)
+               {
+                       this.exception = exception;
+                       this.stream = stream;
+                       headers = new SoapHeaderCollection ();
+               }
+
+               #endregion
+
+               #region Properties
+
+               internal object[] InParameters 
+               {
+                       get { return inParameters; }
+                       set { inParameters = value; }
+               }
+
+               internal object[] OutParameters 
+               {
+                       get { return outParameters; }
+                       set { outParameters = value; }
+               }
+
+               public abstract string Action 
+               {
+                       get;
+               }
+
+               public string ContentType {
+                       get { return content_type; }
+                       set { content_type = value; }
+               }
+
+               public SoapException Exception {
+                       get { return exception; }
+#if NET_2_0
+                       set { exception = value; }
+#endif
+               }
+
+               public SoapHeaderCollection Headers {
+                       get { return headers; }
+               }
+
+               public abstract LogicalMethodInfo MethodInfo {
+                       get;
+               }
+
+               public abstract bool OneWay {
+                       get;
+               }
+
+               public SoapMessageStage Stage {
+                       get { return stage; }
+               }
+
+               internal void SetStage (SoapMessageStage stage)
+               {
+                       this.stage = stage;
+               }
+               
+               public Stream Stream {
+                       get {
+                               return stream;
+                       }
+               }
+
+               public abstract string Url {
+                       get;
+               }
+               
+#if NET_1_1
+               public string ContentEncoding
+               {
+                       get { return content_encoding; }
+                       set { content_encoding = value; }
+               }
+#else
+               internal string ContentEncoding
+               {
+                       get { return content_encoding; }
+                       set { content_encoding = value; }
+               }
+#endif
+
+#if NET_2_0
+               [System.Runtime.InteropServices.ComVisible(false)]
+               [DefaultValue (SoapProtocolVersion.Default)]
+               public virtual SoapProtocolVersion SoapVersion {
+                       get { return soapVersion; }
+               }
+#endif
+               internal Stream InternalStream 
+               { 
+                       // for getter use public stream property
+                       set {
+                               stream = value;
+                       }
+               }
+
+               #endregion Properties
+
+               #region Methods
+
+               protected abstract void EnsureInStage ();
+               protected abstract void EnsureOutStage ();
+
+               protected void EnsureStage (SoapMessageStage stage) 
+               {
+                       if ((((int) stage) & ((int) Stage)) == 0)
+                               throw new InvalidOperationException ("The current SoapMessageStage is not the asserted stage or stages.");
+               }
+
+               public object GetInParameterValue (int index) 
+               {
+                       return inParameters [index];
+               }
+
+               public object GetOutParameterValue (int index) 
+               {
+                       if (MethodInfo.IsVoid) return outParameters [index];
+                       else return outParameters [index + 1];
+               }
+
+               public object GetReturnValue ()
+               {
+                       if (!MethodInfo.IsVoid && exception == null) return outParameters [0];
+                       else return null;
+               }
+
+               internal void SetHeaders (SoapHeaderCollection headers)
+               {
+                       this.headers = headers;
+               }
+
+               internal void SetException (SoapException ex)
+               {
+                       exception = ex;
+               }
+
+               internal void CollectHeaders (object target, HeaderInfo[] headers, SoapHeaderDirection direction)
+               {
+                       Headers.Clear ();
+                       foreach (HeaderInfo hi in headers) 
+                       {
+                               if ((hi.Direction & direction) != 0 && !hi.IsUnknownHeader) 
+                               {
+                                       SoapHeader headerVal = hi.GetHeaderValue (target) as SoapHeader;
+                                       if (headerVal != null)
+                                               Headers.Add (headerVal);
+                               }
+                       }
+               }
+
+               internal void UpdateHeaderValues (object target, HeaderInfo[] headersInfo)
+               {
+                       foreach (SoapHeader header in Headers)
+                       {
+                               HeaderInfo hinfo = FindHeader (headersInfo, header.GetType ());
+                               if (hinfo != null) {
                                        hinfo.SetHeaderValue (target, header);
                                        header.DidUnderstand = !hinfo.IsUnknownHeader;
-                               }\r
-                       }\r
-               }\r
-\r
-               HeaderInfo FindHeader (HeaderInfo[] headersInfo, Type headerType)\r
+                               }
+                       }
+               }
+
+               HeaderInfo FindHeader (HeaderInfo[] headersInfo, Type headerType)
                {
                        HeaderInfo unknownHeaderInfo = null;
-               \r
+               
                        foreach (HeaderInfo headerInfo in headersInfo) {
                                if (headerInfo.HeaderType == headerType)
                                        return headerInfo;
@@ -238,8 +238,8 @@ namespace System.Web.Services.Protocols {
                                        unknownHeaderInfo = headerInfo;
                        }
                        return unknownHeaderInfo;
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+               }
+
+               #endregion // Methods
+       }
 }
index c28b3eee55bf5e3a33e06265bb7b4987ee7210b9..c0cd5c42b7ee0e8bd14bafb537b78429465e9937 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapMessageStage.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapMessageStage.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-\r
-       public enum SoapMessageStage {\r
-               AfterDeserialize = 0x8,\r
-               AfterSerialize = 0x2,\r
-               BeforeDeserialize = 0x4,\r
-               BeforeSerialize = 0x1\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+
+       public enum SoapMessageStage {
+               AfterDeserialize = 0x8,
+               AfterSerialize = 0x2,
+               BeforeDeserialize = 0x4,
+               BeforeSerialize = 0x1
+       }
+}
index fde01bc62c05c1339b90b8a5d844c17d5c0c2bb8..e068454805d6a3ad194ca6cd18265bb49498da11 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapParameterStyle.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapParameterStyle.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       public enum SoapParameterStyle {\r
-               Default = 0x0,\r
-               Bare = 0x1,\r
-               Wrapped = 0x2\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       public enum SoapParameterStyle {
+               Default = 0x0,
+               Bare = 0x1,
+               Wrapped = 0x2
+       }
+}
index 9958766faa88cbc9820d1e494c4245ee8f2a5335..31082802e667c0c7b05079ff5182f3e67d729b1a 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapRpcMethodAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapRpcMethodAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Description;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.Method, Inherited = true)]\r
-       public sealed class SoapRpcMethodAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               string action;\r
-               string binding;\r
-               bool oneWay;\r
-               string requestElementName;\r
-               string requestNamespace;\r
-               string responseElementName;\r
-               string responseNamespace;\r
-               \r
-#if NET_2_0\r
-               SoapBindingUse use;\r
-#endif\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public SoapRpcMethodAttribute ()\r
-               {\r
-               }\r
-\r
-               public SoapRpcMethodAttribute (string action)\r
-                       : this ()\r
-               {\r
-                       this.action = action;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Action {\r
-                       get { return action != null ? action : ""; }\r
-                       set { action = value; }\r
-               }\r
-\r
-               public string Binding {\r
-                       get { return binding; }\r
-                       set { binding = value; }\r
-               }\r
-\r
-               public bool OneWay {\r
-                       get { return oneWay; }\r
-                       set { oneWay = value; }\r
-               }\r
-\r
-               public string RequestElementName {\r
-                       get { return requestElementName != null ? requestElementName : ""; }\r
-                       set { requestElementName = value; }\r
-               }\r
-\r
-               public string RequestNamespace {\r
-                       get { return requestNamespace != null ? requestNamespace : ""; }\r
-                       set { requestNamespace = value; }\r
-               }\r
-\r
-               public string ResponseElementName {\r
-                       get { return responseElementName != null ? responseElementName : ""; }\r
-                       set { responseElementName = value; }\r
-               }\r
-\r
-               public string ResponseNamespace {\r
-                       get { return responseNamespace != null ? responseNamespace : ""; }\r
-                       set { responseNamespace = value; }\r
-               }\r
-               \r
-#if NET_2_0\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-       }\r
+
+using System.Web.Services.Description;
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.Method, Inherited = true)]
+       public sealed class SoapRpcMethodAttribute : Attribute {
+
+               #region Fields
+
+               string action;
+               string binding;
+               bool oneWay;
+               string requestElementName;
+               string requestNamespace;
+               string responseElementName;
+               string responseNamespace;
+               
+#if NET_2_0
+               SoapBindingUse use;
+#endif
+               #endregion // Fields
+
+               #region Constructors
+
+               public SoapRpcMethodAttribute ()
+               {
+               }
+
+               public SoapRpcMethodAttribute (string action)
+                       : this ()
+               {
+                       this.action = action;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public string Action {
+                       get { return action != null ? action : ""; }
+                       set { action = value; }
+               }
+
+               public string Binding {
+                       get { return binding; }
+                       set { binding = value; }
+               }
+
+               public bool OneWay {
+                       get { return oneWay; }
+                       set { oneWay = value; }
+               }
+
+               public string RequestElementName {
+                       get { return requestElementName != null ? requestElementName : ""; }
+                       set { requestElementName = value; }
+               }
+
+               public string RequestNamespace {
+                       get { return requestNamespace != null ? requestNamespace : ""; }
+                       set { requestNamespace = value; }
+               }
+
+               public string ResponseElementName {
+                       get { return responseElementName != null ? responseElementName : ""; }
+                       set { responseElementName = value; }
+               }
+
+               public string ResponseNamespace {
+                       get { return responseNamespace != null ? responseNamespace : ""; }
+                       set { responseNamespace = value; }
+               }
+               
+#if NET_2_0
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+#endif
+
+               #endregion // Properties
+       }
 }
index 4a8ecc02df0743db8eb2eeda853b6ec181a0fd09..1a1aec0a90d5f7c03cb9895d70492ef0d4cf4f46 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapRpcServiceAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapRpcServiceAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services.Description;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       [AttributeUsage (AttributeTargets.Class, Inherited = true)]\r
-       public sealed class SoapRpcServiceAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               SoapServiceRoutingStyle routingStyle;\r
-#if NET_2_0\r
-               SoapBindingUse use;\r
-#endif\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public SoapRpcServiceAttribute ()\r
-               {\r
-                       routingStyle = SoapServiceRoutingStyle.SoapAction;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public SoapServiceRoutingStyle RoutingStyle {\r
-                       get { return routingStyle; }\r
-                       set { routingStyle = value; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public SoapBindingUse Use {\r
-                       get { return use; }\r
-                       set { use = value; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Web.Services.Description;
+
+namespace System.Web.Services.Protocols {
+       [AttributeUsage (AttributeTargets.Class, Inherited = true)]
+       public sealed class SoapRpcServiceAttribute : Attribute {
+
+               #region Fields
+
+               SoapServiceRoutingStyle routingStyle;
+#if NET_2_0
+               SoapBindingUse use;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public SoapRpcServiceAttribute ()
+               {
+                       routingStyle = SoapServiceRoutingStyle.SoapAction;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public SoapServiceRoutingStyle RoutingStyle {
+                       get { return routingStyle; }
+                       set { routingStyle = value; }
+               }
+
+#if NET_2_0
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public SoapBindingUse Use {
+                       get { return use; }
+                       set { use = value; }
+               }
+#endif
+
+               #endregion // Properties
+       }
+}
index e541564267e59d2bbe2f03e8f8391ff3f71c0cbc..ded95e6793131dfe0cd8a2a923d97fd04dda050b 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.SoapServerMessage.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapServerMessage.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.IO;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public sealed class SoapServerMessage : SoapMessage {\r
-\r
-               #region Fields\r
-\r
-               string action;\r
-               SoapMethodStubInfo stubInfo;\r
-               object server;\r
-               string url;\r
-               object[] parameters;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               internal SoapServerMessage (HttpRequest request, object server, Stream stream)\r
-                       : base (stream, null)\r
-               {\r
-                       this.action = request.Headers ["SOAPAction"];\r
-                       if (this.action != null)\r
-                               this.action = action.Trim ('"',' ');\r
-                       this.server = server;\r
-                       this.url = request.Url.ToString();\r
-                       ContentEncoding = request.Headers ["Content-Encoding"];\r
-               }\r
-\r
-               internal SoapServerMessage (HttpRequest request, SoapException exception, SoapMethodStubInfo stubInfo, object server, Stream stream)\r
-                       : base (stream, exception)\r
-               {\r
-                       this.action = request.Headers ["SOAPAction"];\r
-                       if (this.action != null)\r
-                               this.action = action.Trim ('"',' ');\r
-                       this.stubInfo = stubInfo;\r
-                       this.server = server;\r
-                       this.url = request.Url.ToString();\r
-                       ContentEncoding = request.Headers ["Content-Encoding"];\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public override LogicalMethodInfo MethodInfo {\r
-                       get { return stubInfo.MethodInfo; }\r
-               }\r
-\r
-               public override string Action {\r
-                       get { return action; }\r
-               }\r
-\r
-               internal SoapMethodStubInfo MethodStubInfo {\r
-                       get { return stubInfo; }\r
-                       set { stubInfo = value; }\r
-               }\r
-\r
-               public override bool OneWay {\r
-                       get { return stubInfo.OneWay; }\r
-               }\r
-\r
-               public object Server {\r
-                       get { return server; }\r
-               }       \r
-\r
-               public override string Url {\r
-                       get { return url; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [MonoTODO]\r
-               [System.Runtime.InteropServices.ComVisible(false)]\r
-               public override SoapProtocolVersion SoapVersion {\r
-                       get { throw new NotImplementedException (); }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               protected override void EnsureInStage ()\r
-               {\r
-                       EnsureStage (SoapMessageStage.AfterDeserialize);\r
-               }\r
-\r
-               protected override void EnsureOutStage ()\r
-               {\r
-                       EnsureStage (SoapMessageStage.BeforeSerialize);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Web.Services;
+using System.IO;
+
+namespace System.Web.Services.Protocols {
+       public sealed class SoapServerMessage : SoapMessage {
+
+               #region Fields
+
+               string action;
+               SoapMethodStubInfo stubInfo;
+               object server;
+               string url;
+               object[] parameters;
+
+               #endregion
+
+               #region Constructors
+
+               internal SoapServerMessage (HttpRequest request, object server, Stream stream)
+                       : base (stream, null)
+               {
+                       this.action = request.Headers ["SOAPAction"];
+                       if (this.action != null)
+                               this.action = action.Trim ('"',' ');
+                       this.server = server;
+                       this.url = request.Url.ToString();
+                       ContentEncoding = request.Headers ["Content-Encoding"];
+               }
+
+               internal SoapServerMessage (HttpRequest request, SoapException exception, SoapMethodStubInfo stubInfo, object server, Stream stream)
+                       : base (stream, exception)
+               {
+                       this.action = request.Headers ["SOAPAction"];
+                       if (this.action != null)
+                               this.action = action.Trim ('"',' ');
+                       this.stubInfo = stubInfo;
+                       this.server = server;
+                       this.url = request.Url.ToString();
+                       ContentEncoding = request.Headers ["Content-Encoding"];
+               }
+
+               #endregion
+
+               #region Properties
+
+               public override LogicalMethodInfo MethodInfo {
+                       get { return stubInfo.MethodInfo; }
+               }
+
+               public override string Action {
+                       get { return action; }
+               }
+
+               internal SoapMethodStubInfo MethodStubInfo {
+                       get { return stubInfo; }
+                       set { stubInfo = value; }
+               }
+
+               public override bool OneWay {
+                       get { return stubInfo.OneWay; }
+               }
+
+               public object Server {
+                       get { return server; }
+               }       
+
+               public override string Url {
+                       get { return url; }
+               }
+
+#if NET_2_0
+               [MonoTODO]
+               [System.Runtime.InteropServices.ComVisible(false)]
+               public override SoapProtocolVersion SoapVersion {
+                       get { throw new NotImplementedException (); }
+               }
+#endif
+
+               #endregion // Properties
+
+               #region Methods
+
+               protected override void EnsureInStage ()
+               {
+                       EnsureStage (SoapMessageStage.AfterDeserialize);
+               }
+
+               protected override void EnsureOutStage ()
+               {
+                       EnsureStage (SoapMessageStage.BeforeSerialize);
+               }
+
+               #endregion // Methods
+       }
 }
index 19e598202b823637749d0b19f0bde5cfcf902eac..82c5ef9b40637924e287bfbd29dc797dfbdcebfb 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapServiceRoutingStyle.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapServiceRoutingStyle.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services.Protocols {\r
-       public enum SoapServiceRoutingStyle {\r
-               SoapAction = 0x0,\r
-               RequestElement = 0x1\r
-       }\r
-}\r
+
+namespace System.Web.Services.Protocols {
+       public enum SoapServiceRoutingStyle {
+               SoapAction = 0x0,
+               RequestElement = 0x1
+       }
+}
index e4c4bb37023c9e375f6ee14a04315d63fb282512..d2f83e43b623c437da44dcc9aeb939d4e196f296 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.SoapUnknownHeader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.SoapUnknownHeader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public sealed class SoapUnknownHeader : SoapHeader {\r
-\r
-               #region Fields\r
-\r
-               XmlElement element;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public SoapUnknownHeader ()\r
-               {\r
-                       element = null;\r
-               }\r
-\r
-               internal SoapUnknownHeader (XmlElement elem): base (elem)\r
-               {\r
-                       element = elem;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [XmlIgnore]\r
-               public XmlElement Element {\r
-                       get { return element; }\r
-                       set { element = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Protocols {
+       public sealed class SoapUnknownHeader : SoapHeader {
+
+               #region Fields
+
+               XmlElement element;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public SoapUnknownHeader ()
+               {
+                       element = null;
+               }
+
+               internal SoapUnknownHeader (XmlElement elem): base (elem)
+               {
+                       element = elem;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               [XmlIgnore]
+               public XmlElement Element {
+                       get { return element; }
+                       set { element = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index 6285a3141bef91fe9a584659384914f0b65af3ea..5ef5327ce0f79c1d0ada42b2e36b8b1635f429d2 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.TextReturnReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.TextReturnReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System;\r
-using System.IO;\r
-using System.Net;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class TextReturnReader : MimeReturnReader {\r
-\r
-               PatternMatcher _matcher;\r
-               \r
-               #region Constructors\r
-\r
-               public TextReturnReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
-                       return new PatternMatcher (methodInfo.ReturnType);\r
-               }\r
-\r
-               public override void Initialize (object o)\r
-               {\r
-                       _matcher = (PatternMatcher) o;\r
-               }\r
-\r
-               public override object Read (WebResponse response, Stream responseStream)\r
-               {\r
-                       StreamReader sr = new StreamReader (responseStream);\r
-                       string text = sr.ReadToEnd ();\r
-                       return _matcher.Match (text);\r
-               }\r
-               \r
-               #endregion // Methods\r
-       }       \r
-}\r
-\r
+
+using System;
+using System.IO;
+using System.Net;
+
+namespace System.Web.Services.Protocols {
+       public class TextReturnReader : MimeReturnReader {
+
+               PatternMatcher _matcher;
+               
+               #region Constructors
+
+               public TextReturnReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
+                       return new PatternMatcher (methodInfo.ReturnType);
+               }
+
+               public override void Initialize (object o)
+               {
+                       _matcher = (PatternMatcher) o;
+               }
+
+               public override object Read (WebResponse response, Stream responseStream)
+               {
+                       StreamReader sr = new StreamReader (responseStream);
+                       string text = sr.ReadToEnd ();
+                       return _matcher.Match (text);
+               }
+               
+               #endregion // Methods
+       }       
+}
+
index c27f7e9fcfde90603d7a78ca0b9d7f928c313d32..d517629c88eaf5cb207bb435fc41e1ba3850a845 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.UrlEncodedParameterWriter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.UrlEncodedParameterWriter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Text;\r
-using System.Web.Services;\r
-using System.Web;\r
-using System.Reflection;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class UrlEncodedParameterWriter : MimeParameterWriter {\r
-\r
-               Encoding requestEncoding;\r
-               ParameterInfo[] parameters;\r
-               \r
-               #region Constructors\r
-\r
-               protected UrlEncodedParameterWriter () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties \r
-\r
-               public override Encoding RequestEncoding {\r
-                       get { return requestEncoding; }\r
-                       set { requestEncoding = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               protected void Encode (TextWriter writer, object[] values)\r
-               {\r
-                       for (int n=0; n<values.Length; n++)\r
-                       {\r
-                               if (n>0) writer.Write ("&");\r
-                               Encode (writer, parameters[n].Name, values[n]);\r
-                       }\r
-               }\r
-\r
-               protected void Encode (TextWriter writer, string name, object value)\r
-               {\r
-                       if (requestEncoding != null)\r
-                       {\r
-                               writer.Write (HttpUtility.UrlEncode (name, requestEncoding));\r
-                               writer.Write ("=");\r
-                               writer.Write (HttpUtility.UrlEncode (ObjToString (value), requestEncoding));\r
-                       }\r
-                       else\r
-                       {\r
-                               writer.Write (HttpUtility.UrlEncode (name));\r
-                               writer.Write ("=");\r
-                               writer.Write (HttpUtility.UrlEncode (ObjToString (value)));\r
-                       }\r
-                               \r
-               }\r
-\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
-                       if (methodInfo.OutParameters.Length > 0) return null;\r
-                       else return methodInfo.Parameters;\r
-               }\r
-\r
-               public override void Initialize (object initializer)\r
-               {\r
-                       parameters = (ParameterInfo[]) initializer;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.IO;
+using System.Text;
+using System.Web.Services;
+using System.Web;
+using System.Reflection;
+
+namespace System.Web.Services.Protocols {
+       public abstract class UrlEncodedParameterWriter : MimeParameterWriter {
+
+               Encoding requestEncoding;
+               ParameterInfo[] parameters;
+               
+               #region Constructors
+
+               protected UrlEncodedParameterWriter () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Properties 
+
+               public override Encoding RequestEncoding {
+                       get { return requestEncoding; }
+                       set { requestEncoding = value; }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               protected void Encode (TextWriter writer, object[] values)
+               {
+                       for (int n=0; n<values.Length; n++)
+                       {
+                               if (n>0) writer.Write ("&");
+                               Encode (writer, parameters[n].Name, values[n]);
+                       }
+               }
+
+               protected void Encode (TextWriter writer, string name, object value)
+               {
+                       if (requestEncoding != null)
+                       {
+                               writer.Write (HttpUtility.UrlEncode (name, requestEncoding));
+                               writer.Write ("=");
+                               writer.Write (HttpUtility.UrlEncode (ObjToString (value), requestEncoding));
+                       }
+                       else
+                       {
+                               writer.Write (HttpUtility.UrlEncode (name));
+                               writer.Write ("=");
+                               writer.Write (HttpUtility.UrlEncode (ObjToString (value)));
+                       }
+                               
+               }
+
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
+                       if (methodInfo.OutParameters.Length > 0) return null;
+                       else return methodInfo.Parameters;
+               }
+
+               public override void Initialize (object initializer)
+               {
+                       parameters = (ParameterInfo[]) initializer;
+               }
+
+               #endregion // Methods
+       }
 }
index 4f8d8645a45e3dc393b7143122d651a7ffa25b9c..6fdda6f85ca7e1510f2a45c7ff0b27e3b5161a77 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.UrlParameterReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.UrlParameterReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class UrlParameterReader : ValueCollectionParameterReader {\r
-\r
-               #region Constructors\r
-\r
-               public UrlParameterReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override object[] Read (HttpRequest request)\r
-               {\r
-                       return Read (request.QueryString);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Web;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class UrlParameterReader : ValueCollectionParameterReader {
+
+               #region Constructors
+
+               public UrlParameterReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override object[] Read (HttpRequest request)
+               {
+                       return Read (request.QueryString);
+               }
+
+               #endregion // Methods
+       }
 }
index 229313aa1eb0d03f64a23295bd05afa2b2ba3a33..ae07ac2e2ee5f22027c43a3e1712f2b39067fadf 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.UrlParameterWriter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.UrlParameterWriter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Web.Services;\r
-using System.IO;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class UrlParameterWriter : UrlEncodedParameterWriter {\r
-\r
-               #region Constructors\r
-\r
-               public UrlParameterWriter () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override string GetRequestUrl (string url, object[] parameters)\r
-               {\r
-                       StringWriter sw = new StringWriter ();\r
-                       Encode (sw, parameters);\r
-                       return url + "?" + sw.ToString ();\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Web.Services;
+using System.IO;
+
+namespace System.Web.Services.Protocols {
+       public class UrlParameterWriter : UrlEncodedParameterWriter {
+
+               #region Constructors
+
+               public UrlParameterWriter () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override string GetRequestUrl (string url, object[] parameters)
+               {
+                       StringWriter sw = new StringWriter ();
+                       Encode (sw, parameters);
+                       return url + "?" + sw.ToString ();
+               }
+
+               #endregion // Methods
+       }
 }
index 8de1703f178b5d7db309d309d12b68b76f7eeeeb..c3eed482083e590a000d237c68f30abd15c2f14a 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.ValueCollectionParameterReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.ValueCollectionParameterReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Collections.Specialized;\r
-using System.Reflection;\r
-using System.Web;\r
-using System.Xml;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public abstract class ValueCollectionParameterReader : MimeParameterReader {\r
-\r
-               ParameterInfo[] parameters;\r
-\r
-               #region Constructors\r
-\r
-               protected ValueCollectionParameterReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
-                       if (IsSupported (methodInfo)) return methodInfo.Parameters;\r
-                       else return null;\r
-               }\r
-\r
-               public override void Initialize (object o)\r
-               {\r
-                       parameters = (ParameterInfo[]) o;\r
-               }\r
-\r
-               public static bool IsSupported (LogicalMethodInfo methodInfo)\r
-               {\r
-                       foreach (ParameterInfo param in methodInfo.Parameters)\r
-                               if (!IsSupported (param)) return false;\r
-                       return true;\r
-               }\r
-\r
-               public static bool IsSupported (ParameterInfo paramInfo)\r
-               {\r
-                       Type type = paramInfo.ParameterType;\r
-                       if (type.IsByRef || paramInfo.IsOut) return false;\r
-                       if (type.IsArray) return IsSupportedPrimitive (type.GetElementType());\r
-                       else return IsSupportedPrimitive (type);\r
-               }\r
-               \r
-               internal static bool IsSupportedPrimitive (Type type)\r
-               {\r
+
+using System.Collections.Specialized;
+using System.Reflection;
+using System.Web;
+using System.Xml;
+
+namespace System.Web.Services.Protocols {
+       public abstract class ValueCollectionParameterReader : MimeParameterReader {
+
+               ParameterInfo[] parameters;
+
+               #region Constructors
+
+               protected ValueCollectionParameterReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
+                       if (IsSupported (methodInfo)) return methodInfo.Parameters;
+                       else return null;
+               }
+
+               public override void Initialize (object o)
+               {
+                       parameters = (ParameterInfo[]) o;
+               }
+
+               public static bool IsSupported (LogicalMethodInfo methodInfo)
+               {
+                       foreach (ParameterInfo param in methodInfo.Parameters)
+                               if (!IsSupported (param)) return false;
+                       return true;
+               }
+
+               public static bool IsSupported (ParameterInfo paramInfo)
+               {
+                       Type type = paramInfo.ParameterType;
+                       if (type.IsByRef || paramInfo.IsOut) return false;
+                       if (type.IsArray) return IsSupportedPrimitive (type.GetElementType());
+                       else return IsSupportedPrimitive (type);
+               }
+               
+               internal static bool IsSupportedPrimitive (Type type)
+               {
                        return ( type.IsPrimitive || 
-                                        type.IsEnum ||\r
-                                        type == typeof(string) ||\r
-                                        type == typeof(DateTime) ||\r
-                                        type == typeof(Decimal)\r
-                                        );\r
-               }\r
-\r
-               protected object[] Read (NameValueCollection collection)\r
-               {\r
-                       object[] res = new object [parameters.Length];\r
-                       for (int n=0; n<res.Length; n++)\r
-                       {\r
-                               string val = collection [parameters[n].Name];\r
-                               if (val == null) throw new InvalidOperationException ("Missing parameter: " + parameters[n].Name);\r
-                               try\r
-                               {\r
-                                       res [n] = StringToObj (parameters[n].ParameterType, val);\r
-                               }\r
-                               catch (Exception ex)\r
-                               {\r
-                                       string error = "Cannot convert '" + val + "' to " + parameters[n].ParameterType.FullName + "\n";\r
-                                       error += "Parameter name: " + parameters[n].Name + " --> " + ex.Message;\r
-                                       throw new InvalidOperationException (error);\r
-                               }\r
-                       }\r
-                       return res;\r
-               }\r
-               #endregion // Methods\r
-       }\r
+                                        type.IsEnum ||
+                                        type == typeof(string) ||
+                                        type == typeof(DateTime) ||
+                                        type == typeof(Decimal)
+                                        );
+               }
+
+               protected object[] Read (NameValueCollection collection)
+               {
+                       object[] res = new object [parameters.Length];
+                       for (int n=0; n<res.Length; n++)
+                       {
+                               string val = collection [parameters[n].Name];
+                               if (val == null) throw new InvalidOperationException ("Missing parameter: " + parameters[n].Name);
+                               try
+                               {
+                                       res [n] = StringToObj (parameters[n].ParameterType, val);
+                               }
+                               catch (Exception ex)
+                               {
+                                       string error = "Cannot convert '" + val + "' to " + parameters[n].ParameterType.FullName + "\n";
+                                       error += "Parameter name: " + parameters[n].Name + " --> " + ex.Message;
+                                       throw new InvalidOperationException (error);
+                               }
+                       }
+                       return res;
+               }
+               #endregion // Methods
+       }
 }
index 476f87ac6170677e6decaff03e5fb6732472affb..cda505e5e6a4bfda61061f9e6bc8cf92715a3d66 100644 (file)
@@ -1,12 +1,12 @@
-// \r
-// System.Web.Services.Protocols.WebClientAsyncResult.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Lluis Sanchez Gual (lluis@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.WebClientAsyncResult.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//   Lluis Sanchez Gual (lluis@ximian.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.Net;\r
-using System.Threading;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class WebClientAsyncResult : IAsyncResult {\r
-\r
-               #region Fields\r
-\r
-               AsyncCallback _callback;\r
-               object _asyncState;\r
-\r
-               bool _completedSynchronously;\r
-               bool _done;\r
-               ManualResetEvent _waitHandle;\r
-               \r
-               internal object Result;\r
-               internal Exception Exception;\r
-               internal WebRequest Request;\r
-                       \r
-               #endregion // Fields\r
-\r
-               #region Constructors \r
-\r
-               internal WebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)\r
-               {\r
-                       _callback = callback; \r
-                       Request = request;\r
-                       _asyncState = asyncState;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public object AsyncState {\r
-                       get { return _asyncState; }\r
-               }\r
-\r
-               public WaitHandle AsyncWaitHandle \r
-               {\r
-                       get\r
-                       {\r
-                               lock (this) {\r
-                                       if (_waitHandle != null) return _waitHandle;\r
-                                       _waitHandle = new ManualResetEvent (_done);\r
-                                       return _waitHandle;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public bool CompletedSynchronously \r
-               {\r
-                       get { return _completedSynchronously; }\r
-               }\r
-\r
-               public bool IsCompleted \r
-               {\r
-                       get { lock (this) { return _done; } }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public void Abort ()\r
-               {\r
-                       Request.Abort ();\r
-               }\r
-\r
-               internal void SetCompleted (object result, Exception exception, bool async)\r
-               {\r
-                       lock (this)\r
-                       {\r
-                               Exception = exception;\r
-                               Result = result;\r
-                               _done = true;\r
-                               _completedSynchronously = async;\r
-                               if (_waitHandle != null) _waitHandle.Set ();\r
-                               Monitor.PulseAll (this);\r
-                       }\r
-                       if (_callback != null) _callback (this);\r
-               }\r
-\r
-               internal void WaitForComplete ()\r
-               {\r
-                       lock (this)\r
-                       {\r
-                               Monitor.Wait (this);\r
-                       }\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+
+using System.Net;
+using System.Threading;
+
+namespace System.Web.Services.Protocols {
+       public class WebClientAsyncResult : IAsyncResult {
+
+               #region Fields
+
+               AsyncCallback _callback;
+               object _asyncState;
+
+               bool _completedSynchronously;
+               bool _done;
+               ManualResetEvent _waitHandle;
+               
+               internal object Result;
+               internal Exception Exception;
+               internal WebRequest Request;
+                       
+               #endregion // Fields
+
+               #region Constructors 
+
+               internal WebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)
+               {
+                       _callback = callback; 
+                       Request = request;
+                       _asyncState = asyncState;
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public object AsyncState {
+                       get { return _asyncState; }
+               }
+
+               public WaitHandle AsyncWaitHandle 
+               {
+                       get
+                       {
+                               lock (this) {
+                                       if (_waitHandle != null) return _waitHandle;
+                                       _waitHandle = new ManualResetEvent (_done);
+                                       return _waitHandle;
+                               }
+                       }
+               }
+
+               public bool CompletedSynchronously 
+               {
+                       get { return _completedSynchronously; }
+               }
+
+               public bool IsCompleted 
+               {
+                       get { lock (this) { return _done; } }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               public void Abort ()
+               {
+                       Request.Abort ();
+               }
+
+               internal void SetCompleted (object result, Exception exception, bool async)
+               {
+                       lock (this)
+                       {
+                               Exception = exception;
+                               Result = result;
+                               _done = true;
+                               _completedSynchronously = async;
+                               if (_waitHandle != null) _waitHandle.Set ();
+                               Monitor.PulseAll (this);
+                       }
+                       if (_callback != null) _callback (this);
+               }
+
+               internal void WaitForComplete ()
+               {
+                       lock (this)
+                       {
+                               Monitor.Wait (this);
+                       }
+               }
+
+               #endregion // Methods
+       }
 }
index 2dc55261872724e1a81ecd4f712e47f64a26ef01..08f41581c57718cba2b4f5e6020b988f79ecac85 100644 (file)
-// \r
-// System.Web.Services.Protocols.WebClientProtocol.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\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
-#if NET_2_0\r
-       [System.Runtime.InteropServices.ComVisible (true)]\r
-#endif\r
-       public abstract class WebClientProtocol : Component {\r
-\r
-               #region Fields\r
-\r
-               string connectionGroupName;\r
-               ICredentials credentials;\r
-               bool preAuthenticate;\r
-               Encoding requestEncoding;\r
-               int timeout;\r
-               string url;\r
-               bool abort;\r
-\r
-               //\r
-               // Used by SoapHttpClientProtocol, use this to avoid creating a new Uri on each invocation.\r
-               //\r
-               internal Uri uri;\r
-                       \r
-               //\r
-               // Points to the current request, so we can call Abort() on it\r
-               //\r
-               WebRequest current_request;\r
-               \r
-#if !TARGET_JVM\r
-               static HybridDictionary cache;\r
-#else\r
-               static HybridDictionary cache {\r
-                       get {\r
-                               return (HybridDictionary)AppDomain.CurrentDomain.GetData("WebClientProtocol.cache");\r
-                       }\r
-                       set {\r
-                               AppDomain.CurrentDomain.SetData("WebClientProtocol.cache", value);\r
-                       }\r
-               }\r
-#endif\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
-                       credentials = null;\r
-                       preAuthenticate = false;\r
-                       requestEncoding = null;\r
-                       timeout = 100000;\r
-                       url = String.Empty;\r
-                       abort = false;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue ("")]\r
-               public string ConnectionGroupName {\r
-                       get { return connectionGroupName; }\r
-                       set { connectionGroupName = value; }\r
-               }\r
-\r
-               public ICredentials Credentials {\r
-                       get { return credentials; }\r
-                       set { credentials = value; }\r
-               }\r
-\r
-               [DefaultValue (false)]\r
-               [WebServicesDescription ("Enables pre authentication of the request.")]\r
-               public bool PreAuthenticate {\r
-                       get { return preAuthenticate; }\r
-                       set { preAuthenticate = value; }\r
-               }\r
-\r
-               [DefaultValue (null)]\r
-               [RecommendedAsConfigurable (true)]\r
-               [WebServicesDescription ("The encoding to use for requests.")]\r
-               public Encoding RequestEncoding {\r
-                       get { return requestEncoding; }\r
-                       set { requestEncoding = value; }\r
-               }\r
-\r
-               [DefaultValue (100000)]\r
-               [RecommendedAsConfigurable (true)]\r
-               [WebServicesDescription ("Sets the timeout in milliseconds to be used for synchronous calls.  The default of -1 means infinite.")]\r
-               public int Timeout {\r
-                       get { return timeout; }\r
-                       set { timeout = value; }\r
-               }\r
-\r
-               [DefaultValue ("")]\r
-               [RecommendedAsConfigurable (true)]\r
-               [WebServicesDescription ("The base URL to the server to use for requests.")]\r
-               public string Url {\r
-                       get { return url; }\r
-                       set {\r
-                               url = value;\r
-                               uri = new Uri (url);\r
-                       }\r
-               }\r
-#if NET_2_0\r
-               public bool UseDefaultCredentials {\r
-                       get { return CredentialCache.DefaultCredentials == Credentials; }\r
-                       set { Credentials = value ? CredentialCache.DefaultCredentials : null; }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public virtual void Abort ()\r
-               {\r
-                       if (current_request != null){\r
-                               current_request.Abort ();\r
-                               current_request = null;\r
-                       }\r
-                       abort = true;\r
-               }\r
-\r
-               protected static void AddToCache (Type type, object value)\r
-               {\r
-                       cache [type] = value;\r
-               }\r
-\r
-               protected static object GetFromCache (Type type)\r
-               {\r
-                       return cache [type];\r
-               }\r
-\r
-               protected virtual WebRequest GetWebRequest (Uri uri)\r
-               {\r
-                       if (uri == null)\r
-                               throw new InvalidOperationException ("uri is null");\r
-\r
-                       current_request = WebRequest.Create (uri);\r
-                       current_request.Timeout = timeout;\r
-                       current_request.PreAuthenticate = preAuthenticate;\r
-                       current_request.ConnectionGroupName = connectionGroupName;\r
-\r
-                       if (credentials != null)\r
-                               current_request.Credentials = credentials;\r
-\r
-                       return current_request;\r
-               }\r
-\r
-               protected virtual WebResponse GetWebResponse (WebRequest request)\r
-               {\r
-                       if (abort)\r
-                               throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
-\r
-                       WebResponse response = null;\r
-                       try {\r
-                               request.Timeout = timeout;\r
-                               response = request.GetResponse ();\r
-                       } catch (WebException e) {\r
-                               response = e.Response;\r
-                               if (response == null)\r
-                                       throw;\r
-                       }\r
-\r
-                       return response;\r
-               }\r
-\r
-               protected virtual WebResponse GetWebResponse (WebRequest request, IAsyncResult result)\r
-               {\r
-                       if (abort)\r
-                               throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
-\r
-                       return request.EndGetResponse (result);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
+// 
+// System.Web.Services.Protocols.WebClientProtocol.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Net;
+using System.Text;
+using System.Threading;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+#if NET_2_0
+       [System.Runtime.InteropServices.ComVisible (true)]
+#endif
+       public abstract class WebClientProtocol : Component {
+
+               #region Fields
+
+               string connectionGroupName;
+               ICredentials credentials;
+               bool preAuthenticate;
+               Encoding requestEncoding;
+               int timeout;
+               string url;
+               bool abort;
+
+               //
+               // Used by SoapHttpClientProtocol, use this to avoid creating a new Uri on each invocation.
+               //
+               internal Uri uri;
+                       
+               //
+               // Points to the current request, so we can call Abort() on it
+               //
+               WebRequest current_request;
+               
+#if !TARGET_JVM
+               static HybridDictionary cache;
+#else
+               static HybridDictionary cache {
+                       get {
+                               return (HybridDictionary)AppDomain.CurrentDomain.GetData("WebClientProtocol.cache");
+                       }
+                       set {
+                               AppDomain.CurrentDomain.SetData("WebClientProtocol.cache", value);
+                       }
+               }
+#endif
+               #endregion
+
+               #region Constructors
+
+               static WebClientProtocol ()
+               {
+                       cache = new HybridDictionary ();
+               }
+
+               protected WebClientProtocol () 
+               {
+                       connectionGroupName = String.Empty;
+                       credentials = null;
+                       preAuthenticate = false;
+                       requestEncoding = null;
+                       timeout = 100000;
+                       url = String.Empty;
+                       abort = false;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [DefaultValue ("")]
+               public string ConnectionGroupName {
+                       get { return connectionGroupName; }
+                       set { connectionGroupName = value; }
+               }
+
+               public ICredentials Credentials {
+                       get { return credentials; }
+                       set { credentials = value; }
+               }
+
+               [DefaultValue (false)]
+               [WebServicesDescription ("Enables pre authentication of the request.")]
+               public bool PreAuthenticate {
+                       get { return preAuthenticate; }
+                       set { preAuthenticate = value; }
+               }
+
+               [DefaultValue (null)]
+               [RecommendedAsConfigurable (true)]
+               [WebServicesDescription ("The encoding to use for requests.")]
+               public Encoding RequestEncoding {
+                       get { return requestEncoding; }
+                       set { requestEncoding = value; }
+               }
+
+               [DefaultValue (100000)]
+               [RecommendedAsConfigurable (true)]
+               [WebServicesDescription ("Sets the timeout in milliseconds to be used for synchronous calls.  The default of -1 means infinite.")]
+               public int Timeout {
+                       get { return timeout; }
+                       set { timeout = value; }
+               }
+
+               [DefaultValue ("")]
+               [RecommendedAsConfigurable (true)]
+               [WebServicesDescription ("The base URL to the server to use for requests.")]
+               public string Url {
+                       get { return url; }
+                       set {
+                               url = value;
+                               uri = new Uri (url);
+                       }
+               }
+#if NET_2_0
+               public bool UseDefaultCredentials {
+                       get { return CredentialCache.DefaultCredentials == Credentials; }
+                       set { Credentials = value ? CredentialCache.DefaultCredentials : null; }
+               }
+#endif
+
+               #endregion // Properties
+
+               #region Methods
+
+               public virtual void Abort ()
+               {
+                       if (current_request != null){
+                               current_request.Abort ();
+                               current_request = null;
+                       }
+                       abort = true;
+               }
+
+               protected static void AddToCache (Type type, object value)
+               {
+                       cache [type] = value;
+               }
+
+               protected static object GetFromCache (Type type)
+               {
+                       return cache [type];
+               }
+
+               protected virtual WebRequest GetWebRequest (Uri uri)
+               {
+                       if (uri == null)
+                               throw new InvalidOperationException ("uri is null");
+
+                       current_request = WebRequest.Create (uri);
+                       current_request.Timeout = timeout;
+                       current_request.PreAuthenticate = preAuthenticate;
+                       current_request.ConnectionGroupName = connectionGroupName;
+
+                       if (credentials != null)
+                               current_request.Credentials = credentials;
+
+                       return current_request;
+               }
+
+               protected virtual WebResponse GetWebResponse (WebRequest request)
+               {
+                       if (abort)
+                               throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);
+
+                       WebResponse response = null;
+                       try {
+                               request.Timeout = timeout;
+                               response = request.GetResponse ();
+                       } catch (WebException e) {
+                               response = e.Response;
+                               if (response == null)
+                                       throw;
+                       }
+
+                       return response;
+               }
+
+               protected virtual WebResponse GetWebResponse (WebRequest request, IAsyncResult result)
+               {
+                       if (abort)
+                               throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);
+
+                       return request.EndGetResponse (result);
+               }
+
+               #endregion // Methods
+       }
+}
index ec7829c5e05f5e99f5d5fe9267f2e8f3f41364aa..f0ab43ee2871965617190db1f0da945c2eb37d4c 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.XmlReturnReader.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.XmlReturnReader.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Net;\r
-using System.Xml.Serialization;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       public class XmlReturnReader : MimeReturnReader {\r
-\r
-               XmlSerializer serializer;\r
-               \r
-               #region Constructors\r
-\r
-               public XmlReturnReader () \r
-               {\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
-                       LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);\r
+
+using System.IO;
+using System.Net;
+using System.Xml.Serialization;
+using System.Web.Services;
+
+namespace System.Web.Services.Protocols {
+       public class XmlReturnReader : MimeReturnReader {
+
+               XmlSerializer serializer;
+               
+               #region Constructors
+
+               public XmlReturnReader () 
+               {
+               }
+               
+               #endregion // Constructors
+
+               #region Methods
+
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
+                       LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
                        object[] ats = methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
                        XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null; 
-                       return new XmlSerializer (methodInfo.ReturnType, null, null, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));\r
-               }\r
-\r
-               public override object[] GetInitializers (LogicalMethodInfo[] methodInfos)\r
-               {\r
-                       XmlReflectionImporter importer = new XmlReflectionImporter ();\r
-                       XmlMapping[] sers = new XmlMapping [methodInfos.Length];\r
-                       for (int n=0; n<sers.Length; n++)\r
-                       {\r
-                               LogicalMethodInfo metinfo = methodInfos[n];\r
-                               if (metinfo.IsVoid) \r
-                                       sers[n] = null;\r
-                               else\r
-                               {\r
+                       return new XmlSerializer (methodInfo.ReturnType, null, null, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
+               }
+
+               public override object[] GetInitializers (LogicalMethodInfo[] methodInfos)
+               {
+                       XmlReflectionImporter importer = new XmlReflectionImporter ();
+                       XmlMapping[] sers = new XmlMapping [methodInfos.Length];
+                       for (int n=0; n<sers.Length; n++)
+                       {
+                               LogicalMethodInfo metinfo = methodInfos[n];
+                               if (metinfo.IsVoid) 
+                                       sers[n] = null;
+                               else
+                               {
                                        LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);
                                        object[] ats = methodInfos[n].ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
                                        XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null; 
-                                       sers[n] = importer.ImportTypeMapping (methodInfos[n].ReturnType, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));\r
-                               }\r
-                       }\r
-                       return XmlSerializer.FromMappings (sers);\r
-               }\r
-               \r
-               public override void Initialize (object o)\r
-               {\r
-                       serializer = (XmlSerializer)o;\r
-               }\r
-\r
-               public override object Read (WebResponse response, Stream responseStream)\r
-               {\r
-                       object result = null;\r
-                       if (serializer != null)\r
-                       {\r
-                               if (response.ContentType.IndexOf ("text/xml") == -1)\r
-                                       throw new InvalidOperationException ("Result was not XML");\r
-                               \r
-                               result = serializer.Deserialize (responseStream);\r
-                       }\r
-                       responseStream.Close ();\r
-                       return result;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+                                       sers[n] = importer.ImportTypeMapping (methodInfos[n].ReturnType, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
+                               }
+                       }
+                       return XmlSerializer.FromMappings (sers);
+               }
+               
+               public override void Initialize (object o)
+               {
+                       serializer = (XmlSerializer)o;
+               }
+
+               public override object Read (WebResponse response, Stream responseStream)
+               {
+                       object result = null;
+                       if (serializer != null)
+                       {
+                               if (response.ContentType.IndexOf ("text/xml") == -1)
+                                       throw new InvalidOperationException ("Result was not XML");
+                               
+                               result = serializer.Deserialize (responseStream);
+                       }
+                       responseStream.Close ();
+                       return result;
+               }
+
+               #endregion // Methods
+       }
 }
index a9819fc1343bb78d5f5bfac6836ebc79ca80d8eb..6792ef1691eb86b33d82236af2df814e8ede8756 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.Protocols.XmlReturnWriter.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.Protocols.XmlReturnWriter.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.IO;\r
-using System.Web;\r
-using System.Xml.Serialization;\r
-using System.Xml;\r
-using System.Text;\r
-\r
-namespace System.Web.Services.Protocols {\r
-       internal class XmlReturnWriter : MimeReturnWriter {\r
-\r
-               XmlSerializer serializer;\r
-               \r
-               #region Methods\r
-\r
-               public override object GetInitializer (LogicalMethodInfo methodInfo)\r
-               {\r
+
+using System.IO;
+using System.Web;
+using System.Xml.Serialization;
+using System.Xml;
+using System.Text;
+
+namespace System.Web.Services.Protocols {
+       internal class XmlReturnWriter : MimeReturnWriter {
+
+               XmlSerializer serializer;
+               
+               #region Methods
+
+               public override object GetInitializer (LogicalMethodInfo methodInfo)
+               {
                        LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
                        object[] ats = methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
-                       XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null; \r
-                       \r
-                       XmlReflectionImporter importer = new XmlReflectionImporter ();\r
-                       importer.IncludeTypes (methodInfo.CustomAttributeProvider);\r
+                       XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null; 
+                       
+                       XmlReflectionImporter importer = new XmlReflectionImporter ();
+                       importer.IncludeTypes (methodInfo.CustomAttributeProvider);
                        XmlTypeMapping map = importer.ImportTypeMapping (methodInfo.ReturnType, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
-                       return new XmlSerializer (map);\r
-               }\r
-               \r
-               public override object[] GetInitializers (LogicalMethodInfo[] methodInfos)\r
-               {\r
-                       XmlReflectionImporter importer = new XmlReflectionImporter ();\r
-                       XmlMapping[] sers = new XmlMapping [methodInfos.Length];\r
-                       for (int n=0; n<sers.Length; n++)\r
-                       {\r
-                               LogicalMethodInfo metinfo = methodInfos[n];\r
-                               if (metinfo.IsVoid) \r
-                                       sers[n] = null;\r
-                               else\r
-                               {\r
-                                       importer.IncludeTypes (metinfo.CustomAttributeProvider);\r
-                                       LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);\r
+                       return new XmlSerializer (map);
+               }
+               
+               public override object[] GetInitializers (LogicalMethodInfo[] methodInfos)
+               {
+                       XmlReflectionImporter importer = new XmlReflectionImporter ();
+                       XmlMapping[] sers = new XmlMapping [methodInfos.Length];
+                       for (int n=0; n<sers.Length; n++)
+                       {
+                               LogicalMethodInfo metinfo = methodInfos[n];
+                               if (metinfo.IsVoid) 
+                                       sers[n] = null;
+                               else
+                               {
+                                       importer.IncludeTypes (metinfo.CustomAttributeProvider);
+                                       LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);
                                        object[] ats = methodInfos[n].ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
                                        XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null; 
-                                       sers[n] = importer.ImportTypeMapping (methodInfos[n].ReturnType, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));\r
-                               }\r
-                       }\r
-                       return XmlSerializer.FromMappings (sers);\r
-               }\r
-\r
-               public override void Initialize (object initializer) \r
-               {\r
-                       serializer = (XmlSerializer) initializer;\r
-               }\r
-\r
-               public override void Write (HttpResponse response, Stream outputStream, object returnValue)\r
-               {\r
-                       if (serializer != null)\r
-                       {\r
-                               response.ContentType = "text/xml; charset=utf-8";\r
-                               XmlTextWriter xtw = new XmlTextWriter (outputStream, new UTF8Encoding (false));\r
-                               xtw.Formatting = Formatting.Indented;\r
-                               serializer.Serialize (xtw, returnValue);\r
-                       }\r
-                       outputStream.Close ();\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
+                                       sers[n] = importer.ImportTypeMapping (methodInfos[n].ReturnType, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
+                               }
+                       }
+                       return XmlSerializer.FromMappings (sers);
+               }
+
+               public override void Initialize (object initializer) 
+               {
+                       serializer = (XmlSerializer) initializer;
+               }
+
+               public override void Write (HttpResponse response, Stream outputStream, object returnValue)
+               {
+                       if (serializer != null)
+                       {
+                               response.ContentType = "text/xml; charset=utf-8";
+                               XmlTextWriter xtw = new XmlTextWriter (outputStream, new UTF8Encoding (false));
+                               xtw.Formatting = Formatting.Indented;
+                               serializer.Serialize (xtw, returnValue);
+                       }
+                       outputStream.Close ();
+               }
+
+               #endregion // Methods
+       }
 }
index a85871af634d2dddb77ea0f9a92cde9f8d9a6c53..9955c630d0caa90441eda13a60c903c2549560f0 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.WebMethodAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.WebMethodAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
+
 #if !TARGET_J2EE
-using System.EnterpriseServices;\r
+using System.EnterpriseServices;
 #endif
-\r
-namespace System.Web.Services {\r
+
+namespace System.Web.Services {
 
 #if TARGET_J2EE
        public enum TransactionOption {Disabled , NotSupported , Required , RequiresNew , Supported }
 #endif
 
-       [AttributeUsage(AttributeTargets.Method, Inherited = true)]\r
-       public sealed class WebMethodAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               bool bufferResponse;\r
-               int cacheDuration;\r
-               string description;\r
-               bool enableSession;\r
-               string messageName;\r
-               TransactionOption transactionOption;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public WebMethodAttribute ()\r
-                       : this (false, TransactionOption.Disabled, 0, true)\r
-               {\r
-               }\r
-\r
-               public WebMethodAttribute (bool enableSession)\r
-                       : this (enableSession, TransactionOption.Disabled, 0, true)\r
-               {\r
-               }\r
-\r
-               public WebMethodAttribute (bool enableSession, TransactionOption transactionOption)\r
-                       : this (enableSession, transactionOption, 0, true)\r
-               {\r
-               }\r
-\r
-               public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration)\r
-                       : this (enableSession, transactionOption, cacheDuration, true)\r
-               {\r
-               }\r
-\r
-               public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration, bool bufferResponse)\r
-               {\r
-                       this.bufferResponse = bufferResponse;\r
-                       this.cacheDuration = cacheDuration;\r
-                       this.enableSession = enableSession;\r
-                       this.transactionOption = transactionOption;\r
-\r
-                       this.description = String.Empty;\r
-                       this.messageName = String.Empty;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public bool BufferResponse {\r
-                       get { return bufferResponse; }\r
-                       set { bufferResponse = value; }\r
-               }\r
-\r
-               public int CacheDuration {\r
-                       get { return cacheDuration; }\r
-                       set { cacheDuration = value; }\r
-               }\r
-\r
-               public string Description { \r
-                       get { return description; }\r
-                       set { description = value; }\r
-               }\r
-\r
-               public bool EnableSession {\r
-                       get { return enableSession; }\r
-                       set { enableSession = value; }\r
-               }\r
-\r
-               public string MessageName {\r
-                       get { return messageName; }\r
-                       set { messageName = value; }\r
-               }\r
-\r
-               public TransactionOption TransactionOption {\r
-                       get { return transactionOption; }\r
-                       set { transactionOption = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+       [AttributeUsage(AttributeTargets.Method, Inherited = true)]
+       public sealed class WebMethodAttribute : Attribute {
+
+               #region Fields
+
+               bool bufferResponse;
+               int cacheDuration;
+               string description;
+               bool enableSession;
+               string messageName;
+               TransactionOption transactionOption;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public WebMethodAttribute ()
+                       : this (false, TransactionOption.Disabled, 0, true)
+               {
+               }
+
+               public WebMethodAttribute (bool enableSession)
+                       : this (enableSession, TransactionOption.Disabled, 0, true)
+               {
+               }
+
+               public WebMethodAttribute (bool enableSession, TransactionOption transactionOption)
+                       : this (enableSession, transactionOption, 0, true)
+               {
+               }
+
+               public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration)
+                       : this (enableSession, transactionOption, cacheDuration, true)
+               {
+               }
+
+               public WebMethodAttribute (bool enableSession, TransactionOption transactionOption, int cacheDuration, bool bufferResponse)
+               {
+                       this.bufferResponse = bufferResponse;
+                       this.cacheDuration = cacheDuration;
+                       this.enableSession = enableSession;
+                       this.transactionOption = transactionOption;
+
+                       this.description = String.Empty;
+                       this.messageName = String.Empty;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public bool BufferResponse {
+                       get { return bufferResponse; }
+                       set { bufferResponse = value; }
+               }
+
+               public int CacheDuration {
+                       get { return cacheDuration; }
+                       set { cacheDuration = value; }
+               }
+
+               public string Description { 
+                       get { return description; }
+                       set { description = value; }
+               }
+
+               public bool EnableSession {
+                       get { return enableSession; }
+                       set { enableSession = value; }
+               }
+
+               public string MessageName {
+                       get { return messageName; }
+                       set { messageName = value; }
+               }
+
+               public TransactionOption TransactionOption {
+                       get { return transactionOption; }
+                       set { transactionOption = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index f7b78381e1ca771d91d1a6b435d48704532c71e2..1acadee0926d22883feb6921a199fffdb44c3dae 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.WebService.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.WebService.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-using System.Security.Principal;\r
-using System.Web;\r
-using System.Web.SessionState;\r
-\r
-namespace System.Web.Services {\r
-       public class WebService : MarshalByValueComponent {\r
-\r
-               #region Fields\r
-\r
-               HttpContext _context;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public WebService ()\r
-               {\r
-                       _context = HttpContext.Current;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [Browsable (false)]\r
-               [Description ("The ASP.NET application object for the current request.")]\r
-               [WebServicesDescription ("The ASP.NET application object for the current request.")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public HttpApplicationState Application {\r
-                       get { return _context.Application; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [WebServicesDescription ("The ASP.NET context object for the current request.")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public HttpContext Context {\r
-                       get { return _context; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [WebServicesDescription ("The ASP.NET utility object for the current request.")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public HttpServerUtility Server {\r
-                       get { return _context.Server; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [WebServicesDescription ("The ASP.NET session object for the current request.")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public HttpSessionState Session {\r
-                       get { return _context.Session; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [WebServicesDescription ("The ASP.NET user object for the current request.  The object is used for authorization.")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public IPrincipal User {\r
-                       get { return _context.User; }\r
-               }\r
-\r
-#if NET_2_0\r
-               [MonoTODO]\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public System.Web.Services.Protocols.SoapProtocolVersion SoapVersion {\r
-                       get { throw new NotImplementedException (); }\r
-               }\r
-#endif\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.ComponentModel;
+using System.Security.Principal;
+using System.Web;
+using System.Web.SessionState;
+
+namespace System.Web.Services {
+       public class WebService : MarshalByValueComponent {
+
+               #region Fields
+
+               HttpContext _context;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               public WebService ()
+               {
+                       _context = HttpContext.Current;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               [Browsable (false)]
+               [Description ("The ASP.NET application object for the current request.")]
+               [WebServicesDescription ("The ASP.NET application object for the current request.")]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public HttpApplicationState Application {
+                       get { return _context.Application; }
+               }
+
+               [Browsable (false)]
+               [WebServicesDescription ("The ASP.NET context object for the current request.")]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public HttpContext Context {
+                       get { return _context; }
+               }
+
+               [Browsable (false)]
+               [WebServicesDescription ("The ASP.NET utility object for the current request.")]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public HttpServerUtility Server {
+                       get { return _context.Server; }
+               }
+
+               [Browsable (false)]
+               [WebServicesDescription ("The ASP.NET session object for the current request.")]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public HttpSessionState Session {
+                       get { return _context.Session; }
+               }
+
+               [Browsable (false)]
+               [WebServicesDescription ("The ASP.NET user object for the current request.  The object is used for authorization.")]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public IPrincipal User {
+                       get { return _context.User; }
+               }
+
+#if NET_2_0
+               [MonoTODO]
+               [Browsable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public System.Web.Services.Protocols.SoapProtocolVersion SoapVersion {
+                       get { throw new NotImplementedException (); }
+               }
+#endif
+
+               #endregion // Properties
+       }
+}
index dd65dd20d63cb41dfa048275b5f5f680a4625a8c..84ae5397a6417bd5d7fd6e1cf7c7fe9f0323c514 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.WebServiceAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.WebServiceAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services {\r
-#if NET_2_0\r
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface, Inherited = true)]\r
-#else\r
-       [AttributeUsage (AttributeTargets.Class, Inherited = true)]\r
-#endif\r
-       public sealed class WebServiceAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               public const string DefaultNamespace = "http://tempuri.org/";\r
-               string description;\r
-               string name;\r
-               string ns;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               \r
-               public WebServiceAttribute ()\r
-               {\r
-                       description = String.Empty;\r
-                       name = String.Empty;\r
-                       ns = DefaultNamespace;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Description {     \r
-                       get { return description; }\r
-                       set { description = value; }\r
-               }\r
-       \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-       \r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+namespace System.Web.Services {
+#if NET_2_0
+       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface, Inherited = true)]
+#else
+       [AttributeUsage (AttributeTargets.Class, Inherited = true)]
+#endif
+       public sealed class WebServiceAttribute : Attribute {
+
+               #region Fields
+
+               public const string DefaultNamespace = "http://tempuri.org/";
+               string description;
+               string name;
+               string ns;
+
+               #endregion // Fields
+
+               #region Constructors
+
+               
+               public WebServiceAttribute ()
+               {
+                       description = String.Empty;
+                       name = String.Empty;
+                       ns = DefaultNamespace;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public string Description {     
+                       get { return description; }
+                       set { description = value; }
+               }
+       
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+       
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+
+               #endregion // Properties
+       }
+}
index 500f23ce0b96ce2959ed623c3520181eb7ce04ae..9f2141bb41630b5595216b79170d2b54731e105c 100644 (file)
@@ -1,11 +1,11 @@
- // \r
-// System.Web.Services.WebServiceBindingAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+ // 
+// System.Web.Services.WebServiceBindingAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-namespace System.Web.Services {\r
-#if NET_2_0\r
-       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)]\r
-#else\r
-       [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]\r
-#endif\r
-       public sealed class WebServiceBindingAttribute : Attribute {\r
-\r
-               #region Fields\r
-\r
-               string location;\r
-               string name;\r
-               string ns;\r
-               \r
-#if NET_2_0\r
-               bool emitConformanceClaims;\r
+
+namespace System.Web.Services {
+#if NET_2_0
+       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)]
+#else
+       [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
+#endif
+       public sealed class WebServiceBindingAttribute : Attribute {
+
+               #region Fields
+
+               string location;
+               string name;
+               string ns;
                
-               WsiProfiles conformsTo;\r
-#endif\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public WebServiceBindingAttribute ()\r
-                       : this (String.Empty, String.Empty, String.Empty)\r
-               {\r
-               }\r
-\r
-               public WebServiceBindingAttribute (string name)\r
-                       : this (name, String.Empty, String.Empty)\r
-               {\r
-               }\r
-\r
-               public WebServiceBindingAttribute (string name, string ns)\r
-                       : this (name, ns, String.Empty)\r
-               {\r
-               }\r
-\r
-               public WebServiceBindingAttribute (string name, string ns, string location)\r
-               {\r
-                       this.name = name;\r
-                       this.ns = ns;\r
-                       this.location = location;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Location {        \r
-                       get { return location; }\r
-                       set { location = value; }\r
-               }\r
-       \r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-       \r
-               public string Namespace {\r
-                       get { return ns; }\r
-                       set { ns = value; }\r
-               }\r
-               \r
-#if NET_2_0\r
-\r
-               public bool EmitConformanceClaims {\r
-                       get { return emitConformanceClaims; }\r
-                       set { emitConformanceClaims = value; }\r
+#if NET_2_0
+               bool emitConformanceClaims;
+               
+               WsiProfiles conformsTo;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public WebServiceBindingAttribute ()
+                       : this (String.Empty, String.Empty, String.Empty)
+               {
+               }
+
+               public WebServiceBindingAttribute (string name)
+                       : this (name, String.Empty, String.Empty)
+               {
+               }
+
+               public WebServiceBindingAttribute (string name, string ns)
+                       : this (name, ns, String.Empty)
+               {
+               }
+
+               public WebServiceBindingAttribute (string name, string ns, string location)
+               {
+                       this.name = name;
+                       this.ns = ns;
+                       this.location = location;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+               public string Location {        
+                       get { return location; }
+                       set { location = value; }
+               }
+       
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+       
+               public string Namespace {
+                       get { return ns; }
+                       set { ns = value; }
+               }
+               
+#if NET_2_0
+
+               public bool EmitConformanceClaims {
+                       get { return emitConformanceClaims; }
+                       set { emitConformanceClaims = value; }
                }       
                
                public WsiProfiles ConformsTo { 
                        get { return conformsTo; } 
                        set { conformsTo = value; }
-               }\r
-#endif\r
-\r
-\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+               }
+#endif
+
+
+
+               #endregion // Properties
+       }
+}
index e4b1416a4fdc747e9fbbfed2f8bd70d0e98b3c02..47dffb67e8aa0b9111a9dcd920886c10375b0266 100644 (file)
@@ -1,11 +1,11 @@
-// \r
-// System.Web.Services.WebServicesDescriptionAttribute.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
+// 
+// System.Web.Services.WebServicesDescriptionAttribute.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
 
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-\r
-using System.ComponentModel;\r
-\r
-namespace System.Web.Services {\r
-       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event, Inherited = true)]\r
-       internal class WebServicesDescriptionAttribute : DescriptionAttribute {\r
-\r
-               #region Constructors\r
-\r
-               public WebServicesDescriptionAttribute (string description) \r
-                       : base (description)\r
-               {\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override string Description {\r
-                       get { return DescriptionValue; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
+
+using System.ComponentModel;
+
+namespace System.Web.Services {
+       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event, Inherited = true)]
+       internal class WebServicesDescriptionAttribute : DescriptionAttribute {
+
+               #region Constructors
+
+               public WebServicesDescriptionAttribute (string description) 
+                       : base (description)
+               {
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public override string Description {
+                       get { return DescriptionValue; }
+               }
+
+               #endregion // Properties
+       }
+}