BasicProfileChecker.cs 22 KB

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