public override void Check (ConformanceCheckContext ctx, Message value)
{
}
-
+
+ public override void Check (ConformanceCheckContext ctx, BindingCollection value) {
+ foreach (Binding b in value)
+ foreach (ServiceDescriptionFormatExtension ext in b.Extensions)
+ if (ext.GetType () == typeof (SoapBinding))
+ return;
+
+ ctx.ReportRuleViolation (value, BasicProfileRules.R2401);
+ }
+
public override void Check (ConformanceCheckContext ctx, Binding value)
{
SoapBinding sb = (SoapBinding) value.Extensions.Find (typeof(SoapBinding));
- if (sb == null) {
- ctx.ReportRuleViolation (value, BasicProfileRules.R2401);
+ if (sb == null)
return;
- }
+
if (sb.Transport == null || sb.Transport == "") {
ctx.ReportRuleViolation (value, BasicProfileRules.R2701);
return;
if (binfo.WebServiceBindingAttribute != null && binfo.WebServiceBindingAttribute.ConformsTo != WsiProfiles.None && String.IsNullOrEmpty (binfo.WebServiceBindingAttribute.Name)) {
BasicProfileViolationCollection violations = new BasicProfileViolationCollection ();
desc.Types.Schemas.Add (Schemas);
- if (!WebServicesInteroperability.CheckConformance (binfo.WebServiceBindingAttribute.ConformsTo, desc, violations))
- throw new InvalidOperationException (violations [0].ToString ());
+ ServiceDescriptionCollection col = new ServiceDescriptionCollection ();
+ col.Add (desc);
+ ConformanceCheckContext ctx = new ConformanceCheckContext (col, violations);
+ ConformanceChecker[] checkers = WebServicesInteroperability.GetCheckers (binfo.WebServiceBindingAttribute.ConformsTo);
+ foreach (ConformanceChecker checker in checkers) {
+ WebServicesInteroperability.Check (ctx, checker, binding);
+ if (violations.Count > 0)
+ throw new InvalidOperationException (violations [0].ToString ());
+ }
}
#endif
}
return ctx.Violations.Count == 0;
}
- static ConformanceChecker[] GetCheckers (WsiProfiles claims)
+ internal static ConformanceChecker[] GetCheckers (WsiProfiles claims)
{
if ((claims & WsiProfiles.BasicProfile1_1) != 0)
return new ConformanceChecker[] { BasicProfileChecker.Instance };
return null;
}
+
+ internal static void Check (ConformanceCheckContext ctx, ConformanceChecker checker, Binding b)
+ {
+ checker.Check (ctx, b);
+ CheckExtensions (ctx, checker, b.Extensions);
+
+ foreach (OperationBinding oper in b.Operations) {
+ CheckExtensions (ctx, checker, oper.Extensions);
+
+ foreach (MessageBinding mb in oper.Faults) {
+ checker.Check (ctx, mb);
+ CheckExtensions (ctx, checker, mb.Extensions);
+ }
+
+ checker.Check (ctx, oper.Input);
+ CheckExtensions (ctx, checker, oper.Input.Extensions);
+
+ checker.Check (ctx, oper.Output);
+ CheckExtensions (ctx, checker, oper.Output.Extensions);
+ }
+ }
static void Check (ConformanceCheckContext ctx, ConformanceChecker checker, ServiceDescription sd)
{
CheckExtensions (ctx, checker, p.Extensions);
}
}
-
+
+ checker.Check (ctx, sd.Bindings);
foreach (Binding b in sd.Bindings)
- {
- checker.Check (ctx, b);
- CheckExtensions (ctx, checker, b.Extensions);
-
- foreach (OperationBinding oper in b.Operations) {
- CheckExtensions (ctx, checker, oper.Extensions);
-
- foreach (MessageBinding mb in oper.Faults) {
- checker.Check (ctx, mb);
- CheckExtensions (ctx, checker, mb.Extensions);
- }
-
- checker.Check (ctx, oper.Input);
- CheckExtensions (ctx, checker, oper.Input.Extensions);
-
- checker.Check (ctx, oper.Output);
- CheckExtensions (ctx, checker, oper.Output.Extensions);
- }
- }
+ Check (ctx, checker, b);
foreach (PortType pt in sd.PortTypes)
{