diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-18 22:54:10 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-09-18 22:54:10 -0700 |
commit | 4b6f60f351b8520e3824ee80dc0066f1c69c29b4 (patch) | |
tree | b541a53615096c49d2f4988e68622a10b50ff412 /src/DotNetOAuth/Messaging/Channel.cs | |
parent | 11615a19bad90741c7a755eaf741b8683992c9ff (diff) | |
download | DotNetOpenAuth-4b6f60f351b8520e3824ee80dc0066f1c69c29b4.zip DotNetOpenAuth-4b6f60f351b8520e3824ee80dc0066f1c69c29b4.tar.gz DotNetOpenAuth-4b6f60f351b8520e3824ee80dc0066f1c69c29b4.tar.bz2 |
All tests passing, with more work done.
Diffstat (limited to 'src/DotNetOAuth/Messaging/Channel.cs')
-rw-r--r-- | src/DotNetOAuth/Messaging/Channel.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/DotNetOAuth/Messaging/Channel.cs b/src/DotNetOAuth/Messaging/Channel.cs index fd7e676..be3cdf2 100644 --- a/src/DotNetOAuth/Messaging/Channel.cs +++ b/src/DotNetOAuth/Messaging/Channel.cs @@ -16,6 +16,7 @@ namespace DotNetOAuth.Messaging { using System.Text;
using System.Web;
using DotNetOAuth.Messaging.Reflection;
+ using DotNetOAuth.Messaging.Bindings;
/// <summary>
/// Manages sending direct messages to a remote party and receiving responses.
@@ -83,6 +84,9 @@ namespace DotNetOAuth.Messaging { this.messageTypeProvider = messageTypeProvider;
this.bindingElements = new List<IChannelBindingElement>(ValidateAndPrepareBindingElements(bindingElements));
+
+ // Add a complete message check as a last outgoing step.
+ this.bindingElements.Add(new EnsureCompleteMessageBindingElement());
}
/// <summary>
@@ -532,8 +536,7 @@ namespace DotNetOAuth.Messaging { private void EnsureValidMessageParts(IProtocolMessage message) {
Debug.Assert(message != null, "message == null");
- // TODO: call MessagePart.IsValidValue()
- MessageDescription description = new MessageDescription(message.GetType());
+ MessageDescription description = MessageDescription.Get(message.GetType());
List<MessagePart> invalidParts = description.Mapping.Values.Where(part => !part.IsValidValue(message)).ToList();
if (invalidParts.Count > 0) {
throw new ProtocolException(string.Format(
|