**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Web.Services / System.Web.Services.Description / SoapBodyBinding.cs
blobf034b6918d9ed7ddcc7a635aa8f6d9027a4bc9d6
1 //
2 // System.Web.Services.Description.SoapBodyBinding.cs
3 //
4 // Author:
5 // Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2002
8 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.ComponentModel;
32 using System.Web.Services.Configuration;
33 using System.Xml.Serialization;
35 namespace System.Web.Services.Description {
36 [XmlFormatExtension ("body", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (InputBinding), typeof (OutputBinding), typeof (MimePart))]
37 public class SoapBodyBinding : ServiceDescriptionFormatExtension {
39 #region Fields
41 string encoding;
42 string ns;
43 string[] parts;
44 string partsString;
45 SoapBindingUse use;
47 #endregion // Fields
49 #region Constructors
51 public SoapBodyBinding ()
53 encoding = String.Empty;
54 ns = String.Empty;
55 parts = null;
56 partsString = null;
57 use = SoapBindingUse.Default;
60 #endregion // Constructors
62 #region Properties
64 [DefaultValue ("")]
65 [XmlAttribute ("encodingStyle")]
66 public string Encoding {
67 get { return encoding; }
68 set { encoding = value; }
71 [DefaultValue ("")]
72 [XmlAttribute ("namespace")]
73 public string Namespace {
74 get { return ns; }
75 set { ns = value; }
78 [XmlIgnore]
79 public string[] Parts {
80 get { return parts; }
81 set {
82 parts = value;
83 if (value == null)
84 partsString = null;
85 else
86 partsString = String.Join(" ", value);
90 [XmlAttribute ("parts", DataType = "NMTOKENS")]
91 public string PartsString {
92 get { return partsString; }
93 set {
94 partsString = value;
95 if (value == null)
96 parts = null;
97 else
98 parts = value.Split(' ');
102 [DefaultValue (SoapBindingUse.Default)]
103 [XmlAttribute ("use")]
104 public SoapBindingUse Use {
105 get { return use; }
106 set { use = value; }
109 #endregion // Properties