void CheckMessageBinding(ConformanceCheckContext ctx, Hashtable portParts, MessageBinding value) { SoapBodyBinding sbb = (SoapBodyBinding)value.Extensions.Find(typeof(SoapBodyBinding)); Message msg = FindMessage(ctx, value); LiteralType bt = GetLiteralBindingType(value.OperationBinding.Binding); if (sbb != null) { if (bt == LiteralType.Document) { if (sbb.Parts != null && sbb.Parts.Length > 1) { ctx.ReportRuleViolation(value, BasicProfileRules.R2201); } if (sbb.Parts == null) { if (msg.Parts != null && msg.Parts.Count > 1) { ctx.ReportRuleViolation(value, BasicProfileRules.R2210); } if (msg.Parts.Count == 1) { portParts.Remove(msg.Parts[0]); } } else { if (sbb.Parts.Length == 0 && msg.Parts.Count == 1) { portParts.Remove(msg.Parts[0]); } else { foreach (string part in sbb.Parts) { MessagePart mp = msg.FindPartByName(part); portParts.Remove(mp); if (!mp.DefinedByElement) { ctx.ReportRuleViolation(value, BasicProfileRules.R2204); } } } } } else if (bt == LiteralType.Rpc) { if (sbb.Parts != null) { foreach (string part in sbb.Parts) { MessagePart mp = msg.FindPartByName(part); portParts.Remove(mp); if (!mp.DefinedByType) { ctx.ReportRuleViolation(value, BasicProfileRules.R2203); } } } } } SoapHeaderBinding shb = (SoapHeaderBinding)value.Extensions.Find(typeof(SoapHeaderBinding)); if (shb != null) { Message hm = ctx.Services.GetMessage(shb.Message); MessagePart mp = hm.FindPartByName(shb.Part); portParts.Remove(mp); if (mp != null && !mp.DefinedByElement) { ctx.ReportRuleViolation(value, BasicProfileRules.R2205); } } SoapHeaderFaultBinding shfb = (SoapHeaderFaultBinding)value.Extensions.Find(typeof(SoapHeaderFaultBinding)); if (shfb != null) { Message hm = ctx.Services.GetMessage(shfb.Message); MessagePart mp = hm.FindPartByName(shfb.Part); portParts.Remove(mp); if (mp != null && !mp.DefinedByElement) { ctx.ReportRuleViolation(value, BasicProfileRules.R2205); } } // TODO: SoapFaultBinding ?? }