BasicProfileChecker.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  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 WsiProfiles Claims {
  39. get { return WsiProfiles.BasicProfile1_1; }
  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. if (msg.Parts.Count == 1)
  133. portParts.Remove (msg.Parts[0]);
  134. }
  135. else {
  136. if (sbb.Parts.Length == 0 && msg.Parts.Count == 1) {
  137. portParts.Remove (msg.Parts[0]);
  138. } else {
  139. foreach (string part in sbb.Parts) {
  140. MessagePart mp = msg.FindPartByName (part);
  141. portParts.Remove (mp);
  142. if (!mp.DefinedByElement)
  143. ctx.ReportRuleViolation (value, BasicProfileRules.R2204);
  144. }
  145. }
  146. }
  147. }
  148. else if (bt == LiteralType.Rpc)
  149. {
  150. if (sbb.Parts != null) {
  151. foreach (string part in sbb.Parts) {
  152. MessagePart mp = msg.FindPartByName (part);
  153. portParts.Remove (mp);
  154. if (!mp.DefinedByType)
  155. ctx.ReportRuleViolation (value, BasicProfileRules.R2203);
  156. }
  157. }
  158. }
  159. }
  160. SoapHeaderBinding shb = (SoapHeaderBinding) value.Extensions.Find (typeof(SoapHeaderBinding));
  161. if (shb != null) {
  162. Message hm = ctx.Services.GetMessage (shb.Message);
  163. MessagePart mp = hm.FindPartByName (shb.Part);
  164. portParts.Remove (mp);
  165. if (mp != null && !mp.DefinedByElement)
  166. ctx.ReportRuleViolation (value, BasicProfileRules.R2205);
  167. }
  168. SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) value.Extensions.Find (typeof(SoapHeaderFaultBinding));
  169. if (shfb != null) {
  170. Message hm = ctx.Services.GetMessage (shfb.Message);
  171. MessagePart mp = hm.FindPartByName (shfb.Part);
  172. portParts.Remove (mp);
  173. if (mp != null && !mp.DefinedByElement)
  174. ctx.ReportRuleViolation (value, BasicProfileRules.R2205);
  175. }
  176. // TODO: SoapFaultBinding ??
  177. }
  178. Message FindMessage (ConformanceCheckContext ctx, MessageBinding mb)
  179. {
  180. PortType pt = ctx.Services.GetPortType (mb.OperationBinding.Binding.Type);
  181. foreach (Operation op in pt.Operations)
  182. if (op.IsBoundBy (mb.OperationBinding)) {
  183. OperationMessage om;
  184. if (mb is InputBinding) om = op.Messages.Input;
  185. else if (mb is OutputBinding) om = op.Messages.Output;
  186. else if (mb is FaultBinding) om = op.Faults [mb.Name];
  187. else return null;
  188. if (om != null)
  189. return ctx.Services.GetMessage (om.Message);
  190. else
  191. return null;
  192. }
  193. return null;
  194. }
  195. public override void Check (ConformanceCheckContext ctx, Operation value) { }
  196. public override void Check (ConformanceCheckContext ctx, OperationMessage value) { }
  197. public override void Check (ConformanceCheckContext ctx, Port value) { }
  198. public override void Check (ConformanceCheckContext ctx, PortType value) { }
  199. public override void Check (ConformanceCheckContext ctx, Service value) { }
  200. public override void Check (ConformanceCheckContext ctx, XmlSchema s)
  201. {
  202. if (s.TargetNamespace == null || s.TargetNamespace == "") {
  203. foreach (XmlSchemaObject ob in s.Items)
  204. if (!(ob is XmlSchemaImport) && !(ob is XmlSchemaAnnotation)) {
  205. ctx.ReportRuleViolation (s, BasicProfileRules.R2105);
  206. break;
  207. }
  208. }
  209. }
  210. public override void Check (ConformanceCheckContext ctx, XmlSchemaImport value)
  211. {
  212. XmlSchema doc = ctx.GetDocument (value.SchemaLocation) as XmlSchema;
  213. if (doc == null) ctx.ReportError (value, "Schema '" + value.SchemaLocation + "' not found");
  214. }
  215. public override void Check (ConformanceCheckContext ctx, XmlSchemaAttribute value)
  216. {
  217. CheckSchemaQName (ctx, value, value.RefName);
  218. CheckSchemaQName (ctx, value, value.SchemaTypeName);
  219. XmlAttribute[] uatts = value.UnhandledAttributes;
  220. if (uatts != null) {
  221. foreach (XmlAttribute at in uatts)
  222. if (at.LocalName == "arrayType" && at.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")
  223. ctx.ReportRuleViolation (value, BasicProfileRules.R2111);
  224. }
  225. }
  226. public override void Check (ConformanceCheckContext ctx, XmlSchemaAttributeGroupRef value)
  227. {
  228. CheckSchemaQName (ctx, value, value.RefName);
  229. }
  230. public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentExtension value)
  231. {
  232. CheckSchemaQName (ctx, value, value.BaseTypeName);
  233. if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
  234. ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
  235. }
  236. public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentRestriction value)
  237. {
  238. CheckSchemaQName (ctx, value, value.BaseTypeName);
  239. if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
  240. ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
  241. }
  242. public override void Check (ConformanceCheckContext ctx, XmlSchemaElement value)
  243. {
  244. CheckSchemaQName (ctx, value, value.RefName);
  245. CheckSchemaQName (ctx, value, value.SubstitutionGroup);
  246. CheckSchemaQName (ctx, value, value.SchemaTypeName);
  247. }
  248. public override void Check (ConformanceCheckContext ctx, XmlSchemaGroupRef value)
  249. {
  250. CheckSchemaQName (ctx, value, value.RefName);
  251. }
  252. public override void Check (ConformanceCheckContext ctx, XmlSchemaKeyref value)
  253. {
  254. CheckSchemaQName (ctx, value, value.Refer);
  255. }
  256. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleContentExtension value)
  257. {
  258. CheckSchemaQName (ctx, value, value.BaseTypeName);
  259. }
  260. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleContentRestriction value)
  261. {
  262. CheckSchemaQName (ctx, value, value.BaseTypeName);
  263. }
  264. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeList value)
  265. {
  266. CheckSchemaQName (ctx, value, value.ItemTypeName);
  267. }
  268. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeRestriction value)
  269. {
  270. CheckSchemaQName (ctx, value, value.BaseTypeName);
  271. }
  272. public override void Check (ConformanceCheckContext ctx, XmlSchemaSimpleTypeUnion value)
  273. {
  274. if (value.MemberTypes != null) {
  275. foreach (XmlQualifiedName name in value.MemberTypes)
  276. CheckSchemaQName (ctx, value, name);
  277. }
  278. }
  279. // Helper methods
  280. void CheckWsdlQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
  281. {
  282. if (name == null || name == XmlQualifiedName.Empty) return;
  283. if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
  284. if (ctx.ServiceDescription.Types != null && ctx.ServiceDescription.Types.Schemas != null)
  285. {
  286. foreach (XmlSchema s in ctx.ServiceDescription.Types.Schemas)
  287. {
  288. if (s.TargetNamespace == name.Namespace) return;
  289. foreach (XmlSchemaObject i in s.Includes)
  290. if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
  291. }
  292. }
  293. ctx.ReportRuleViolation (element, BasicProfileRules.R2101);
  294. }
  295. void CheckSchemaQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
  296. {
  297. if (name == null || name == XmlQualifiedName.Empty) return;
  298. if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
  299. if (ctx.CurrentSchema.TargetNamespace == name.Namespace) return;
  300. foreach (XmlSchemaObject i in ctx.CurrentSchema.Includes)
  301. if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
  302. ctx.ReportRuleViolation (element, BasicProfileRules.R2102);
  303. }
  304. LiteralType GetLiteralBindingType (Binding b)
  305. {
  306. SoapBinding sb = (SoapBinding) b.Extensions.Find (typeof(SoapBinding));
  307. SoapBindingStyle style = (sb != null) ? sb.Style : SoapBindingStyle.Document;
  308. if (style == SoapBindingStyle.Default) style = SoapBindingStyle.Document;
  309. foreach (OperationBinding ob in b.Operations) {
  310. SoapOperationBinding sob = (SoapOperationBinding) ob.Extensions.Find (typeof(SoapOperationBinding));
  311. if (sob.Style != SoapBindingStyle.Default && sob.Style != style)
  312. return LiteralType.Inconsistent;
  313. if (ob.Input != null) {
  314. SoapBodyBinding sbb = (SoapBodyBinding) ob.Input.Extensions.Find (typeof(SoapBodyBinding));
  315. if (sbb != null && sbb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  316. SoapFaultBinding sfb = (SoapFaultBinding) ob.Input.Extensions.Find (typeof(SoapFaultBinding));
  317. if (sfb != null && sfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  318. SoapHeaderBinding shb = (SoapHeaderBinding) ob.Input.Extensions.Find (typeof(SoapHeaderBinding));
  319. if (shb != null && shb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  320. SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) ob.Input.Extensions.Find (typeof(SoapHeaderFaultBinding));
  321. if (shfb != null && shfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  322. }
  323. if (ob.Output != null) {
  324. SoapBodyBinding sbb = (SoapBodyBinding) ob.Output.Extensions.Find (typeof(SoapBodyBinding));
  325. if (sbb != null && sbb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  326. SoapFaultBinding sfb = (SoapFaultBinding) ob.Input.Extensions.Find (typeof(SoapFaultBinding));
  327. if (sfb != null && sfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  328. SoapHeaderBinding shb = (SoapHeaderBinding) ob.Input.Extensions.Find (typeof(SoapHeaderBinding));
  329. if (shb != null && shb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  330. SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding) ob.Input.Extensions.Find (typeof(SoapHeaderFaultBinding));
  331. if (shfb != null && shfb.Use != SoapBindingUse.Literal) return LiteralType.NotLiteral;
  332. }
  333. }
  334. if (style == SoapBindingStyle.Document) return LiteralType.Document;
  335. else return LiteralType.Rpc;
  336. }
  337. enum LiteralType {
  338. NotLiteral,
  339. Inconsistent,
  340. Rpc,
  341. Document
  342. }
  343. }
  344. internal class BasicProfileRules
  345. {
  346. // 3.2 Conformance of Services, Consumers and Registries
  347. // Can't check: R0001
  348. // 3.3 Conformance Annotation in Descriptions
  349. // Can't check: R0002, R0003
  350. // 3.4 Conformance Annotation in Messages
  351. // Can't check: R0004, R0005, R0006, R0007
  352. // 3.5 Conformance Annotation in Registry Data
  353. // UDDI related: R3020, R3030, R3021, R3005, R3004.
  354. // 4.1 XML Representation of SOAP Messages
  355. // Rules not related to service description
  356. // 4.2 SOAP Processing Model
  357. // Rules not related to service description
  358. // 4.3 Use of SOAP in HTTP
  359. // Rules not related to service description
  360. // 5.1 Document structure
  361. public static readonly ConformanceRule R2001 = new ConformanceRule (
  362. "R2001",
  363. "A DESCRIPTION MUST only use the WSDL \"import\" statement to import another WSDL description",
  364. "");
  365. public static readonly ConformanceRule R2002 = new ConformanceRule (
  366. "R2002",
  367. "To import XML Schema Definitions, a DESCRIPTION MUST use the XML Schema \"import\" statement",
  368. "");
  369. public static readonly ConformanceRule R2007 = new ConformanceRule (
  370. "R2007",
  371. "A DESCRIPTION MUST specify a non-empty location attribute on the wsdl:import element",
  372. "");
  373. public static readonly ConformanceRule R2005 = new ConformanceRule (
  374. "R2005",
  375. "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",
  376. "");
  377. public static readonly ConformanceRule R2026 = new ConformanceRule (
  378. "R2026",
  379. "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",
  380. "");
  381. // 5.2 Types
  382. public static readonly ConformanceRule R2101 = new ConformanceRule (
  383. "R2101",
  384. "A DESCRIPTION MUST NOT use QName references to elements in namespaces that have been neither imported, nor defined in the referring WSDL document",
  385. "");
  386. public static readonly ConformanceRule R2102 = new ConformanceRule (
  387. "R2102",
  388. "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",
  389. "");
  390. public static readonly ConformanceRule R2105 = new ConformanceRule (
  391. "R2105",
  392. "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)",
  393. "");
  394. public static readonly ConformanceRule R2110 = new ConformanceRule (
  395. "R2110",
  396. "In a DESCRIPTION, array declarations MUST NOT extend or restrict the soapenc:Array type",
  397. "");
  398. public static readonly ConformanceRule R2111 = new ConformanceRule (
  399. "R2111",
  400. "In a DESCRIPTION, array declarations MUST NOT use wsdl:arrayType attribute in the type declaration",
  401. "");
  402. // R2112: Suggestion.
  403. // R2113: Not related to servide description
  404. // R2114: Suggestion.
  405. // 5.3 Messages
  406. public static readonly ConformanceRule R2201 = new ConformanceRule (
  407. "R2201",
  408. "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",
  409. "");
  410. public static readonly ConformanceRule R2210 = new ConformanceRule (
  411. "R2210",
  412. "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",
  413. "");
  414. public static readonly ConformanceRule R2203 = new ConformanceRule (
  415. "R2203",
  416. "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",
  417. "");
  418. public static readonly ConformanceRule R2204 = new ConformanceRule (
  419. "R2204",
  420. "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",
  421. "");
  422. public static readonly ConformanceRule R2205 = new ConformanceRule (
  423. "R2205",
  424. "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",
  425. "");
  426. public static readonly ConformanceRule R2209 = new ConformanceRule (
  427. "R2209",
  428. "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",
  429. "");
  430. public static readonly ConformanceRule R2206 = new ConformanceRule (
  431. "R2206",
  432. "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",
  433. "");
  434. // R2211: Related to message structure
  435. // R2202: Suggestion.
  436. // R2207: Optional
  437. // R2208: Optional
  438. // 5.4 Port Types
  439. // TODO
  440. // 5.5 Bindings
  441. // TODO
  442. // 5.6 SOAP Binding
  443. public static readonly ConformanceRule R2701 = new ConformanceRule (
  444. "R2701",
  445. "The wsdl:binding element in a DESCRIPTION MUST be constructed so that its soapbind:binding child element specifies the transport attribute",
  446. "");
  447. public static readonly ConformanceRule R2702 = new ConformanceRule (
  448. "R2702",
  449. "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\"",
  450. "");
  451. public static readonly ConformanceRule R2705 = new ConformanceRule (
  452. "R2705",
  453. "A wsdl:binding in a DESCRIPTION MUST use either be a rpc-literal binding or a document-literal binding",
  454. "");
  455. public static readonly ConformanceRule R2706 = new ConformanceRule (
  456. "R2706",
  457. "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",
  458. "");
  459. // 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
  460. // R2709: Suggestion.
  461. // TODO
  462. }
  463. /*
  464. The following rules cannot be checked:
  465. R2002, R2003, R4004, R4003, R2022, R2023, R2004, R2010, R2011
  466. There is no access to the unerlying xml
  467. The following are suggestions:
  468. R2008, R2112
  469. The following are optional
  470. R4002, R2020, R2021, R2024, R2114
  471. Can't be checked:
  472. R2025
  473. Process related
  474. R2027
  475. TODO: section 5.3
  476. */
  477. }
  478. #endif