Moved TestConfiguration.cs to Npgsql.
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / BasicProfileChecker.cs
1 // 
2 // System.Web.Services.Description.BasicProfileChecker.cs
3 //
4 // Author:
5 //   Lluis Sanchez (lluis@novell.com)
6 //
7 // Copyright (C) Novell, Inc., 2004
8 //
9
10 //
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.
29 //
30
31 #if NET_2_0
32
33 using System.Xml.Schema;
34 using System.Xml;
35 using System.Collections;
36
37 namespace System.Web.Services.Description 
38 {
39         internal class BasicProfileChecker: ConformanceChecker
40         {
41                 public static BasicProfileChecker Instance = new BasicProfileChecker ();
42                 
43                 public override WsiClaims Claims { 
44                         get { return WsiClaims.BP10; }
45                 }
46                 
47                 public override void Check (ConformanceCheckContext ctx, Import value) 
48                 {
49                         if (value.Location == "" || value.Location == null) {
50                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2007);
51                                 return;
52                         }
53                         
54                         object doc = ctx.GetDocument (value.Location);
55                         if (doc == null) ctx.ReportError (value, "Document '" + value.Location + "' not found");
56                         
57                         if (doc is XmlSchema)
58                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2002);
59                                 
60                         ServiceDescription imported = doc as ServiceDescription;
61                         if (imported == null) {
62                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2001);
63                                 return;
64                         }
65                                 
66                         // TODO: rule R2003
67                         
68                         if (imported.TargetNamespace != value.Namespace)
69                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2005);
70                 }
71                 
72                 public override void Check (ConformanceCheckContext ctx, ServiceDescription value)
73                 {
74                         
75                 }
76                 
77                 public override void Check (ConformanceCheckContext ctx, ServiceDescriptionFormatExtension value)
78                 {
79                         if (value.Required)
80                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2026);
81                 }
82                 
83                 public override void Check (ConformanceCheckContext ctx, MessagePart value)
84                 {
85                         CheckWsdlQName (ctx, value, value.Type);
86                         CheckWsdlQName (ctx, value, value.Element);
87                         
88                         if (value.DefinedByElement && value.Element.Namespace == XmlSchema.Namespace)
89                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2206);
90                 }
91                 
92                 public override void Check (ConformanceCheckContext ctx, Types value)
93                 {
94                 }
95                 
96                 public override void Check (ConformanceCheckContext ctx, Message value)
97                 {
98                         // TODO: R2113
99                 }
100                 
101                 public override void Check (ConformanceCheckContext ctx, Binding value)
102                 {
103                         SoapBinding sb = (SoapBinding) value.Extensions.Find (typeof(SoapBinding));
104                         if (sb == null || sb.Transport == null || sb.Transport == "") {
105                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2701);
106                                 return;
107                         }
108                         
109                         if (sb.Transport != "http://schemas.xmlsoap.org/soap/http")
110                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2702);
111                         
112                         LiteralType type = GetLiteralBindingType (value);
113                         if (type == LiteralType.NotLiteral)
114                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2706);
115                         else if (type == LiteralType.Inconsistent)
116                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2705);
117                         
118                         // Collect all parts referenced from this type
119                         
120                         Hashtable parts = new Hashtable ();
121                         PortType port = ctx.Services.GetPortType (value.Type);
122                         foreach (Operation op in port.Operations) {
123                                 foreach (OperationMessage om in op.Messages) {
124                                         Message msg = ctx.Services.GetMessage (om.Message);
125                                         foreach (MessagePart part in msg.Parts)
126                                                 parts.Add (part,part);
127                                 }
128                         }
129                         
130                         foreach (OperationBinding ob in value.Operations) {
131                                 if (ob.Input != null) CheckMessageBinding (ctx, parts, ob.Input);
132                                 if (ob.Output != null) CheckMessageBinding (ctx, parts, ob.Output);
133                                 foreach (FaultBinding fb in ob.Faults)
134                                         CheckMessageBinding (ctx, parts, fb);
135                         }
136                         
137                         if (parts.Count > 0)
138                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2209);
139                 }
140                 
141                 public override void Check (ConformanceCheckContext ctx, OperationBinding ob) 
142                 {
143                 }
144                 
145                 void CheckMessageBinding (ConformanceCheckContext ctx, Hashtable portParts, MessageBinding value)
146                 {
147                         SoapBodyBinding sbb = (SoapBodyBinding) value.Extensions.Find (typeof(SoapBodyBinding));
148                         Message msg = FindMessage (ctx, value);
149                         LiteralType bt = GetLiteralBindingType (value.OperationBinding.Binding);
150                         
151                         if (sbb != null) 
152                         {
153                                 if (bt == LiteralType.Document)
154                                 {
155                                         if (sbb.Parts != null && sbb.Parts.Length > 1)
156                                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2201);
157
158                                         if (sbb.Parts == null) {
159                                                 if (msg.Parts != null && msg.Parts.Count > 1)
160                                                         ctx.ReportRuleViolation (value, BasicProfileRules.R2210);
161                                                 if (msg.Parts.Count == 1)
162                                                         portParts.Remove (msg.Parts[0]);
163                                         }
164                                         else {
165                                                 if (sbb.Parts.Length == 0 && msg.Parts.Count == 1) {
166                                                         portParts.Remove (msg.Parts[0]);
167                                                 } else {
168                                                         foreach (string part in sbb.Parts) {
169                                                                 MessagePart mp = msg.FindPartByName (part);
170                                                                 portParts.Remove (mp);
171                                                                 if (!mp.DefinedByElement)
172                                                                         ctx.ReportRuleViolation (value, BasicProfileRules.R2204);
173                                                         }
174                                                 }
175                                         }
176                                 }
177                                 else if (bt == LiteralType.Rpc) 
178                                 {
179                                         if (sbb.Parts != null) {
180                                                 foreach (string part in sbb.Parts) {
181                                                         MessagePart mp = msg.FindPartByName (part);
182                                                         portParts.Remove (mp);
183                                                         if (!mp.DefinedByType)
184                                                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2203);
185                                                 }
186                                         }
187                                 }
188                         }
189                         
190                         SoapHeaderBinding shb = (SoapHeaderBinding) value.Extensions.Find (typeof(SoapHeaderBinding));
191                         if (shb != null) {
192                                 Message hm = ctx.Services.GetMessage (shb.Message);
193                                 MessagePart mp = hm.FindPartByName (shb.Part);
194                                 portParts.Remove (mp);
195                                 if (mp != null && !mp.DefinedByElement)
196                                         ctx.ReportRuleViolation (value, BasicProfileRules.R2205);
197                         }
198                         
199                         SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) value.Extensions.Find (typeof(SoapHeaderFaultBinding));
200                         if (shfb != null) {
201                                 Message hm = ctx.Services.GetMessage (shfb.Message);
202                                 MessagePart mp = hm.FindPartByName (shfb.Part);
203                                 portParts.Remove (mp);
204                                 if (mp != null && !mp.DefinedByElement)
205                                         ctx.ReportRuleViolation (value, BasicProfileRules.R2205);
206                         }
207                         
208                         // TODO: SoapFaultBinding ??
209                 }
210                 
211                 Message FindMessage (ConformanceCheckContext ctx, MessageBinding mb)
212                 {
213                         PortType pt = ctx.Services.GetPortType (mb.OperationBinding.Binding.Type);
214                         foreach (Operation op in pt.Operations)
215                                 if (op.IsBoundBy (mb.OperationBinding)) {
216                                         OperationMessage om;
217                                         if (mb is InputBinding) om = op.Messages.Input;
218                                         else if (mb is OutputBinding) om = op.Messages.Output;
219                                         else if (mb is FaultBinding) om = op.Faults [mb.Name];
220                                         else return null;
221                                         if (om != null)
222                                                 return ctx.Services.GetMessage (om.Message);
223                                         else
224                                                 return null;
225                                 }
226                         return null;
227                 }
228                 
229                 public override void Check (ConformanceCheckContext ctx, Operation value) { }
230                 public override void Check (ConformanceCheckContext ctx, OperationMessage value) { }
231                 public override void Check (ConformanceCheckContext ctx, Port value) { }
232                 public override void Check (ConformanceCheckContext ctx, PortType value) { }
233                 public override void Check (ConformanceCheckContext ctx, Service value) { }
234                 
235                 public override void Check (ConformanceCheckContext ctx, XmlSchema s)
236                 {
237                         if (s.TargetNamespace == null || s.TargetNamespace == "") {
238                                 foreach (XmlSchemaObject ob in s.Items)
239                                         if (!(ob is XmlSchemaImport) && !(ob is XmlSchemaAnnotation)) {
240                                                 ctx.ReportRuleViolation (s, BasicProfileRules.R2105);
241                                                 break;
242                                         }
243                         }
244                 }
245                 
246                 public override void Check (ConformanceCheckContext ctx, XmlSchemaImport value)
247                 {
248                         XmlSchema doc = ctx.GetDocument (value.SchemaLocation) as XmlSchema;
249                         if (doc == null) ctx.ReportError (value, "Schema '" + value.SchemaLocation + "' not found");
250                 }
251                 
252                 public override void Check (ConformanceCheckContext ctx, XmlSchemaAttribute value)
253                 {
254                         CheckSchemaQName (ctx, value, value.RefName);
255                         CheckSchemaQName (ctx, value, value.SchemaTypeName);
256                         
257                         XmlAttribute[] uatts = value.UnhandledAttributes;
258                         if (uatts != null) {
259                                 foreach (XmlAttribute at in uatts)
260                                         if (at.LocalName == "arrayType" && at.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")
261                                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2111);
262                         }
263                 }
264                 
265                 public override void Check (ConformanceCheckContext ctx, XmlSchemaAttributeGroupRef value)
266                 {
267                         CheckSchemaQName (ctx, value, value.RefName);
268                 }
269                 
270                 public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentExtension value)
271                 {
272                         CheckSchemaQName (ctx, value, value.BaseTypeName);
273                         if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
274                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
275                 }
276                 
277                 public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentRestriction value)
278                 {
279                         CheckSchemaQName (ctx, value, value.BaseTypeName);
280                         if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
281                                 ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
282                 }
283                 
284                 public override void Check (ConformanceCheckContext ctx, XmlSchemaElement value)
285                 {
286                         CheckSchemaQName (ctx, value, value.RefName);
287                         CheckSchemaQName (ctx, value, value.SubstitutionGroup);
288                         CheckSchemaQName (ctx, value, value.SchemaTypeName);
289                 }
290                 
291                 public override void Check (ConformanceCheckContext ctx, XmlSchemaGroupRef value)
292                 {
293                         CheckSchemaQName (ctx, value, value.RefName);
294                 }
295                 
296                 public override void Check (ConformanceCheckContext ctx, XmlSchemaKeyref value)
297                 {
298                         CheckSchemaQName (ctx, value, value.Refer);
299                 }
300                 
301                 public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleContentExtension value)
302                 {
303                         CheckSchemaQName (ctx, value, value.BaseTypeName);
304                 }
305                 
306                 public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleContentRestriction value)
307                 {
308                         CheckSchemaQName (ctx, value, value.BaseTypeName);
309                 }
310                 
311                 public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeList value)
312                 {
313                         CheckSchemaQName (ctx, value, value.ItemTypeName);
314                 }
315                 
316                 public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeRestriction value)
317                 {
318                         CheckSchemaQName (ctx, value, value.BaseTypeName);
319                 }
320                 
321                 public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeUnion value)
322                 {
323                         if (value.MemberTypes != null) {
324                                 foreach (XmlQualifiedName name in value.MemberTypes)
325                                         CheckSchemaQName (ctx, value, name);
326                         }
327                 }
328                 
329                 // Helper methods
330                 
331                 void CheckWsdlQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
332                 {
333                         if (name == null || name == XmlQualifiedName.Empty) return;
334                         if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
335                         
336                         if (ctx.ServiceDescription.Types != null && ctx.ServiceDescription.Types.Schemas != null) 
337                         {
338                                 foreach (XmlSchema s in ctx.ServiceDescription.Types.Schemas)
339                                 {
340                                         if (s.TargetNamespace == name.Namespace) return;
341                                         foreach (XmlSchemaObject i in s.Includes)
342                                                 if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
343                                 }
344                         }
345                         ctx.ReportRuleViolation (element, BasicProfileRules.R2101);
346                 }
347                 
348                 void CheckSchemaQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
349                 {
350                         if (name == null || name == XmlQualifiedName.Empty) return;
351                         if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
352                         if (ctx.CurrentSchema.TargetNamespace == name.Namespace) return;
353                         
354                         foreach (XmlSchemaObject i in ctx.CurrentSchema.Includes)
355                                 if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
356                                 
357                         ctx.ReportRuleViolation (element, BasicProfileRules.R2102);
358                 }
359                 
360                 LiteralType GetLiteralBindingType (Binding b)
361                 {
362                         SoapBinding sb = (SoapBinding) b.Extensions.Find (typeof(SoapBinding));
363                         SoapBindingStyle style = (sb != null) ? sb.Style : SoapBindingStyle.Document;
364                         if (style == SoapBindingStyle.Default) style = SoapBindingStyle.Document;
365                         
366                         foreach (OperationBinding ob in b.Operations) {
367                                 SoapOperationBinding sob = (SoapOperationBinding) ob.Extensions.Find (typeof(SoapOperationBinding));
368                                 if (sob.Style != SoapBindingStyle.Default && sob.Style != style)
369                                         return LiteralType.Inconsistent;
370                                 if (ob.Input != null) {
371                                         SoapBodyBinding sbb = (SoapBodyBinding) ob.Input.Extensions.Find (typeof(SoapBodyBinding));
372                                         if (sbb != null && sbb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
373                                         SoapFaultBinding sfb = (SoapFaultBinding) ob.Input.Extensions.Find (typeof(SoapFaultBinding));
374                                         if (sfb != null && sfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
375                                         SoapHeaderBinding shb = (SoapHeaderBinding) ob.Input.Extensions.Find (typeof(SoapHeaderBinding));
376                                         if (shb != null && shb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
377                                         SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) ob.Input.Extensions.Find (typeof(SoapHeaderFaultBinding));
378                                         if (shfb != null && shfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
379                                 }
380                                 if (ob.Output != null) {
381                                         SoapBodyBinding sbb = (SoapBodyBinding) ob.Output.Extensions.Find (typeof(SoapBodyBinding));
382                                         if (sbb != null && sbb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
383                                         SoapFaultBinding sfb = (SoapFaultBinding) ob.Input.Extensions.Find (typeof(SoapFaultBinding));
384                                         if (sfb != null && sfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
385                                         SoapHeaderBinding shb = (SoapHeaderBinding) ob.Input.Extensions.Find (typeof(SoapHeaderBinding));
386                                         if (shb != null && shb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
387                                         SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) ob.Input.Extensions.Find (typeof(SoapHeaderFaultBinding));
388                                         if (shfb != null && shfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
389                                 }
390                         }
391                         if (style == SoapBindingStyle.Document) return LiteralType.Document;
392                         else return LiteralType.Rpc;
393                 }
394                 
395                 enum LiteralType {
396                         NotLiteral,
397                         Inconsistent,
398                         Rpc,
399                         Document
400                 }
401         }
402         
403         internal class BasicProfileRules
404         {
405         
406         // 3.2 Conformance of Services, Consumers and Registries
407         
408                 // Can't check: R0001
409                 
410         // 3.3 Conformance Annotation in Descriptions
411         
412                 // Can't check: R0002, R0003
413         
414         // 3.4 Conformance Annotation in Messages
415         
416                 // Can't check: R0004, R0005, R0006, R0007
417                 
418         // 3.5 Conformance Annotation in Registry Data
419         
420                 // UDDI related: R3020, R3030, R3021, R3005, R3004.
421                 
422         // 4.1 XML Representation of SOAP Messages
423                 
424                 // Rules not related to service description
425                 
426         // 4.2 SOAP Processing Model
427         
428                 // Rules not related to service description
429                 
430         // 4.3 Use of SOAP in HTTP
431         
432                 // Rules not related to service description
433                 
434         // 5.1 Document structure
435         
436                 public static readonly ConformanceRule R2001 = new ConformanceRule (
437                         "R2001", 
438                         "A DESCRIPTION MUST only use the WSDL \"import\" statement to import another WSDL description",
439                         "");
440                         
441                 public static readonly ConformanceRule R2002 = new ConformanceRule (
442                         "R2002", 
443                         "To import XML Schema Definitions, a DESCRIPTION MUST use the XML Schema \"import\" statement",
444                         "");
445                         
446                 public static readonly ConformanceRule R2007 = new ConformanceRule (
447                         "R2007", 
448                         "A DESCRIPTION MUST specify a non-empty location attribute on the wsdl:import element",
449                         "");
450                         
451                 public static readonly ConformanceRule R2005 = new ConformanceRule (
452                         "R2005", 
453                         "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",
454                         "");
455
456                 public static readonly ConformanceRule R2026 = new ConformanceRule (
457                         "R2026", 
458                         "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",
459                         "");
460                         
461         // 5.2 Types
462         
463                 public static readonly ConformanceRule R2101 = new ConformanceRule (
464                         "R2101", 
465                         "A DESCRIPTION MUST NOT use QName references to elements in namespaces that have been neither imported, nor defined in the referring WSDL document",
466                         "");
467                         
468                 public static readonly ConformanceRule R2102 = new ConformanceRule (
469                         "R2102", 
470                         "A QName reference to a Schema component in a DESCRIPTION MUST use the namespace defined in the targetNamespace attribute on the xsd:schema element, or to a namespace defined in the namespace attribute on an xsd:import element within the xsd:schema element",
471                         "");
472                         
473                 public static readonly ConformanceRule R2105 = new ConformanceRule (
474                         "R2105", 
475                         "All xsd:schema elements contained in a wsdl:types element of a DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as its only child element(s)",
476                         "");
477                         
478                 public static readonly ConformanceRule R2110 = new ConformanceRule (
479                         "R2110", 
480                         "In a DESCRIPTION, array declarations MUST NOT extend or restrict the soapenc:Array type",
481                         "");
482                         
483                 public static readonly ConformanceRule R2111 = new ConformanceRule (
484                         "R2111", 
485                         "In a DESCRIPTION, array declarations MUST NOT use wsdl:arrayType attribute in the type declaration",
486                         "");
487                         
488                 // R2112: Suggestion.
489                 // R2113: Not related to servide description
490                 // R2114: Suggestion.
491                 
492         // 5.3 Messages
493         
494                 public static readonly ConformanceRule R2201 = new ConformanceRule (
495                         "R2201", 
496                         "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",
497                         "");
498                 
499                 public static readonly ConformanceRule R2210 = new ConformanceRule (
500                         "R2210", 
501                         "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",
502                         "");
503                 
504                 public static readonly ConformanceRule R2203 = new ConformanceRule (
505                         "R2203", 
506                         "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",
507                         "");
508                 
509                 public static readonly ConformanceRule R2204 = new ConformanceRule (
510                         "R2204", 
511                         "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",
512                         "");
513                 
514                 public static readonly ConformanceRule R2205 = new ConformanceRule (
515                         "R2205", 
516                         "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",
517                         "");
518                 
519                 public static readonly ConformanceRule R2209 = new ConformanceRule (
520                         "R2209", 
521                         "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",
522                         "");
523                 
524                 public static readonly ConformanceRule R2206 = new ConformanceRule (
525                         "R2206", 
526                         "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",
527                         "");
528                 
529                 // R2211: Related to message structure
530                 // R2202: Suggestion.
531                 // R2207: Optional
532                 // R2208: Optional
533                 
534         // 5.4 Port Types
535         
536                 // TODO
537         
538         // 5.5 Bindings
539         
540                 // TODO
541                         
542         // 5.6 SOAP Binding
543                 
544                 public static readonly ConformanceRule R2701 = new ConformanceRule (
545                         "R2701", 
546                         "The wsdl:binding element in a DESCRIPTION MUST be constructed so that its soapbind:binding child element specifies the transport attribute",
547                         "");
548                         
549                 public static readonly ConformanceRule R2702 = new ConformanceRule (
550                         "R2702", 
551                         "A wsdl:binding element in a DESCRIPTION MUST specify the HTTP transport protocol with SOAP binding. Specifically, the transport attribute of its soapbind:binding child MUST have the value \"http://schemas.xmlsoap.org/soap/http\"",
552                         "");
553                         
554                 public static readonly ConformanceRule R2705 = new ConformanceRule (
555                         "R2705", 
556                         "A wsdl:binding in a DESCRIPTION MUST use either be a rpc-literal binding or a document-literal binding",
557                         "");
558                         
559                 public static readonly ConformanceRule R2706 = new ConformanceRule (
560                         "R2706", 
561                         "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",
562                         "");
563                         
564                 // 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
565                 // R2709: Suggestion.
566                 
567                 // TODO
568         }
569         
570         /* 
571                 The following rules cannot be checked:
572                 R2002, R2003, R4004, R4003, R2022, R2023, R2004, R2010, R2011
573                         There is no access to the unerlying xml 
574                         
575                 The following are suggestions:
576                 R2008, R2112
577                 
578                 The following are optional
579                 R4002, R2020, R2021, R2024, R2114
580                 
581                 Can't be checked:
582                 R2025
583                 
584                 Process related
585                 R2027
586                 
587                 TODO: section 5.3
588         */
589 }
590
591 #endif