Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@ -70,17 +70,14 @@ namespace System.ServiceModel.Dispatcher
internal static void Validate (OperationDescription od, bool isRpc, bool isEncoded)
{
bool hasParameter = false, hasVoid = false;
bool hasVoid = false;
foreach (var md in od.Messages) {
if (md.IsTypedMessage || md.IsUntypedMessage) {
if (isRpc && !isEncoded)
throw new InvalidOperationException ("Message with action {0} is either strongly-typed or untyped, but defined as RPC and encoded.");
if (hasParameter && !md.IsVoid)
throw new InvalidOperationException (String.Format ("Operation '{0}' contains a message with parameters. Strongly-typed or untyped message can be paired only with strongly-typed, untyped or void message.", od.Name));
if (isRpc && hasVoid)
throw new InvalidOperationException (String.Format ("This operation '{0}' is defined as RPC and contains a message with void, which is not allowed.", od.Name));
} else {
hasParameter |= !md.IsVoid;
hasVoid |= md.IsVoid;
}
}