1 // ==++==
2 //
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 //
5 // ==--==
6 /*============================================================
7 **
8 **  File:    SoapInteropTypes.cs
9 **
10 **  Purpose: Types for Wsdl and Soap interop
11 **
12 **
13 ===========================================================*/
14 
15 namespace System.Runtime.Remoting.Metadata.W3cXsd2001
16 {
17     using System;
18     using System.Globalization;
19     using System.Text;
20 
21 
22     internal static class SoapType
23     {
FilterBin64(String value)24         internal static String FilterBin64(String value)
25         {
26             StringBuilder sb = new StringBuilder();
27             for (int i=0; i<value.Length; i++)
28             {
29                 if (!(value[i] == ' '|| value[i] == '\n' || value[i] == '\r'))
30                     sb.Append(value[i]);
31             }
32             return sb.ToString();
33         }
34 
LineFeedsBin64(String value)35         internal static String LineFeedsBin64(String value)
36         {
37             // Add linefeeds every 76 characters
38             StringBuilder sb = new StringBuilder();
39             for (int i=0; i<value.Length; i++)
40             {
41                 if (i%76 == 0)
42                     sb.Append('\n');
43                 sb.Append(value[i]);
44             }
45             return sb.ToString();
46         }
47 
Escape(String value)48         internal static String Escape(String value)
49         {
50             if (value == null || value.Length == 0)
51                 return value;
52 
53             StringBuilder stringBuffer = new StringBuilder();
54             int index = value.IndexOf('&');
55             if (index > -1)
56             {
57                 stringBuffer.Append(value);
58                 stringBuffer.Replace("&", "&#38;", index, stringBuffer.Length - index);
59             }
60 
61             index = value.IndexOf('"');
62             if (index > -1)
63             {
64                 if (stringBuffer.Length == 0)
65                     stringBuffer.Append(value);
66                 stringBuffer.Replace("\"", "&#34;", index, stringBuffer.Length - index);
67             }
68 
69             index = value.IndexOf('\'');
70             if (index > -1)
71             {
72                 if (stringBuffer.Length == 0)
73                     stringBuffer.Append(value);
74                 stringBuffer.Replace("\'", "&#39;", index, stringBuffer.Length - index);
75             }
76 
77             index = value.IndexOf('<');
78             if (index > -1)
79             {
80                 if (stringBuffer.Length == 0)
81                     stringBuffer.Append(value);
82                 stringBuffer.Replace("<", "&#60;", index, stringBuffer.Length - index);
83             }
84 
85             index = value.IndexOf('>');
86             if (index > -1)
87             {
88                 if (stringBuffer.Length == 0)
89                     stringBuffer.Append(value);
90                 stringBuffer.Replace(">", "&#62;", index, stringBuffer.Length - index);
91             }
92 
93             index = value.IndexOf(Char.MinValue);
94             if (index > -1)
95             {
96                 if (stringBuffer.Length == 0)
97                     stringBuffer.Append(value);
98                 stringBuffer.Replace(Char.MinValue.ToString(), "&#0;", index, stringBuffer.Length - index);
99             }
100 
101             String returnValue = null;
102 
103             if (stringBuffer.Length > 0)
104                 returnValue = stringBuffer.ToString();
105             else
106                 returnValue = value;
107 
108             return returnValue;
109         }
110 
111 
112 
113         internal static Type typeofSoapTime = typeof(SoapTime);
114         internal static Type typeofSoapDate = typeof(SoapDate);
115         internal static Type typeofSoapYearMonth = typeof(SoapYearMonth);
116         internal static Type typeofSoapYear = typeof(SoapYear);
117         internal static Type typeofSoapMonthDay = typeof(SoapMonthDay);
118         internal static Type typeofSoapDay = typeof(SoapDay);
119         internal static Type typeofSoapMonth = typeof(SoapMonth);
120         internal static Type typeofSoapHexBinary = typeof(SoapHexBinary);
121         internal static Type typeofSoapBase64Binary = typeof(SoapBase64Binary);
122         internal static Type typeofSoapInteger = typeof(SoapInteger);
123         internal static Type typeofSoapPositiveInteger = typeof(SoapPositiveInteger);
124         internal static Type typeofSoapNonPositiveInteger = typeof(SoapNonPositiveInteger);
125         internal static Type typeofSoapNonNegativeInteger = typeof(SoapNonNegativeInteger);
126         internal static Type typeofSoapNegativeInteger = typeof(SoapNegativeInteger);
127         internal static Type typeofSoapAnyUri = typeof(SoapAnyUri);
128         internal static Type typeofSoapQName = typeof(SoapQName);
129         internal static Type typeofSoapNotation = typeof(SoapNotation);
130         internal static Type typeofSoapNormalizedString = typeof(SoapNormalizedString);
131         internal static Type typeofSoapToken = typeof(SoapToken);
132         internal static Type typeofSoapLanguage = typeof(SoapLanguage);
133         internal static Type typeofSoapName = typeof(SoapName);
134         internal static Type typeofSoapIdrefs = typeof(SoapIdrefs);
135         internal static Type typeofSoapEntities = typeof(SoapEntities);
136         internal static Type typeofSoapNmtoken = typeof(SoapNmtoken);
137         internal static Type typeofSoapNmtokens = typeof(SoapNmtokens);
138         internal static Type typeofSoapNcName = typeof(SoapNcName);
139         internal static Type typeofSoapId = typeof(SoapId);
140         internal static Type typeofSoapIdref = typeof(SoapIdref);
141         internal static Type typeofSoapEntity = typeof(SoapEntity);
142         internal static Type typeofISoapXsd = typeof(ISoapXsd);
143     }
144 
145 
146 [System.Runtime.InteropServices.ComVisible(true)]
147     public interface ISoapXsd
148     {
149 
GetXsdType()150         String GetXsdType();
151     }
152 
153     // Soap interop xsd types
154     //Convert from ISO Date to urt DateTime
155     // The form of the Date is yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff or yyyy'-'MM'-'dd' or yyyy'-'MM'-'dd'T'HH':'mm':'ss
156 
157 [System.Runtime.InteropServices.ComVisible(true)]
158     public sealed class SoapDateTime
159     {
160 
161         public static String XsdType
162         {
163             get{ return "dateTime";}
164         }
165 
166         private static String[] formats =
167         {
168             "yyyy-MM-dd'T'HH:mm:ss.fffffffzzz",
169             "yyyy-MM-dd'T'HH:mm:ss.ffff",
170             "yyyy-MM-dd'T'HH:mm:ss.ffffzzz",
171             "yyyy-MM-dd'T'HH:mm:ss.fff",
172             "yyyy-MM-dd'T'HH:mm:ss.fffzzz",
173             "yyyy-MM-dd'T'HH:mm:ss.ff",
174             "yyyy-MM-dd'T'HH:mm:ss.ffzzz",
175             "yyyy-MM-dd'T'HH:mm:ss.f",
176             "yyyy-MM-dd'T'HH:mm:ss.fzzz",
177             "yyyy-MM-dd'T'HH:mm:ss",
178             "yyyy-MM-dd'T'HH:mm:sszzz",
179             "yyyy-MM-dd'T'HH:mm:ss.fffff",
180             "yyyy-MM-dd'T'HH:mm:ss.fffffzzz",
181             "yyyy-MM-dd'T'HH:mm:ss.ffffff",
182             "yyyy-MM-dd'T'HH:mm:ss.ffffffzzz",
183             "yyyy-MM-dd'T'HH:mm:ss.fffffff",
184             "yyyy-MM-dd'T'HH:mm:ss.ffffffff",
185             "yyyy-MM-dd'T'HH:mm:ss.ffffffffzzz",
186             "yyyy-MM-dd'T'HH:mm:ss.fffffffff",
187             "yyyy-MM-dd'T'HH:mm:ss.fffffffffzzz",
188             "yyyy-MM-dd'T'HH:mm:ss.ffffffffff",
189             "yyyy-MM-dd'T'HH:mm:ss.ffffffffffzzz"
190         };
191 
192 
ToString(DateTime value)193         public static String ToString(DateTime value)
194         {
195             return value.ToString("yyyy-MM-dd'T'HH:mm:ss.fffffffzzz", CultureInfo.InvariantCulture);
196         }
197 
198 
Parse(String value)199         public static DateTime Parse(String value)
200         {
201             DateTime dt;
202             try
203             {
204                 if (value == null)
205                     dt = DateTime.MinValue;
206                 else
207                 {
208                     String time = value;
209                     if (value.EndsWith("Z", StringComparison.Ordinal))
210                         time = value.Substring(0, value.Length-1)+"-00:00";
211                     dt = DateTime.ParseExact(time, formats, CultureInfo.InvariantCulture,DateTimeStyles.None);
212                 }
213 
214             }
215             catch (Exception)
216             {
217                 throw new RemotingException(
218                                            String.Format(
219                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
220                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:dateTime", value));
221             }
222 
223             return dt;
224         }
225 
226     }
227 
228 
229 [System.Runtime.InteropServices.ComVisible(true)]
230     public sealed class SoapDuration
231     {
232         // Convert from ISO/xsd TimeDuration to urt TimeSpan
233         // The form of the time duration is PxxYxxDTxxHxxMxx.xxxS or PxxYxxDTxxHxxMxxS
234         // Keep in sync with Message.cs
235 
236 
237         public static String XsdType
238         {
239             get{ return "duration";}
240         }
241 
242         // calcuate carryover points by ISO 8601 : 1998 section 5.5.3.2.1 Alternate format
243         // algorithm not to exceed 12 months, 30 day
244         // note with this algorithm year has 360 days.
CarryOver(int inDays, out int years, out int months, out int days)245         private static void CarryOver(int inDays, out int years, out int months, out int days)
246         {
247             years = inDays/360;
248             int yearDays = years*360;
249             months = Math.Max(0, inDays - yearDays)/30;
250             int monthDays = months*30;
251             days = Math.Max(0, inDays - (yearDays+monthDays));
252             days = inDays%30;
253         }
254 
255 
256         [System.Security.SecuritySafeCritical]  // auto-generated
ToString(TimeSpan timeSpan)257         public static String ToString(TimeSpan timeSpan)
258         {
259             StringBuilder sb = new StringBuilder(10);
260             sb.Length = 0;
261             if (TimeSpan.Compare(timeSpan, TimeSpan.Zero) < 1)
262             {
263                 sb.Append('-');
264                 //timeSpan = timeSpan.Negate(); //negating timespan at top level not at each piece such as Day
265             }
266 
267             int years = 0;
268             int months = 0;
269             int days = 0;
270 
271             CarryOver(Math.Abs(timeSpan.Days), out years, out months, out days);
272 
273             sb.Append('P');
274             sb.Append(years);
275             sb.Append('Y');
276             sb.Append(months);
277             sb.Append('M');
278             sb.Append(days);
279             sb.Append("DT");
280             sb.Append(Math.Abs(timeSpan.Hours));
281             sb.Append('H');
282             sb.Append(Math.Abs(timeSpan.Minutes));
283             sb.Append('M');
284             sb.Append(Math.Abs(timeSpan.Seconds));
285             long timea = Math.Abs(timeSpan.Ticks % TimeSpan.TicksPerDay);
286             int t1 = (int)(timea % TimeSpan.TicksPerSecond);
287             if (t1 != 0)
288             {
289                 String t2 = ParseNumbers.IntToString(t1, 10, 7, '0', 0);
290                 sb.Append('.');
291                 sb.Append(t2);
292             }
293             sb.Append('S');
294             return sb.ToString();
295         }
296 
297 
Parse(String value)298         public static TimeSpan Parse(String value)
299         {
300             int sign = 1;
301 
302             try
303             {
304                 if (value == null)
305                     return TimeSpan.Zero;
306 
307                 if (value[0] == '-')
308                     sign = -1;
309 
310 
311                 Char[] c = value.ToCharArray();
312                 int[] timeValues = new int[7];
313                 String year = "0";
314                 String month = "0";
315                 String day = "0";
316                 String hour = "0";
317                 String minute = "0";
318                 String second = "0";
319                 String fraction = "0";
320                 bool btime = false;
321                 bool bmill = false;
322                 int beginField = 0;
323 
324                 for (int i=0; i<c.Length; i++)
325                 {
326                     switch (c[i])
327                     {
328                         case 'P':
329                             beginField = i+1;
330                             break;
331                         case 'Y':
332                             year = new String(c,beginField, i-beginField);
333                             beginField = i+1;
334                             break;
335                         case 'M':
336                             if (btime)
337                                 minute = new String(c, beginField, i-beginField);
338                             else
339                                 month = new String(c, beginField, i-beginField);
340                             beginField = i+1;
341                             break;
342                         case 'D':
343                             day = new String(c, beginField, i-beginField);
344                             beginField = i+1;
345                             break;
346                         case 'T':
347                             btime = true;
348                             beginField = i+1;
349                             break;
350                         case 'H':
351                             hour = new String(c, beginField, i-beginField);
352                             beginField = i+1;
353                             break;
354                         case '.':
355                             bmill = true;
356                             second = new String(c, beginField, i-beginField);
357                             beginField = i+1;
358                             break;
359                         case 'S':
360                             if (!bmill)
361                                 second = new String(c, beginField, i-beginField);
362                             else
363                                 fraction = new String(c, beginField, i-beginField);
364                             break;
365                         case 'Z':
366                             break;
367                         default:
368                             // Number continue to loop until end of number
369                             break;
370                     }
371                 }
372 
373                 long ticks = sign*
374                     (
375                      (Int64.Parse(year, CultureInfo.InvariantCulture)*360+Int64.Parse(month, CultureInfo.InvariantCulture)*30+Int64.Parse(day, CultureInfo.InvariantCulture))*TimeSpan.TicksPerDay+
376                      Int64.Parse(hour, CultureInfo.InvariantCulture)*TimeSpan.TicksPerHour+
377                      Int64.Parse(minute, CultureInfo.InvariantCulture)*TimeSpan.TicksPerMinute+
378                      Convert.ToInt64(Double.Parse(second+"."+fraction, CultureInfo.InvariantCulture)*(Double)TimeSpan.TicksPerSecond)
379                     );
380                 return new TimeSpan(ticks);
381             }
382             catch (Exception)
383             {
384                 throw new RemotingException(
385                                            String.Format(
386                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
387                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:duration", value));
388             }
389         }
390     }
391 
392     [Serializable]
393 [System.Runtime.InteropServices.ComVisible(true)]
394     public sealed class SoapTime : ISoapXsd
395     {
396         DateTime _value = DateTime.MinValue;
397 
398         public static String XsdType
399         {
400             get{ return "time";}
401         }
402 
403 
GetXsdType()404         public String GetXsdType()
405         {
406             return XsdType;
407         }
408 
409         private static String[] formats =
410         {
411             "HH:mm:ss.fffffffzzz",
412             "HH:mm:ss.ffff",
413             "HH:mm:ss.ffffzzz",
414             "HH:mm:ss.fff",
415             "HH:mm:ss.fffzzz",
416             "HH:mm:ss.ff",
417             "HH:mm:ss.ffzzz",
418             "HH:mm:ss.f",
419             "HH:mm:ss.fzzz",
420             "HH:mm:ss",
421             "HH:mm:sszzz",
422             "HH:mm:ss.fffff",
423             "HH:mm:ss.fffffzzz",
424             "HH:mm:ss.ffffff",
425             "HH:mm:ss.ffffffzzz",
426             "HH:mm:ss.fffffff",
427             "HH:mm:ss.ffffffff",
428             "HH:mm:ss.ffffffffzzz",
429             "HH:mm:ss.fffffffff",
430             "HH:mm:ss.fffffffffzzz",
431             "HH:mm:ss.fffffffff",
432             "HH:mm:ss.fffffffffzzz"
433         };
434 
435 
SoapTime()436         public SoapTime()
437         {
438         }
439 
440 
SoapTime(DateTime value)441         public SoapTime(DateTime value)
442         {
443             _value = value;
444         }
445 
446 
447         public DateTime Value
448         {
449             get {return _value;}
450             set {_value = new DateTime(1, 1, 1, value.Hour, value.Minute, value.Second, value.Millisecond);}
451         }
452 
453 
ToString()454         public override String ToString()
455         {
456             return _value.ToString("HH:mm:ss.fffffffzzz", CultureInfo.InvariantCulture);
457         }
458 
459 
Parse(String value)460         public static SoapTime Parse(String value)
461         {
462             String time = value;
463             if (value.EndsWith("Z", StringComparison.Ordinal))
464                 time = value.Substring(0, value.Length-1)+"-00:00";
465             SoapTime dt = new SoapTime(DateTime.ParseExact(time, formats, CultureInfo.InvariantCulture,DateTimeStyles.None));
466             return dt;
467         }
468     }
469 
470 
471     [Serializable]
472 [System.Runtime.InteropServices.ComVisible(true)]
473     public sealed class SoapDate : ISoapXsd
474     {
475 
476         DateTime _value = DateTime.MinValue.Date;
477         int _sign = 0;
478 
479 
480         public static String XsdType
481         {
482             get{ return "date";}
483         }
484 
485 
486 
GetXsdType()487         public String GetXsdType()
488         {
489             return XsdType;
490         }
491 
492         private static String[] formats =
493         {
494             "yyyy-MM-dd",
495             "'+'yyyy-MM-dd",
496             "'-'yyyy-MM-dd",
497             "yyyy-MM-ddzzz",
498             "'+'yyyy-MM-ddzzz",
499             "'-'yyyy-MM-ddzzz"
500         };
501 
502 
503 
SoapDate()504         public SoapDate()
505         {
506         }
507 
508 
SoapDate(DateTime value)509         public SoapDate(DateTime value)
510         {
511             _value = value;
512         }
513 
514 
SoapDate(DateTime value, int sign)515         public SoapDate(DateTime value, int sign)
516         {
517             _value = value;
518             _sign = sign;
519         }
520 
521 
522         public DateTime Value
523         {
524             get {return _value;}
525             set {_value = value.Date;}
526         }
527 
528 
529         public int Sign
530         {
531             get {return _sign;}
532             set {_sign = value;}
533         }
534 
535 
ToString()536         public override String ToString()
537         {
538             if (_sign < 0)
539                 return _value.ToString("'-'yyyy-MM-dd", CultureInfo.InvariantCulture);
540             else
541                 return _value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
542         }
543 
544 
Parse(String value)545         public static SoapDate Parse(String value)
546         {
547             int sign = 0;
548             if (value[0] == '-')
549                 sign = -1;
550             return new SoapDate(DateTime.ParseExact(value, formats, CultureInfo.InvariantCulture,DateTimeStyles.None), sign);
551         }
552     }
553 
554 
555     [Serializable]
556 [System.Runtime.InteropServices.ComVisible(true)]
557     public sealed class SoapYearMonth : ISoapXsd
558     {
559 
560         DateTime _value = DateTime.MinValue;
561         int _sign = 0;
562 
563 
564         public static String XsdType
565         {
566             get{ return "gYearMonth";}
567         }
568 
569 
GetXsdType()570         public String GetXsdType()
571         {
572             return XsdType;
573         }
574 
575         private static String[] formats =
576         {
577             "yyyy-MM",
578             "'+'yyyy-MM",
579             "'-'yyyy-MM",
580             "yyyy-MMzzz",
581             "'+'yyyy-MMzzz",
582             "'-'yyyy-MMzzz"
583         };
584 
585 
586 
SoapYearMonth()587         public SoapYearMonth()
588         {
589         }
590 
591 
SoapYearMonth(DateTime value)592         public SoapYearMonth(DateTime value)
593         {
594             _value = value;
595         }
596 
597 
SoapYearMonth(DateTime value, int sign)598         public SoapYearMonth(DateTime value, int sign)
599         {
600             _value = value;
601             _sign = sign;
602         }
603 
604 
605 
606         public DateTime Value
607         {
608             get {return _value;}
609             set {_value = value;}
610         }
611 
612 
613         public int Sign
614         {
615             get {return _sign;}
616             set {_sign = value;}
617         }
618 
619 
ToString()620         public override String ToString()
621         {
622             if (_sign < 0)
623                 return _value.ToString("'-'yyyy-MM", CultureInfo.InvariantCulture);
624             else
625                 return _value.ToString("yyyy-MM", CultureInfo.InvariantCulture);
626         }
627 
628 
Parse(String value)629         public static SoapYearMonth Parse(String value)
630         {
631             int sign = 0;
632             if (value[0] == '-')
633                 sign = -1;
634             return new SoapYearMonth(DateTime.ParseExact(value, formats, CultureInfo.InvariantCulture,DateTimeStyles.None), sign);
635         }
636     }
637 
638 
639     [Serializable]
640 [System.Runtime.InteropServices.ComVisible(true)]
641     public sealed class SoapYear : ISoapXsd
642     {
643 
644         DateTime _value = DateTime.MinValue;
645         int _sign = 0;
646 
647 
648         public static String XsdType
649         {
650             get{ return "gYear";}
651         }
652 
653 
GetXsdType()654         public String GetXsdType()
655         {
656             return XsdType;
657         }
658 
659         private static String[] formats =
660         {
661             "yyyy",
662             "'+'yyyy",
663             "'-'yyyy",
664             "yyyyzzz",
665             "'+'yyyyzzz",
666             "'-'yyyyzzz"
667         };
668 
669 
670 
SoapYear()671         public SoapYear()
672         {
673         }
674 
675 
SoapYear(DateTime value)676         public SoapYear(DateTime value)
677         {
678             _value = value;
679         }
680 
681 
SoapYear(DateTime value, int sign)682         public SoapYear(DateTime value, int sign)
683         {
684             _value = value;
685             _sign = sign;
686         }
687 
688 
689 
690         public DateTime Value
691         {
692             get {return _value;}
693             set {_value = value;}
694         }
695 
696 
697         public int Sign
698         {
699             get {return _sign;}
700             set {_sign = value;}
701         }
702 
703 
ToString()704         public override String ToString()
705         {
706             if (_sign < 0)
707                 return _value.ToString("'-'yyyy", CultureInfo.InvariantCulture);
708             else
709                 return _value.ToString("yyyy", CultureInfo.InvariantCulture);
710         }
711 
712 
Parse(String value)713         public static SoapYear Parse(String value)
714         {
715             int sign = 0;
716             if (value[0] == '-')
717                 sign = -1;
718             return new SoapYear(DateTime.ParseExact(value, formats, CultureInfo.InvariantCulture,DateTimeStyles.None), sign);
719         }
720     }
721 
722 
723     [Serializable]
724 [System.Runtime.InteropServices.ComVisible(true)]
725     public sealed class SoapMonthDay : ISoapXsd
726     {
727         DateTime _value = DateTime.MinValue;
728 
729 
730         public static String XsdType
731         {
732             get{ return "gMonthDay";}
733         }
734 
735 
GetXsdType()736         public String GetXsdType()
737         {
738             return XsdType;
739         }
740 
741         private static String[] formats =
742         {
743             "--MM-dd",
744             "--MM-ddzzz"
745         };
746 
747 
748 
SoapMonthDay()749         public SoapMonthDay()
750         {
751         }
752 
753 
SoapMonthDay(DateTime value)754         public SoapMonthDay(DateTime value)
755         {
756             _value = value;
757         }
758 
759 
760         public DateTime Value
761         {
762             get {return _value;}
763             set {_value = value;}
764         }
765 
766 
ToString()767         public override String ToString()
768         {
769             return _value.ToString("'--'MM'-'dd", CultureInfo.InvariantCulture);
770         }
771 
772 
Parse(String value)773         public static SoapMonthDay Parse(String value)
774         {
775             return new SoapMonthDay(DateTime.ParseExact(value, formats, CultureInfo.InvariantCulture,DateTimeStyles.None));
776         }
777     }
778 
779 
780     [Serializable]
781 [System.Runtime.InteropServices.ComVisible(true)]
782     public sealed class SoapDay : ISoapXsd
783     {
784         DateTime _value = DateTime.MinValue;
785 
786 
787         public static String XsdType
788         {
789             get{ return "gDay";}
790         }
791 
792 
GetXsdType()793         public String GetXsdType()
794         {
795             return XsdType;
796         }
797 
798 
799         private static String[] formats =
800         {
801             "---dd",
802             "---ddzzz"
803         };
804 
805 
SoapDay()806         public SoapDay()
807         {
808         }
809 
810 
SoapDay(DateTime value)811         public SoapDay(DateTime value)
812         {
813             _value = value;
814         }
815 
816 
817         public DateTime Value
818         {
819             get {return _value;}
820             set {_value = value;}
821         }
822 
823 
ToString()824         public override String ToString()
825         {
826             return _value.ToString("---dd", CultureInfo.InvariantCulture);
827         }
828 
829 
Parse(String value)830         public static SoapDay Parse(String value)
831         {
832             return new SoapDay(DateTime.ParseExact(value, formats, CultureInfo.InvariantCulture,DateTimeStyles.None));
833         }
834     }
835 
836 
837     [Serializable]
838 [System.Runtime.InteropServices.ComVisible(true)]
839     public sealed class SoapMonth : ISoapXsd
840     {
841         DateTime _value = DateTime.MinValue;
842 
843 
844         public static String XsdType
845         {
846             get{ return "gMonth";}
847         }
848 
849 
GetXsdType()850         public String GetXsdType()
851         {
852             return XsdType;
853         }
854 
855         private static String[] formats =
856         {
857             "--MM--",
858             "--MM--zzz"
859         };
860 
861 
862 
SoapMonth()863         public SoapMonth()
864         {
865         }
866 
867 
SoapMonth(DateTime value)868         public SoapMonth(DateTime value)
869         {
870             _value = value;
871         }
872 
873 
874         public DateTime Value
875         {
876             get {return _value;}
877             set {_value = value;}
878         }
879 
880 
ToString()881         public override String ToString()
882         {
883             return _value.ToString("--MM--", CultureInfo.InvariantCulture);
884         }
885 
886 
Parse(String value)887         public static SoapMonth Parse(String value)
888         {
889             return new SoapMonth(DateTime.ParseExact(value, formats, CultureInfo.InvariantCulture,DateTimeStyles.None));
890         }
891     }
892 
893 
894     [Serializable]
895 [System.Runtime.InteropServices.ComVisible(true)]
896     public sealed class SoapHexBinary : ISoapXsd
897     {
898         Byte[] _value;
899 
900         public static String XsdType
901         {
902             get{ return "hexBinary";}
903         }
904 
905 
GetXsdType()906         public String GetXsdType()
907         {
908             return XsdType;
909         }
910 
911 
SoapHexBinary()912         public SoapHexBinary()
913         {
914         }
915 
916 
SoapHexBinary(Byte[] value)917         public SoapHexBinary(Byte[] value)
918         {
919             _value = value;
920         }
921 
922 
923         public Byte[] Value
924         {
925             get {return _value;}
926             set {_value = value;}
927         }
928 
929         StringBuilder sb = new StringBuilder(100);
930 
ToString()931         public override String ToString()
932         {
933             sb.Length = 0;
934             for (int i=0; i<_value.Length; i++)
935             {
936                 String s = _value[i].ToString("X", CultureInfo.InvariantCulture);
937                 if (s.Length == 1)
938                     sb.Append('0');
939                 sb.Append(s);
940             }
941             return sb.ToString();
942         }
943 
944 
Parse(String value)945         public static SoapHexBinary Parse(String value)
946         {
947             return new SoapHexBinary(ToByteArray(SoapType.FilterBin64(value)));
948         }
949 
950 
951 
ToByteArray(String value)952         private static Byte[] ToByteArray(String value)
953         {
954             Char[] cA = value.ToCharArray();
955             if (cA.Length%2 != 0)
956             {
957                 throw new RemotingException(
958                                            String.Format(
959                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
960                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:hexBinary", value));
961             }
962             Byte[] bA = new Byte[cA.Length/2];
963             for (int i = 0; i< cA.Length/2; i++)
964             {
965                 bA[i] = (Byte)(ToByte(cA[i*2], value)*16+ToByte(cA[i*2+1], value));
966             }
967 
968             return bA;
969         }
970 
ToByte(Char c, String value)971         private static Byte ToByte(Char c, String value)
972         {
973             Byte b = (Byte)0;
974             String s = c.ToString();
975             try
976             {
977                 s = c.ToString();
978                 b = Byte.Parse(s, NumberStyles.HexNumber, CultureInfo.InvariantCulture);
979             }
980             catch (Exception)
981             {
982                 throw new RemotingException(Environment.GetResourceString("Remoting_SOAPInteropxsdInvalid", "xsd:hexBinary", value));
983             }
984 
985             return b;
986         }
987     }
988 
989 
990     [Serializable]
991 [System.Runtime.InteropServices.ComVisible(true)]
992     public sealed class SoapBase64Binary : ISoapXsd
993     {
994         Byte[] _value;
995 
996 
997         public static String XsdType
998         {
999             get{ return "base64Binary";}
1000         }
1001 
1002 
GetXsdType()1003         public String GetXsdType()
1004         {
1005             return XsdType;
1006         }
1007 
1008 
SoapBase64Binary()1009         public SoapBase64Binary()
1010         {
1011         }
1012 
1013 
SoapBase64Binary(Byte[] value)1014         public SoapBase64Binary(Byte[] value)
1015         {
1016             _value = value;
1017         }
1018 
1019 
1020         public Byte[] Value
1021         {
1022             get {return _value;}
1023             set {_value = value;}
1024         }
1025 
1026 
ToString()1027         public override String ToString()
1028         {
1029             if (_value == null)
1030                 return null;
1031 
1032             // Put in line feeds every 76 characters.
1033             return SoapType.LineFeedsBin64(Convert.ToBase64String(_value));
1034         }
1035 
Parse(String value)1036         public static SoapBase64Binary Parse(String value)
1037         {
1038             if (value == null || value.Length == 0)
1039                 return new SoapBase64Binary(new Byte[0]);
1040 
1041             Byte[] bA;
1042             try
1043             {
1044                 bA = Convert.FromBase64String(SoapType.FilterBin64(value));
1045             }
1046             catch (Exception)
1047             {
1048                 throw new RemotingException(
1049                                            String.Format(
1050                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
1051                                                                                      "Remoting_SOAPInteropxsdInvalid"), "base64Binary", value));
1052             }
1053             return new SoapBase64Binary(bA);
1054         }
1055     }
1056 
1057 
1058     [Serializable]
1059 [System.Runtime.InteropServices.ComVisible(true)]
1060     public sealed class SoapInteger : ISoapXsd
1061     {
1062         Decimal _value;
1063 
1064 
1065         public static String XsdType
1066         {
1067             get{ return "integer";}
1068         }
1069 
1070 
GetXsdType()1071         public String GetXsdType()
1072         {
1073             return XsdType;
1074         }
1075 
1076 
SoapInteger()1077         public SoapInteger()
1078         {
1079         }
1080 
1081 
SoapInteger(Decimal value)1082         public SoapInteger (Decimal value)
1083         {
1084             _value = Decimal.Truncate(value);
1085         }
1086 
1087 
1088         public Decimal Value
1089         {
1090             get {return _value;}
1091             set {_value = Decimal.Truncate(value);}
1092         }
1093 
1094 
ToString()1095         public override String ToString()
1096         {
1097             return _value.ToString(CultureInfo.InvariantCulture);
1098         }
1099 
1100 
Parse(String value)1101         public static SoapInteger Parse(String value)
1102         {
1103             return new SoapInteger(Decimal.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture));
1104         }
1105     }
1106 
1107 
1108     [Serializable]
1109 [System.Runtime.InteropServices.ComVisible(true)]
1110     public sealed class SoapPositiveInteger : ISoapXsd
1111     {
1112         Decimal _value;
1113 
1114 
1115         public static String XsdType
1116         {
1117             get{ return "positiveInteger";}
1118         }
1119 
1120 
GetXsdType()1121         public String GetXsdType()
1122         {
1123             return XsdType;
1124         }
1125 
1126 
SoapPositiveInteger()1127         public SoapPositiveInteger()
1128         {
1129         }
1130 
1131 
1132 
SoapPositiveInteger(Decimal value)1133         public SoapPositiveInteger (Decimal value)
1134         {
1135             _value = Decimal.Truncate(value);
1136             if (_value < Decimal.One)
1137                 throw new RemotingException(
1138                                            String.Format(
1139                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
1140                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:positiveInteger", value));
1141         }
1142 
1143 
1144         public Decimal Value
1145         {
1146             get {return _value;}
1147             set {
1148                 _value = Decimal.Truncate(value);
1149                 if (_value < Decimal.One)
1150                     throw new RemotingException(
1151                                                String.Format(
1152                                                             CultureInfo.CurrentCulture, Environment.GetResourceString(
1153                                                                                          "Remoting_SOAPInteropxsdInvalid"), "xsd:positiveInteger", value));
1154             }
1155         }
1156 
1157 
ToString()1158         public override String ToString()
1159         {
1160             return _value.ToString(CultureInfo.InvariantCulture);
1161         }
1162 
1163 
Parse(String value)1164         public static SoapPositiveInteger Parse(String value)
1165         {
1166             return new SoapPositiveInteger(Decimal.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture));
1167         }
1168     }
1169 
1170 
1171     [Serializable]
1172 [System.Runtime.InteropServices.ComVisible(true)]
1173     public sealed class SoapNonPositiveInteger : ISoapXsd
1174     {
1175         Decimal _value;
1176 
1177 
1178         public static String XsdType
1179         {
1180             get{ return "nonPositiveInteger";}
1181         }
1182 
1183 
GetXsdType()1184         public String GetXsdType()
1185         {
1186             return XsdType;
1187         }
1188 
1189 
SoapNonPositiveInteger()1190         public SoapNonPositiveInteger()
1191         {
1192         }
1193 
1194 
SoapNonPositiveInteger(Decimal value)1195         public SoapNonPositiveInteger (Decimal value)
1196         {
1197             _value = Decimal.Truncate(value);
1198             if (_value > Decimal.Zero)
1199                 throw new RemotingException(
1200                                            String.Format(
1201                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
1202                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:nonPositiveInteger", value));
1203         }
1204 
1205 
1206         public Decimal Value
1207         {
1208             get {return _value;}
1209             set {
1210                 _value = Decimal.Truncate(value);
1211                 if (_value > Decimal.Zero)
1212                     throw new RemotingException(
1213                                                String.Format(
1214                                                             CultureInfo.CurrentCulture, Environment.GetResourceString(
1215                                                                                          "Remoting_SOAPInteropxsdInvalid"), "xsd:nonPositiveInteger", value));
1216             }
1217         }
1218 
1219 
ToString()1220         public override String ToString()
1221         {
1222             return  _value.ToString(CultureInfo.InvariantCulture);
1223         }
1224 
1225 
Parse(String value)1226         public static SoapNonPositiveInteger Parse(String value)
1227         {
1228             return new SoapNonPositiveInteger(Decimal.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture));
1229         }
1230     }
1231 
1232 
1233     [Serializable]
1234 [System.Runtime.InteropServices.ComVisible(true)]
1235     public sealed class SoapNonNegativeInteger : ISoapXsd
1236     {
1237         Decimal _value;
1238 
1239 
1240         public static String XsdType
1241         {
1242             get{ return "nonNegativeInteger";}
1243         }
1244 
1245 
1246 
GetXsdType()1247         public String GetXsdType()
1248         {
1249             return XsdType;
1250         }
1251 
1252 
SoapNonNegativeInteger()1253         public SoapNonNegativeInteger()
1254         {
1255         }
1256 
SoapNonNegativeInteger(Decimal value)1257         public SoapNonNegativeInteger (Decimal value)
1258         {
1259             _value = Decimal.Truncate(value);
1260             if (_value < Decimal.Zero)
1261                 throw new RemotingException(
1262                                            String.Format(
1263                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
1264                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:nonNegativeInteger", value));
1265         }
1266 
1267 
1268         public Decimal Value
1269         {
1270             get {return _value;}
1271             set {
1272                 _value = Decimal.Truncate(value);
1273                 if (_value < Decimal.Zero)
1274                     throw new RemotingException(
1275                                                String.Format(
1276                                                             CultureInfo.CurrentCulture, Environment.GetResourceString(
1277                                                                                          "Remoting_SOAPInteropxsdInvalid"), "xsd:nonNegativeInteger", value));
1278             }
1279         }
1280 
1281 
ToString()1282         public override String ToString()
1283         {
1284             return _value.ToString(CultureInfo.InvariantCulture);
1285         }
1286 
1287 
Parse(String value)1288         public static SoapNonNegativeInteger Parse(String value)
1289         {
1290             return new SoapNonNegativeInteger(Decimal.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture));
1291         }
1292     }
1293 
1294 
1295     [Serializable]
1296 [System.Runtime.InteropServices.ComVisible(true)]
1297     public sealed class SoapNegativeInteger : ISoapXsd
1298     {
1299         Decimal _value;
1300 
1301 
1302         public static String XsdType
1303         {
1304             get{ return "negativeInteger";}
1305         }
1306 
1307 
GetXsdType()1308         public String GetXsdType()
1309         {
1310             return XsdType;
1311         }
1312 
1313 
SoapNegativeInteger()1314         public SoapNegativeInteger()
1315         {
1316         }
1317 
1318 
SoapNegativeInteger(Decimal value)1319         public SoapNegativeInteger (Decimal value)
1320         {
1321             _value = Decimal.Truncate(value);
1322             if (value > Decimal.MinusOne)
1323                 throw new RemotingException(
1324                                            String.Format(
1325                                                         CultureInfo.CurrentCulture, Environment.GetResourceString(
1326                                                                                      "Remoting_SOAPInteropxsdInvalid"), "xsd:negativeInteger", value));
1327         }
1328 
1329 
1330         public Decimal Value
1331         {
1332             get {return _value;}
1333             set {
1334                 _value = Decimal.Truncate(value);
1335                 if (_value > Decimal.MinusOne)
1336                     throw new RemotingException(
1337                                                String.Format(
1338                                                             CultureInfo.CurrentCulture, Environment.GetResourceString(
1339                                                                                          "Remoting_SOAPInteropxsdInvalid"), "xsd:negativeInteger", value));
1340             }
1341         }
1342 
1343 
ToString()1344         public override String ToString()
1345         {
1346             return _value.ToString(CultureInfo.InvariantCulture);
1347         }
1348 
1349 
Parse(String value)1350         public static SoapNegativeInteger Parse(String value)
1351         {
1352             return new SoapNegativeInteger(Decimal.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture));
1353         }
1354     }
1355 
1356     [Serializable]
1357 [System.Runtime.InteropServices.ComVisible(true)]
1358     public sealed class SoapAnyUri : ISoapXsd
1359     {
1360         String _value;
1361 
1362 
1363         public static String XsdType
1364         {
1365             get{ return "anyURI";}
1366         }
1367 
1368 
GetXsdType()1369         public String GetXsdType()
1370         {
1371             return XsdType;
1372         }
1373 
1374 
SoapAnyUri()1375         public SoapAnyUri()
1376         {
1377         }
1378 
1379 
SoapAnyUri(String value)1380         public SoapAnyUri (String value)
1381         {
1382             _value = value;
1383         }
1384 
1385 
1386         public String Value
1387         {
1388             get {return _value;}
1389             set {_value = value;}
1390         }
1391 
1392 
ToString()1393         public override String ToString()
1394         {
1395             return _value;
1396         }
1397 
1398 
Parse(String value)1399         public static SoapAnyUri Parse(String value)
1400         {
1401             return new SoapAnyUri(value);
1402         }
1403     }
1404 
1405 
1406     [Serializable]
1407 [System.Runtime.InteropServices.ComVisible(true)]
1408     public sealed class SoapQName : ISoapXsd
1409     {
1410         String _name;
1411         String _namespace;
1412         String _key;
1413 
1414 
1415         public static String XsdType
1416         {
1417             get{ return "QName";}
1418         }
1419 
1420 
GetXsdType()1421         public String GetXsdType()
1422         {
1423             return XsdType;
1424         }
1425 
1426 
SoapQName()1427         public SoapQName()
1428         {
1429         }
1430 
1431 
SoapQName(String value)1432         public SoapQName(String value)
1433         {
1434             _name = value;
1435         }
1436 
1437 
1438 
SoapQName(String key, String name)1439         public SoapQName (String key, String name)
1440         {
1441             _name = name;
1442             _key = key;
1443         }
1444 
1445 
SoapQName(String key, String name, String namespaceValue)1446         public SoapQName (String key, String name, String namespaceValue)
1447         {
1448             _name = name;
1449             _namespace = namespaceValue;
1450             _key = key;
1451         }
1452 
1453 
1454         public String Name
1455         {
1456             get {return _name;}
1457             set {_name = value;}
1458         }
1459 
1460 
1461         public String Namespace
1462         {
1463             get {
1464                 /*
1465                 if (_namespace == null || _namespace.Length == 0)
1466                     throw new RemotingException(String.Format(Environment.GetResourceString("Remoting_SOAPQNameNamespace"), _name));
1467                     */
1468 
1469                 return _namespace;
1470                 }
1471             set {_namespace = value;}
1472         }
1473 
1474 
1475         public String Key
1476         {
1477             get {return _key;}
1478             set {_key = value;}
1479         }
1480 
1481 
1482 
ToString()1483         public override String ToString()
1484         {
1485             if (_key == null || _key.Length == 0)
1486                 return _name;
1487             else
1488                 return _key+":"+_name;
1489         }
1490 
1491 
Parse(String value)1492         public static SoapQName Parse(String value)
1493         {
1494             if (value == null)
1495                 return new SoapQName();
1496 
1497             String key = "";
1498             String name = value;
1499 
1500             int index = value.IndexOf(':');
1501             if (index > 0)
1502             {
1503                 key = value.Substring(0,index);
1504                 name = value.Substring(index+1);
1505             }
1506 
1507             return new SoapQName(key, name);
1508         }
1509     }
1510 
1511 
1512     [Serializable]
1513 [System.Runtime.InteropServices.ComVisible(true)]
1514     public sealed class SoapNotation : ISoapXsd
1515     {
1516         String _value;
1517 
1518 
1519         public static String XsdType
1520         {
1521             get{ return "NOTATION";}
1522         }
1523 
1524 
GetXsdType()1525         public String GetXsdType()
1526         {
1527             return XsdType;
1528         }
1529 
1530 
SoapNotation()1531         public SoapNotation()
1532         {
1533         }
1534 
1535 
SoapNotation(String value)1536         public SoapNotation (String value)
1537         {
1538             _value = value;
1539         }
1540 
1541 
1542         public String Value
1543         {
1544             get {return _value;}
1545             set {_value = value;}
1546         }
1547 
1548 
ToString()1549         public override String ToString()
1550         {
1551             return _value;
1552         }
1553 
1554 
Parse(String value)1555         public static SoapNotation Parse(String value)
1556         {
1557             return new SoapNotation(value);
1558         }
1559     }
1560 
1561 
1562     // Used to pass a string to xml which won't be escaped.
1563 
1564     [Serializable]
1565 [System.Runtime.InteropServices.ComVisible(true)]
1566     public sealed class SoapNormalizedString : ISoapXsd
1567     {
1568         String _value;
1569 
1570 
1571         public static String XsdType
1572         {
1573             get{ return "normalizedString";}
1574         }
1575 
1576 
GetXsdType()1577         public String GetXsdType()
1578         {
1579             return XsdType;
1580         }
1581 
1582 
SoapNormalizedString()1583         public SoapNormalizedString()
1584         {
1585         }
1586 
SoapNormalizedString(String value)1587         public SoapNormalizedString (String value)
1588         {
1589             _value = Validate(value);
1590         }
1591 
1592         public String Value
1593         {
1594             get {return _value;}
1595             set {_value = Validate(value);}
1596         }
1597 
ToString()1598         public override String ToString()
1599         {
1600             return SoapType.Escape(_value);
1601         }
1602 
Parse(String value)1603         public static SoapNormalizedString Parse(String value)
1604         {
1605             return new SoapNormalizedString(value);
1606         }
1607 
Validate(String value)1608         private String Validate(String value)
1609         {
1610             if (value == null || value.Length == 0)
1611                 return value;
1612 
1613             Char[] validateChar = {(Char)0xD, (Char)0xA, (Char)0x9};
1614 
1615             int index = value.LastIndexOfAny(validateChar);
1616 
1617             if (index > -1)
1618                 throw new RemotingException(Environment.GetResourceString("Remoting_SOAPInteropxsdInvalid", "xsd:normalizedString", value));
1619 
1620             return value;
1621         }
1622 
1623     }
1624 
1625     [Serializable]
1626 [System.Runtime.InteropServices.ComVisible(true)]
1627     public sealed class SoapToken : ISoapXsd
1628     {
1629         String _value;
1630 
1631         public static String XsdType
1632         {
1633             get{return "token";}
1634         }
1635 
GetXsdType()1636         public String GetXsdType()
1637         {
1638             return XsdType;
1639         }
1640 
SoapToken()1641         public SoapToken()
1642         {
1643         }
1644 
SoapToken(String value)1645         public SoapToken (String value)
1646         {
1647             _value = Validate(value);
1648         }
1649 
1650         public String Value
1651         {
1652             get {return _value;}
1653             set {_value = Validate(value);}
1654         }
1655 
ToString()1656         public override String ToString()
1657         {
1658             return SoapType.Escape(_value);
1659         }
1660 
Parse(String value)1661         public static SoapToken Parse(String value)
1662         {
1663             return new SoapToken(value);
1664         }
1665 
Validate(String value)1666         private String Validate(String value)
1667         {
1668             if (value == null || value.Length == 0)
1669                 return value;
1670 
1671             Char[] validateChar = {(Char)0xD, (Char)0x9};
1672 
1673             int index = value.LastIndexOfAny(validateChar);
1674 
1675             if (index > -1)
1676                 throw new RemotingException(Environment.GetResourceString("Remoting_SOAPInteropxsdInvalid", "xsd:token", value));
1677 
1678             if (value.Length > 0)
1679             {
1680                 if (Char.IsWhiteSpace(value[0]) || Char.IsWhiteSpace(value[value.Length - 1]))
1681                     throw new RemotingException(Environment.GetResourceString("Remoting_SOAPInteropxsdInvalid", "xsd:token", value));
1682             }
1683 
1684             index = value.IndexOf("  ");
1685             if (index > -1)
1686                 throw new RemotingException(Environment.GetResourceString("Remoting_SOAPInteropxsdInvalid", "xsd:token", value));
1687 
1688             return value;
1689         }
1690     }
1691 
1692 
1693     [Serializable]
1694 [System.Runtime.InteropServices.ComVisible(true)]
1695     public sealed class SoapLanguage : ISoapXsd
1696     {
1697         String _value;
1698 
1699         public static String XsdType
1700         {
1701             get{return "language";}
1702         }
1703 
GetXsdType()1704         public String GetXsdType()
1705         {
1706             return XsdType;
1707         }
1708 
SoapLanguage()1709         public SoapLanguage()
1710         {
1711         }
1712 
SoapLanguage(String value)1713         public SoapLanguage (String value)
1714         {
1715             _value = value;
1716         }
1717 
1718         public String Value
1719         {
1720             get {return _value;}
1721             set {_value = value;}
1722         }
1723 
ToString()1724         public override String ToString()
1725         {
1726             return SoapType.Escape(_value);
1727         }
1728 
Parse(String value)1729         public static SoapLanguage Parse(String value)
1730         {
1731             return new SoapLanguage(value);
1732         }
1733     }
1734 
1735     [Serializable]
1736 [System.Runtime.InteropServices.ComVisible(true)]
1737     public sealed class SoapName : ISoapXsd
1738     {
1739         String _value;
1740 
1741         public static String XsdType
1742         {
1743             get{return "Name";}
1744         }
1745 
GetXsdType()1746         public String GetXsdType()
1747         {
1748             return XsdType;
1749         }
1750 
SoapName()1751         public SoapName()
1752         {
1753         }
1754 
SoapName(String value)1755         public SoapName (String value)
1756         {
1757             _value = value;
1758         }
1759 
1760         public String Value
1761         {
1762             get {return _value;}
1763             set {_value = value;}
1764         }
1765 
ToString()1766         public override String ToString()
1767         {
1768             return SoapType.Escape(_value);
1769         }
1770 
Parse(String value)1771         public static SoapName Parse(String value)
1772         {
1773             return new SoapName(value);
1774         }
1775     }
1776 
1777     [Serializable]
1778 [System.Runtime.InteropServices.ComVisible(true)]
1779     public sealed class SoapIdrefs : ISoapXsd
1780     {
1781         String _value;
1782 
1783         public static String XsdType
1784         {
1785             get{return "IDREFS";}
1786         }
1787 
GetXsdType()1788         public String GetXsdType()
1789         {
1790             return XsdType;
1791         }
1792 
SoapIdrefs()1793         public SoapIdrefs()
1794         {
1795         }
1796 
SoapIdrefs(String value)1797         public SoapIdrefs (String value)
1798         {
1799             _value = value;
1800         }
1801 
1802         public String Value
1803         {
1804             get {return _value;}
1805             set {_value = value;}
1806         }
1807 
ToString()1808         public override String ToString()
1809         {
1810             return SoapType.Escape(_value);
1811         }
1812 
Parse(String value)1813         public static SoapIdrefs Parse(String value)
1814         {
1815             return new SoapIdrefs(value);
1816         }
1817     }
1818 
1819     [Serializable]
1820 [System.Runtime.InteropServices.ComVisible(true)]
1821     public sealed class SoapEntities : ISoapXsd
1822     {
1823         String _value;
1824 
1825         public static String XsdType
1826         {
1827             get{return "ENTITIES";}
1828         }
1829 
GetXsdType()1830         public String GetXsdType()
1831         {
1832             return XsdType;
1833         }
1834 
1835 
SoapEntities()1836         public SoapEntities()
1837         {
1838         }
1839 
SoapEntities(String value)1840         public SoapEntities (String value)
1841         {
1842             _value = value;
1843         }
1844 
1845         public String Value
1846         {
1847             get {return _value;}
1848             set {_value = value;}
1849         }
1850 
ToString()1851         public override String ToString()
1852         {
1853             return SoapType.Escape(_value);
1854         }
1855 
Parse(String value)1856         public static SoapEntities Parse(String value)
1857         {
1858             return new SoapEntities(value);
1859         }
1860     }
1861 
1862     [Serializable]
1863 [System.Runtime.InteropServices.ComVisible(true)]
1864     public sealed class SoapNmtoken : ISoapXsd
1865     {
1866         String _value;
1867 
1868         public static String XsdType
1869         {
1870             get{return "NMTOKEN";}
1871         }
1872 
GetXsdType()1873         public String GetXsdType()
1874         {
1875             return XsdType;
1876         }
1877 
SoapNmtoken()1878         public SoapNmtoken()
1879         {
1880         }
1881 
SoapNmtoken(String value)1882         public SoapNmtoken (String value)
1883         {
1884             _value = value;
1885         }
1886 
1887         public String Value
1888         {
1889             get {return _value;}
1890             set {_value = value;}
1891         }
1892 
ToString()1893         public override String ToString()
1894         {
1895             return SoapType.Escape(_value);
1896         }
1897 
Parse(String value)1898         public static SoapNmtoken Parse(String value)
1899         {
1900             return new SoapNmtoken(value);
1901         }
1902     }
1903 
1904     [Serializable]
1905 [System.Runtime.InteropServices.ComVisible(true)]
1906     public sealed class SoapNmtokens : ISoapXsd
1907     {
1908         String _value;
1909 
1910         public static String XsdType
1911         {
1912             get{return "NMTOKENS";}
1913         }
1914 
GetXsdType()1915         public String GetXsdType()
1916         {
1917             return XsdType;
1918         }
1919 
SoapNmtokens()1920         public SoapNmtokens()
1921         {
1922         }
1923 
SoapNmtokens(String value)1924         public SoapNmtokens (String value)
1925         {
1926             _value = value;
1927         }
1928 
1929         public String Value
1930         {
1931             get {return _value;}
1932             set {_value = value;}
1933         }
1934 
ToString()1935         public override String ToString()
1936         {
1937             return SoapType.Escape(_value);
1938         }
1939 
Parse(String value)1940         public static SoapNmtokens Parse(String value)
1941         {
1942             return new SoapNmtokens(value);
1943         }
1944     }
1945 
1946     [Serializable]
1947 [System.Runtime.InteropServices.ComVisible(true)]
1948     public sealed class SoapNcName : ISoapXsd
1949     {
1950         String _value;
1951 
1952         public static String XsdType
1953         {
1954             get{return "NCName";}
1955         }
1956 
1957 
1958 
GetXsdType()1959         public String GetXsdType()
1960         {
1961             return XsdType;
1962         }
1963 
SoapNcName()1964         public SoapNcName()
1965         {
1966         }
1967 
SoapNcName(String value)1968         public SoapNcName (String value)
1969         {
1970             _value = value;
1971         }
1972 
1973         public String Value
1974         {
1975             get {return _value;}
1976             set {_value = value;}
1977         }
1978 
ToString()1979         public override String ToString()
1980         {
1981             return SoapType.Escape(_value);
1982         }
1983 
Parse(String value)1984         public static SoapNcName Parse(String value)
1985         {
1986             return new SoapNcName(value);
1987         }
1988     }
1989 
1990     [Serializable]
1991 [System.Runtime.InteropServices.ComVisible(true)]
1992     public sealed class SoapId : ISoapXsd
1993     {
1994         String _value;
1995 
1996         public static String XsdType
1997         {
1998             get{return "ID";}
1999         }
2000 
GetXsdType()2001         public String GetXsdType()
2002         {
2003             return XsdType;
2004         }
2005 
SoapId()2006         public SoapId()
2007         {
2008         }
2009 
SoapId(String value)2010         public SoapId (String value)
2011         {
2012             _value = value;
2013         }
2014 
2015         public String Value
2016         {
2017             get {return _value;}
2018             set {_value = value;}
2019         }
2020 
ToString()2021         public override String ToString()
2022         {
2023             return SoapType.Escape(_value);
2024         }
2025 
Parse(String value)2026         public static SoapId Parse(String value)
2027         {
2028             return new SoapId(value);
2029         }
2030     }
2031 
2032     [Serializable]
2033 [System.Runtime.InteropServices.ComVisible(true)]
2034     public sealed class SoapIdref : ISoapXsd
2035     {
2036         String _value;
2037 
2038         public static String XsdType
2039         {
2040             get{return "IDREF";}
2041         }
2042 
GetXsdType()2043         public String GetXsdType()
2044         {
2045             return XsdType;
2046         }
2047 
SoapIdref()2048         public SoapIdref()
2049         {
2050         }
2051 
SoapIdref(String value)2052         public SoapIdref (String value)
2053         {
2054             _value = value;
2055         }
2056 
2057         public String Value
2058         {
2059             get {return _value;}
2060             set {_value = value;}
2061         }
2062 
ToString()2063         public override String ToString()
2064         {
2065             return SoapType.Escape(_value);
2066         }
2067 
Parse(String value)2068         public static SoapIdref Parse(String value)
2069         {
2070             return new SoapIdref(value);
2071         }
2072     }
2073 
2074     [Serializable]
2075 [System.Runtime.InteropServices.ComVisible(true)]
2076     public sealed class SoapEntity : ISoapXsd
2077     {
2078         String _value;
2079 
2080         public static String XsdType
2081         {
2082             get{return "ENTITY";}
2083         }
2084 
GetXsdType()2085         public String GetXsdType()
2086         {
2087             return XsdType;
2088         }
2089 
SoapEntity()2090         public SoapEntity()
2091         {
2092         }
2093 
SoapEntity(String value)2094         public SoapEntity (String value)
2095         {
2096             _value = value;
2097         }
2098 
2099         public String Value
2100         {
2101             get {return _value;}
2102             set {_value = value;}
2103         }
2104 
ToString()2105         public override String ToString()
2106         {
2107             return SoapType.Escape(_value);
2108         }
2109 
Parse(String value)2110         public static SoapEntity Parse(String value)
2111         {
2112             return new SoapEntity(value);
2113         }
2114     }
2115         }
2116 
2117     // namespace System.Runtime.Remoting.Metadata
2118 
2119 
2120 
2121 
2122 
2123