BasicProfileChecker.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. //
  2. // System.Web.Services.Description.BasicProfileChecker.cs
  3. //
  4. // Author:
  5. // Lluis Sanchez ([email protected])
  6. //
  7. // Copyright (C) Novell, Inc., 2004
  8. //
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. //
  29. #if NET_2_0
  30. using System.Xml.Schema;
  31. using System.Xml;
  32. using System.Collections;
  33. namespace System.Web.Services.Description
  34. {
  35. internal class BasicProfileChecker: ConformanceChecker
  36. {
  37. public static BasicProfileChecker Instance = new BasicProfileChecker ();
  38. public override WsiClaims Claims {
  39. get { return WsiClaims.BP10; }
  40. }
  41. public override void Check (ConformanceCheckContext ctx, Import value)
  42. {
  43. if (value.Location == "" || value.Location == null) {
  44. ctx.ReportRuleViolation (value, BasicProfileRules.R2007);
  45. return;
  46. }
  47. object doc = ctx.GetDocument (value.Location);
  48. if (doc == null) ctx.ReportError (value, "Document '" + value.Location + "' not found");
  49. if (doc is XmlSchema)
  50. ctx.ReportRuleViolation (value, BasicProfileRules.R2002);
  51. ServiceDescription imported = doc as ServiceDescription;
  52. if (imported == null) {
  53. ctx.ReportRuleViolation (value, BasicProfileRules.R2001);
  54. return;
  55. }
  56. // TODO: rule R2003
  57. if (imported.TargetNamespace != value.Namespace)
  58. ctx.ReportRuleViolation (value, BasicProfileRules.R2005);
  59. }
  60. public override void Check (ConformanceCheckContext ctx, ServiceDescription value)
  61. {
  62. }
  63. public override void Check (ConformanceCheckContext ctx, ServiceDescriptionFormatExtension value)
  64. {
  65. if (value.Required)
  66. ctx.ReportRuleViolation (value, BasicProfileRules.R2026);
  67. }
  68. public override void Check (ConformanceCheckContext ctx, MessagePart value)
  69. {
  70. CheckWsdlQName (ctx, value, value.Type);
  71. CheckWsdlQName (ctx, value, value.Element);
  72. if (value.DefinedByElement && value.Element.Namespace == XmlSchema.Namespace)
  73. ctx.ReportRuleViolation (value, BasicProfileRules.R2206);
  74. }
  75. public override void Check (ConformanceCheckContext ctx, Types value)
  76. {
  77. }
  78. public override void Check (ConformanceCheckContext ctx, Message value)
  79. {
  80. // TODO: R2113
  81. }
  82. public override void Check (ConformanceCheckContext ctx, Binding value)
  83. {
  84. SoapBinding sb = (SoapBinding) value.Extensions.Find (typeof(SoapBinding));
  85. if (sb == null || sb.Transport == null || sb.Transport == "") {
  86. ctx.ReportRuleViolation (value, BasicProfileRules.R2701);
  87. return;
  88. }
  89. if (sb.Transport != "http://schemas.xmlsoap.org/soap/http")
  90. ctx.ReportRuleViolation (value, BasicProfileRules.R2702);
  91. LiteralType type = GetLiteralBindingType (value);
  92. if (type == LiteralType.NotLiteral)
  93. ctx.ReportRuleViolation (value, BasicProfileRules.R2706);
  94. else if (type == LiteralType.Inconsistent)
  95. ctx.ReportRuleViolation (value, BasicProfileRules.R2705);
  96. // Collect all parts referenced from this type
  97. Hashtable parts = new Hashtable ();
  98. PortType port = ctx.Services.GetPortType (value.Type);
  99. foreach (Operation op in port.Operations) {
  100. foreach (OperationMessage om in op.Messages) {
  101. Message msg = ctx.Services.GetMessage (om.Message);
  102. foreach (MessagePart part in msg.Parts)
  103. parts.Add (part,part);
  104. }
  105. }
  106. foreach (OperationBinding ob in value.Operations) {
  107. if (ob.Input != null) CheckMessageBinding (ctx, parts, ob.Input);
  108. if (ob.Output != null) CheckMessageBinding (ctx, parts, ob.Output);
  109. foreach (FaultBinding fb in ob.Faults)
  110. CheckMessageBinding (ctx, parts, fb);
  111. }
  112. if (parts.Count > 0)
  113. ctx.ReportRuleViolation (value, BasicProfileRules.R2209);
  114. }
  115. public override void Check (ConformanceCheckContext ctx, OperationBinding ob)
  116. {
  117. }
  118. void CheckMessageBinding (ConformanceCheckContext ctx, Hashtable portParts, MessageBinding value)
  119. {
  120. SoapBodyBinding sbb = (SoapBodyBinding) value.Extensions.Find (typeof(SoapBodyBinding));
  121. Message msg = FindMessage (ctx, value);
  122. LiteralType bt = GetLiteralBindingType (value.OperationBinding.Binding);
  123. if (sbb != null)
  124. {
  125. if (bt == LiteralType.Document)
  126. {
  127. if (sbb.Parts != null && sbb.Parts.Length > 1)
  128. ctx.ReportRuleViolation (value, BasicProfileRules.R2201);
  129. if (sbb.Parts == null) {
  130. if (msg.Parts != null && msg.Parts.Count > 1)
  131. ctx.ReportRuleViolation (value, BasicProfileRules.R2210);
  132. }
  133. else {
  134. foreach (string part in sbb.Parts) {
  135. MessagePart mp = msg.FindPartByName (part);
  136. portParts.Remove (mp);
  137. if (!mp.DefinedByElement)
  138. ctx.ReportRuleViolation (value, BasicProfileRules.R2204);
  139. }
  140. }
  141. }
  142. else if (bt == LiteralType.Rpc)
  143. {
  144. if (sbb.Parts != null) {
  145. foreach (string part in sbb.Parts) {
  146. MessagePart mp = msg.FindPartByName (part);
  147. portParts.Remove (mp);
  148. if (!mp.DefinedByType)
  149. ctx.ReportRuleViolation (value, BasicProfileRules.R2203);
  150. }
  151. }
  152. }
  153. }
  154. SoapHeaderBinding shb = (SoapHeaderBinding) value.Extensions.Find (typeof(SoapHeaderBinding));
  155. if (shb != null) {
  156. Message hm = ctx.Services.GetMessage (shb.Message);
  157. MessagePart mp = hm.FindPartByName (shb.Part);
  158. portParts.Remove (mp);
  159. if (mp != null && !mp.DefinedByElement)
  160. ctx.ReportRuleViolation (value, BasicProfileRules.R2205);
  161. }
  162. SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) value.Extensions.Find (typeof(SoapHeaderFaultBinding));
  163. if (shfb != null) {
  164. Message hm = ctx.Services.GetMessage (shfb.Message);
  165. MessagePart mp = hm.FindPartByName (shfb.Part);
  166. portParts.Remove (mp);
  167. if (mp != null && !mp.DefinedByElement)
  168. ctx.ReportRuleViolation (value, BasicProfileRules.R2205);
  169. }
  170. // TODO: SoapFaultBinding ??
  171. }
  172. Message FindMessage (ConformanceCheckContext ctx, MessageBinding mb)
  173. {
  174. PortType pt = ctx.Services.GetPortType (mb.OperationBinding.Binding.Type);
  175. foreach (Operation op in pt.Operations)
  176. if (op.IsBoundBy (mb.OperationBinding)) {
  177. OperationMessage om;
  178. if (mb is InputBinding) om = op.Messages.Input;
  179. else if (mb is OutputBinding) om = op.Messages.Output;
  180. else if (mb is FaultBinding) om = op.Messages.Fault;
  181. else return null;
  182. return ctx.Services.GetMessage (om.Message);
  183. }
  184. return null;
  185. }
  186. public override void Check (ConformanceCheckContext ctx, Operation value) { }
  187. public override void Check (ConformanceCheckContext ctx, OperationMessage value) { }
  188. public override void Check (ConformanceCheckContext ctx, Port value) { }
  189. public override void Check (ConformanceCheckContext ctx, PortType value) { }
  190. public override void Check (ConformanceCheckContext ctx, Service value) { }
  191. public override void Check (ConformanceCheckContext ctx, XmlSchema s)
  192. {
  193. if (s.TargetNamespace == null || s.TargetNamespace == "") {
  194. foreach (XmlSchemaObject ob in s.Items)
  195. if (!(ob is XmlSchemaImport) && !(ob is XmlSchemaAnnotation)) {
  196. ctx.ReportRuleViolation (s, BasicProfileRules.R2105);
  197. break;
  198. }
  199. }
  200. }
  201. public override void Check (ConformanceCheckContext ctx, XmlSchemaImport value)
  202. {
  203. XmlSchema doc = ctx.GetDocument (value.SchemaLocation) as XmlSchema;
  204. if (doc == null) ctx.ReportError (value, "Schema '" + value.SchemaLocation + "' not found");
  205. }
  206. public override void Check (ConformanceCheckContext ctx, XmlSchemaAttribute value)
  207. {
  208. CheckSchemaQName (ctx, value, value.RefName);
  209. CheckSchemaQName (ctx, value, value.SchemaTypeName);
  210. XmlAttribute[] uatts = value.UnhandledAttributes;
  211. if (uatts != null) {
  212. foreach (XmlAttribute at in uatts)
  213. if (at.LocalName == "arrayType" && at.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")
  214. ctx.ReportRuleViolation (value, BasicProfileRules.R2111);
  215. }
  216. }
  217. public override void Check (ConformanceCheckContext ctx, XmlSchemaAttributeGroupRef value)
  218. {
  219. CheckSchemaQName (ctx, value, value.RefName);
  220. }
  221. public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentExtension value)
  222. {
  223. CheckSchemaQName (ctx, value, value.BaseTypeName);
  224. if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
  225. ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
  226. }
  227. public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentRestriction value)
  228. {
  229. CheckSchemaQName (ctx, value, value.BaseTypeName);
  230. if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
  231. ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
  232. }
  233. public override void Check (ConformanceCheckContext ctx, XmlSchemaElement value)
  234. {
  235. CheckSchemaQName (ctx, value, value.RefName);
  236. CheckSchemaQName (ctx, value, value.SubstitutionGroup);
  237. CheckSchemaQName (ctx, value, value.SchemaTypeName);
  238. }
  239. public override void Check (ConformanceCheckContext ctx, XmlSchemaGroupRef value)
  240. {
  241. CheckSchemaQName (ctx, value, value.RefName);
  242. }
  243. public override void Check (ConformanceCheckContext ctx, XmlSchemaKeyref value)
  244. {
  245. CheckSchemaQName (ctx, value, value.Refer);
  246. }
  247. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleContentExtension value)
  248. {
  249. CheckSchemaQName (ctx, value, value.BaseTypeName);
  250. }
  251. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleContentRestriction value)
  252. {
  253. CheckSchemaQName (ctx, value, value.BaseTypeName);
  254. }
  255. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeList value)
  256. {
  257. CheckSchemaQName (ctx, value, value.ItemTypeName);
  258. }
  259. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeRestriction value)
  260. {
  261. CheckSchemaQName (ctx, value, value.BaseTypeName);
  262. }
  263. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeUnion value)
  264. {
  265. foreach (XmlQualifiedName name in value.MemberTypes)
  266. CheckSchemaQName (ctx, value, name);
  267. }
  268. // Helper methods
  269. void CheckWsdlQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
  270. {
  271. if (name == null || name == XmlQualifiedName.Empty) return;
  272. if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
  273. if (ctx.ServiceDescription.Types != null && ctx.ServiceDescription.Types.Schemas != null)
  274. {
  275. foreach (XmlSchema s in ctx.ServiceDescription.Types.Schemas)
  276. {
  277. if (s.TargetNamespace == name.Namespace) return;
  278. foreach (XmlSchemaObject i in s.Includes)
  279. if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
  280. }
  281. }
  282. ctx.ReportRuleViolation (element, BasicProfileRules.R2101);
  283. }
  284. void CheckSchemaQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
  285. {
  286. if (name == null || name == XmlQualifiedName.Empty) return;
  287. if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
  288. if (ctx.CurrentSchema.TargetNamespace == name.Namespace) return;
  289. foreach (XmlSchemaObject i in ctx.CurrentSchema.Includes)
  290. if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
  291. ctx.ReportRuleViolation (element, BasicProfileRules.R2102);
  292. }
  293. LiteralType GetLiteralBindingType (Binding b)
  294. {
  295. SoapBinding sb = (SoapBinding) b.Extensions.Find (typeof(SoapBinding));
  296. SoapBindingStyle style = (sb != null) ? sb.Style : SoapBindingStyle.Document;
  297. if (style == SoapBindingStyle.Default) style = SoapBindingStyle.Document;
  298. foreach (OperationBinding ob in b.Operations) {
  299. SoapOperationBinding sob = (SoapOperationBinding) ob.Extensions.Find (typeof(SoapOperationBinding));
  300. if (sob.Style != SoapBindingStyle.Default && sob.Style != style)
  301. return LiteralType.Inconsistent;
  302. if (ob.Input != null) {
  303. SoapBodyBinding sbb = (SoapBodyBinding) ob.Input.Extensions.Find (typeof(SoapBodyBinding));
  304. if (sbb != null && sbb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  305. SoapFaultBinding sfb = (SoapFaultBinding) ob.Input.Extensions.Find (typeof(SoapFaultBinding));
  306. if (sfb != null && sfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  307. SoapHeaderBinding shb = (SoapHeaderBinding) ob.Input.Extensions.Find (typeof(SoapHeaderBinding));
  308. if (shb != null && shb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  309. SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) ob.Input.Extensions.Find (typeof(SoapHeaderFaultBinding));
  310. if (shfb != null && shfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  311. }
  312. if (ob.Output != null) {
  313. SoapBodyBinding sbb = (SoapBodyBinding) ob.Output.Extensions.Find (typeof(SoapBodyBinding));
  314. if (sbb != null && sbb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  315. SoapFaultBinding sfb = (SoapFaultBinding) ob.Input.Extensions.Find (typeof(SoapFaultBinding));
  316. if (sfb != null && sfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  317. SoapHeaderBinding shb = (SoapHeaderBinding) ob.Input.Extensions.Find (typeof(SoapHeaderBinding));
  318. if (shb != null && shb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  319. SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) ob.Input.Extensions.Find (typeof(SoapHeaderFaultBinding));
  320. if (shfb != null && shfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  321. }
  322. }
  323. if (style == SoapBindingStyle.Document) return LiteralType.Document;
  324. else return LiteralType.Rpc;
  325. }
  326. enum LiteralType {
  327. NotLiteral,
  328. Inconsistent,
  329. Rpc,
  330. Document
  331. }
  332. }
  333. internal class BasicProfileRules
  334. {
  335. // 3.2 Conformance of Services, Consumers and Registries
  336. // Can't check: R0001
  337. // 3.3 Conformance Annotation in Descriptions
  338. // Can't check: R0002, R0003
  339. // 3.4 Conformance Annotation in Messages
  340. // Can't check: R0004, R0005, R0006, R0007
  341. // 3.5 Conformance Annotation in Registry Data
  342. // UDDI related: R3020, R3030, R3021, R3005, R3004.
  343. // 4.1 XML Representation of SOAP Messages
  344. // Rules not related to service description
  345. // 4.2 SOAP Processing Model
  346. // Rules not related to service description
  347. // 4.3 Use of SOAP in HTTP
  348. // Rules not related to service description
  349. // 5.1 Document structure
  350. public static readonly ConformanceRule R2001 = new ConformanceRule (
  351. "R2001",
  352. "A DESCRIPTION MUST only use the WSDL \"import\" statement to import another WSDL description",
  353. "");
  354. public static readonly ConformanceRule R2002 = new ConformanceRule (
  355. "R2002",
  356. "To import XML Schema Definitions, a DESCRIPTION MUST use the XML Schema \"import\" statement",
  357. "");
  358. public static readonly ConformanceRule R2007 = new ConformanceRule (
  359. "R2007",
  360. "A DESCRIPTION MUST specify a non-empty location attribute on the wsdl:import element",
  361. "");
  362. public static readonly ConformanceRule R2005 = new ConformanceRule (
  363. "R2005",
  364. "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",
  365. "");
  366. public static readonly ConformanceRule R2026 = new ConformanceRule (
  367. "R2026",
  368. "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",
  369. "");
  370. // 5.2 Types
  371. public static readonly ConformanceRule R2101 = new ConformanceRule (
  372. "R2101",
  373. "A DESCRIPTION MUST NOT use QName references to elements in namespaces that have been neither imported, nor defined in the referring WSDL document",
  374. "");
  375. public static readonly ConformanceRule R2102 = new ConformanceRule (
  376. "R2102",
  377. "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",
  378. "");
  379. public static readonly ConformanceRule R2105 = new ConformanceRule (
  380. "R2105",
  381. "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)",
  382. "");
  383. public static readonly ConformanceRule R2110 = new ConformanceRule (
  384. "R2110",
  385. "In a DESCRIPTION, array declarations MUST NOT extend or restrict the soapenc:Array type",
  386. "");
  387. public static readonly ConformanceRule R2111 = new ConformanceRule (
  388. "R2111",
  389. "In a DESCRIPTION, array declarations MUST NOT use wsdl:arrayType attribute in the type declaration",
  390. "");
  391. // R2112: Suggestion.
  392. // R2113: Not related to servide description
  393. // R2114: Suggestion.
  394. // 5.3 Messages
  395. public static readonly ConformanceRule R2201 = new ConformanceRule (
  396. "R2201",
  397. "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",
  398. "");
  399. public static readonly ConformanceRule R2210 = new ConformanceRule (
  400. "R2210",
  401. "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",
  402. "");
  403. public static readonly ConformanceRule R2203 = new ConformanceRule (
  404. "R2203",
  405. "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",
  406. "");
  407. public static readonly ConformanceRule R2204 = new ConformanceRule (
  408. "R2204",
  409. "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",
  410. "");
  411. public static readonly ConformanceRule R2205 = new ConformanceRule (
  412. "R2205",
  413. "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",
  414. "");
  415. public static readonly ConformanceRule R2209 = new ConformanceRule (
  416. "R2209",
  417. "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",
  418. "");
  419. public static readonly ConformanceRule R2206 = new ConformanceRule (
  420. "R2206",
  421. "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",
  422. "");
  423. // R2211: Related to message structure
  424. // R2202: Suggestion.
  425. // R2207: Optional
  426. // R2208: Optional
  427. // 5.4 Port Types
  428. // TODO
  429. // 5.5 Bindings
  430. // TODO
  431. // 5.6 SOAP Binding
  432. public static readonly ConformanceRule R2701 = new ConformanceRule (
  433. "R2701",
  434. "The wsdl:binding element in a DESCRIPTION MUST be constructed so that its soapbind:binding child element specifies the transport attribute",
  435. "");
  436. public static readonly ConformanceRule R2702 = new ConformanceRule (
  437. "R2702",
  438. "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\"",
  439. "");
  440. public static readonly ConformanceRule R2705 = new ConformanceRule (
  441. "R2705",
  442. "A wsdl:binding in a DESCRIPTION MUST use either be a rpc-literal binding or a document-literal binding",
  443. "");
  444. public static readonly ConformanceRule R2706 = new ConformanceRule (
  445. "R2706",
  446. "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",
  447. "");
  448. // 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
  449. // R2709: Suggestion.
  450. // TODO
  451. }
  452. /*
  453. The following rules cannot be checked:
  454. R2002, R2003, R4004, R4003, R2022, R2023, R2004, R2010, R2011
  455. There is no access to the unerlying xml
  456. The following are suggestions:
  457. R2008, R2112
  458. The following are optional
  459. R4002, R2020, R2021, R2024, R2114
  460. Can't be checked:
  461. R2025
  462. Process related
  463. R2027
  464. TODO: section 5.3
  465. */
  466. }
  467. #endif