Author: atsushi
Date: 2008-02-14 04:53:58 -0500 (Thu, 14 Feb 2008)
New Revision: 95612

Added:
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebAttributeInfo.cs
   trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/
   
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog
   
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebGetAttributeTest.cs
   
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs
Modified:
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/ChangeLog
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog
   trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web.dll.sources
   trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebChannelFactory.cs
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebGetAttribute.cs
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebInvokeAttribute.cs
Log:
2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * WebAttributeInfo.cs : new class to unify WebGet and WebInvoke.
        * WebInvokeAttribute.cs, WebGetAttribute.cs : rewrote to use above.
        * WebChannelFactory.cs : removed couple of MonoTODOs.

        * WebMessageFormatter.cs : new message formatter that is created
          from WebHttpBehavior and handles [WebGet] or [WebInvoke]. Not done.

        * WebHttpBehavior.cs : use WebMessageFormatter (note that they are
          not done yet).

        * WebGetAttributeTest.cs, WebInvokeAttributeTest.cs : new tests.



Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/ChangeLog
 2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/ChangeLog
 2008-02-14 09:53:58 UTC (rev 95612)
@@ -1,3 +1,8 @@
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * WebHttpBehavior.cs : use WebMessageFormatter (note that they are
+         not done yet).
+
 2008-02-13  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * WebScriptEnablingBehavior.cs : new stub.

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs
        2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs
        2008-02-14 09:53:58 UTC (rev 95612)
@@ -110,25 +110,25 @@
                [MonoTODO]
                protected virtual IClientMessageFormatter 
GetReplyClientFormatter (OperationDescription operationDescription, 
ServiceEndpoint endpoint)
                {
-                       throw new NotImplementedException ();
+                       return new WebMessageFormatter.ReplyClientFormatter 
(operationDescription, endpoint);
                }
 
                [MonoTODO]
                protected virtual IDispatchMessageFormatter 
GetReplyDispatchFormatter (OperationDescription operationDescription, 
ServiceEndpoint endpoint)
                {
-                       throw new NotImplementedException ();
+                       return new WebMessageFormatter.ReplyDispatchFormatter 
(operationDescription, endpoint);
                }
 
                [MonoTODO]
                protected virtual IClientMessageFormatter 
GetRequestClientFormatter (OperationDescription operationDescription, 
ServiceEndpoint endpoint)
                {
-                       throw new NotImplementedException ();
+                       return new WebMessageFormatter.RequestClientFormatter 
(operationDescription, endpoint);
                }
 
                [MonoTODO]
                protected virtual IDispatchMessageFormatter 
GetRequestDispatchFormatter (OperationDescription operationDescription, 
ServiceEndpoint endpoint)
                {
-                       throw new NotImplementedException ();
+                       return new WebMessageFormatter.RequestDispatchFormatter 
(operationDescription, endpoint);
                }
 
                [MonoTODO]

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog
  2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog
  2008-02-14 09:53:58 UTC (rev 95612)
@@ -1,3 +1,8 @@
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * WebMessageFormatter.cs : new message formatter that is created
+         from WebHttpBehavior and handles [WebGet] or [WebInvoke]. Not done.
+
 2008-02-13  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * QueryStringConverter.cs : I could just check null parameter.

Added: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs
     2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs
     2008-02-14 09:53:58 UTC (rev 95612)
@@ -0,0 +1,200 @@
+//
+// WebMessageFormatter.cs
+//
+// Author:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Reflection;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Web;
+using System.Text;
+
+namespace System.ServiceModel.Description
+{
+       internal abstract class WebMessageFormatter
+       {
+               OperationDescription operation;
+               MessageDescription message_desc;
+               ServiceEndpoint endpoint;
+               UriTemplate template;
+
+               public WebMessageFormatter (OperationDescription operation, 
ServiceEndpoint endpoint)
+               {
+                       this.operation = operation;
+                       this.endpoint = endpoint;
+                       ApplyWebAttribute ();
+               }
+
+               void ApplyWebAttribute ()
+               {
+                       MethodInfo mi = operation.SyncMethod ?? 
operation.BeginMethod;
+
+                       object [] atts = mi.GetCustomAttributes (typeof 
(WebGetAttribute), false);
+                       WebAttributeInfo info = null;
+                       if (atts.Length > 0)
+                               info = ((WebGetAttribute) atts [0]).Info;
+                       atts = mi.GetCustomAttributes (typeof 
(WebInvokeAttribute), false);
+                       if (atts.Length > 0)
+                               info = ((WebInvokeAttribute) atts [0]).Info;
+                       if (info == null)
+                               info = new WebAttributeInfo ();
+
+                       template = new UriTemplate (info.UriTemplate ?? 
BuildUriTemplate ());
+                       message_desc = GetMessageDescription ();
+               }
+
+               public OperationDescription Operation {
+                       get { return operation; }
+               }
+
+               public MessageDescription Message {
+                       get { return message_desc; }
+               }
+
+               public ServiceEndpoint Endpoint {
+                       get { return endpoint; }
+               }
+
+               public UriTemplate UriTemplate {
+                       get { return template; }
+               }
+
+               public abstract MessageDirection MessageDirection { get; }
+
+               string BuildUriTemplate ()
+               {
+                       StringBuilder sb = new StringBuilder ();
+                       MessageDescription md = GetMessageDescription ();
+                       sb.Append (Operation.Name);
+                       for (int i = 0; i < md.Body.Parts.Count; i++) {
+                               MessagePartDescription mp = md.Body.Parts [i];
+                               sb.Append (i == 0 ? '?' : '&');
+                               sb.Append (mp.Name);
+                               sb.Append ("={");
+                               sb.Append (mp.Name);
+                               sb.Append ('}');
+                       }
+                       return sb.ToString ();
+               }
+
+               MessageDescription GetMessageDescription ()
+               {
+                       foreach (MessageDescription md in operation.Messages)
+                               if (md.Direction == this.MessageDirection)
+                                       return md;
+                       throw new SystemException ("INTERNAL ERROR: no 
corresponding message description for the specified direction: " + 
MessageDirection);
+               }
+
+               internal class RequestClientFormatter : WebMessageFormatter, 
IClientMessageFormatter
+               {
+                       public RequestClientFormatter (OperationDescription 
operation, ServiceEndpoint endpoint)
+                               : base (operation, endpoint)
+                       {
+                       }
+
+                       public override MessageDirection MessageDirection {
+                               get { return MessageDirection.Input; }
+                       }
+
+                       public Message SerializeRequest (MessageVersion 
messageVersion, object [] parameters)
+                       {
+                               throw new NotImplementedException ();
+                       }
+
+                       public object DeserializeReply (Message message, object 
[] parameters)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               internal class ReplyClientFormatter : WebMessageFormatter, 
IClientMessageFormatter
+               {
+                       public ReplyClientFormatter (OperationDescription 
operation, ServiceEndpoint endpoint)
+                               : base (operation, endpoint)
+                       {
+                       }
+
+                       public override MessageDirection MessageDirection {
+                               get { return MessageDirection.Output; }
+                       }
+
+                       public Message SerializeRequest (MessageVersion 
messageVersion, object [] parameters)
+                       {
+                               throw new NotImplementedException ();
+                       }
+
+                       public object DeserializeReply (Message message, object 
[] parameters)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               internal class RequestDispatchFormatter : WebMessageFormatter, 
IDispatchMessageFormatter
+               {
+                       public RequestDispatchFormatter (OperationDescription 
operation, ServiceEndpoint endpoint)
+                               : base (operation, endpoint)
+                       {
+                       }
+
+                       public override MessageDirection MessageDirection {
+                               get { return MessageDirection.Input; }
+                       }
+
+                       public Message SerializeReply (MessageVersion 
messageVersion, object [] parameters, object result)
+                       {
+                               throw new NotImplementedException ();
+                       }
+
+                       public void DeserializeRequest (Message message, object 
[] parameters)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               internal class ReplyDispatchFormatter : WebMessageFormatter, 
IDispatchMessageFormatter
+               {
+                       public ReplyDispatchFormatter (OperationDescription 
operation, ServiceEndpoint endpoint)
+                               : base (operation, endpoint)
+                       {
+                       }
+
+                       public override MessageDirection MessageDirection {
+                               get { return MessageDirection.Output; }
+                       }
+
+                       public Message SerializeReply (MessageVersion 
messageVersion, object [] parameters, object result)
+                       {
+                               throw new NotImplementedException ();
+                       }
+
+                       public void DeserializeRequest (Message message, object 
[] parameters)
+                       {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}


Property changes on: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog 
2008-02-14 09:01:59 UTC (rev 95611)
+++ trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog 
2008-02-14 09:53:58 UTC (rev 95612)
@@ -1,5 +1,11 @@
 2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * WebAttributeInfo.cs : new class to unify WebGet and WebInvoke.
+       * WebInvokeAttribute.cs, WebGetAttribute.cs : rewrote to use above.
+       * WebChannelFactory.cs : removed couple of MonoTODOs.
+
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * WebGetAttribute.cs, WebInvokeAttribute.cs : they are "passive"
          operation behaviors and do nothing.
        * WebChannelFactory.cs : if no Binding is set, set default

Added: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebAttributeInfo.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebAttributeInfo.cs
       2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebAttributeInfo.cs
       2008-02-14 09:53:58 UTC (rev 95612)
@@ -0,0 +1,91 @@
+//
+// WebAttributeInfo.cs
+//
+// Author:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+
+namespace System.ServiceModel.Web
+{
+       internal class WebAttributeInfo
+       {
+               string uri_template;
+               WebMessageFormat request_format, response_format;
+               WebMessageBodyStyle body_style;
+               bool has_body_style, has_request_format, has_response_format;
+               string method = "POST";
+
+               public WebMessageBodyStyle BodyStyle {
+                       get { return body_style; }
+                       set {
+                               body_style = value;
+                               has_body_style = true;
+                       }
+               }
+
+               public bool IsBodyStyleSetExplicitly {
+                       get { return has_body_style; }
+               }
+
+               public bool IsRequestFormatSetExplicitly {
+                       get { return has_request_format; }
+               }
+
+               public bool IsResponseFormatSetExplicitly {
+                       get { return has_response_format; }
+               }
+
+               public WebMessageFormat RequestFormat {
+                       get { return request_format; }
+                       set {
+                               request_format = value;
+                               has_request_format = true;
+                       }
+               }
+
+               public WebMessageFormat ResponseFormat {
+                       get { return response_format; }
+                       set {
+                               response_format = value;
+                               has_response_format = true;
+                       }
+               }
+
+               // only meaningful for WebInvokeAttribute.
+               public string Method {
+                       get { return method; }
+                       set { method = value; }
+               }
+
+               public string UriTemplate {
+                       get { return uri_template; }
+                       set { uri_template = value; }
+               }
+       }
+}


Property changes on: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebAttributeInfo.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebChannelFactory.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebChannelFactory.cs
      2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebChannelFactory.cs
      2008-02-14 09:53:58 UTC (rev 95612)
@@ -39,51 +39,43 @@
 {
        public class WebChannelFactory<TChannel> : ChannelFactory<TChannel>
        {
-               [MonoTODO]
                public WebChannelFactory ()
                        : base ()
                {
                }
 
-               [MonoTODO]
                public WebChannelFactory (Type serviceType)
                        : base (serviceType)
                {
                }
 
-               [MonoTODO]
                public WebChannelFactory (string configurationName)
                        : base (configurationName)
                {
                }
 
-               [MonoTODO]
                public WebChannelFactory (Binding binding)
                        : base (binding)
                {
                }
 
-               [MonoTODO]
                public WebChannelFactory (Uri remoteAddress)
                        : base ()
                {
                        Endpoint.Address = new EndpointAddress (remoteAddress);
                }
 
-               [MonoTODO]
                public WebChannelFactory (string configurationName, Uri 
remoteAddress)
                        : this (configurationName)
                {
                        Endpoint.Address = new EndpointAddress (remoteAddress);
                }
 
-               [MonoTODO]
                public WebChannelFactory (Binding binding, Uri remoteAddress)
                        : this (new ServiceEndpoint 
(ContractDescription.GetContract (typeof (TChannel)), binding, new 
EndpointAddress (remoteAddress)))
                {
                }
 
-               [MonoTODO]
                public WebChannelFactory (ServiceEndpoint endpoint)
                        : base (endpoint)
                {

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebGetAttribute.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebGetAttribute.cs
        2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebGetAttribute.cs
        2008-02-14 09:53:58 UTC (rev 95612)
@@ -36,50 +36,47 @@
        [AttributeUsage (AttributeTargets.Method)]
        public sealed class WebGetAttribute : Attribute, IOperationBehavior
        {
-               string uri_template;
-               WebMessageFormat request_format, response_format;
-               WebMessageBodyStyle body_style;
-               bool has_body_style, has_request_format, has_response_format;
+               WebAttributeInfo info = new WebAttributeInfo () { Method = 
"GET" };
 
+               internal WebAttributeInfo Info {
+                       get { return info; }
+               }
+
                public WebMessageBodyStyle BodyStyle {
-                       get { return body_style; }
-                       set {
-                               body_style = value;
-                               has_body_style = true;
-                       }
+                       get { return info.BodyStyle; }
+                       set { info.BodyStyle = value; }
                }
 
                public bool IsBodyStyleSetExplicitly {
-                       get { return has_body_style; }
+                       get { return info.IsBodyStyleSetExplicitly; }
                }
 
                public bool IsRequestFormatSetExplicitly {
-                       get { return has_request_format; }
+                       get { return info.IsRequestFormatSetExplicitly; }
                }
 
                public bool IsResponseFormatSetExplicitly {
-                       get { return has_response_format; }
+                       get { return info.IsResponseFormatSetExplicitly; }
                }
 
                public WebMessageFormat RequestFormat {
-                       get { return request_format; }
-                       set {
-                               request_format = value;
-                               has_request_format = true;
-                       }
+                       get { return info.RequestFormat; }
+                       set { info.RequestFormat = value; }
                }
 
                public WebMessageFormat ResponseFormat {
-                       get { return response_format; }
-                       set {
-                               response_format = value;
-                               has_response_format = true;
-                       }
+                       get { return info.ResponseFormat ; }
+                       set { info.ResponseFormat = value; }
                }
 
+               public string Method {
+                       get { return info.Method; }
+                       set { info.Method = value; }
+               }
+
                public string UriTemplate {
-                       get { return uri_template; }
-                       set { uri_template = value; }
+                       get { return info.UriTemplate; }
+                       set { info.UriTemplate = value; }
                }
 
                void IOperationBehavior.AddBindingParameters 
(OperationDescription operation, BindingParameterCollection parameters)

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebInvokeAttribute.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebInvokeAttribute.cs
     2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web/WebInvokeAttribute.cs
     2008-02-14 09:53:58 UTC (rev 95612)
@@ -36,56 +36,47 @@
        [AttributeUsage (AttributeTargets.Method)]
        public sealed class WebInvokeAttribute : Attribute, IOperationBehavior
        {
-               string uri_template;
-               WebMessageFormat request_format, response_format;
-               WebMessageBodyStyle body_style;
-               bool has_body_style, has_request_format, has_response_format;
-               string method = "POST";
+               WebAttributeInfo info = new WebAttributeInfo ();
 
+               internal WebAttributeInfo Info {
+                       get { return info; }
+               }
+
                public WebMessageBodyStyle BodyStyle {
-                       get { return body_style; }
-                       set {
-                               body_style = value;
-                               has_body_style = true;
-                       }
+                       get { return info.BodyStyle; }
+                       set { info.BodyStyle = value; }
                }
 
                public bool IsBodyStyleSetExplicitly {
-                       get { return has_body_style; }
+                       get { return info.IsBodyStyleSetExplicitly; }
                }
 
                public bool IsRequestFormatSetExplicitly {
-                       get { return has_request_format; }
+                       get { return info.IsRequestFormatSetExplicitly; }
                }
 
                public bool IsResponseFormatSetExplicitly {
-                       get { return has_response_format; }
+                       get { return info.IsResponseFormatSetExplicitly; }
                }
 
                public WebMessageFormat RequestFormat {
-                       get { return request_format; }
-                       set {
-                               request_format = value;
-                               has_request_format = true;
-                       }
+                       get { return info.RequestFormat; }
+                       set { info.RequestFormat = value; }
                }
 
                public WebMessageFormat ResponseFormat {
-                       get { return response_format; }
-                       set {
-                               response_format = value;
-                               has_response_format = true;
-                       }
+                       get { return info.ResponseFormat ; }
+                       set { info.ResponseFormat = value; }
                }
 
                public string Method {
-                       get { return method; }
-                       set { method = value; }
+                       get { return info.Method; }
+                       set { info.Method = value; }
                }
 
                public string UriTemplate {
-                       get { return uri_template; }
-                       set { uri_template = value; }
+                       get { return info.UriTemplate; }
+                       set { info.UriTemplate = value; }
                }
 
                void IOperationBehavior.AddBindingParameters 
(OperationDescription operation, BindingParameterCollection parameters)

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web.dll.sources
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web.dll.sources   
    2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel.Web.dll.sources   
    2008-02-14 09:53:58 UTC (rev 95612)
@@ -22,6 +22,7 @@
 System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
 System.ServiceModel.Dispatcher/QueryStringConverter.cs
 System.ServiceModel.Dispatcher/WebHttpDispatchOperationSelector.cs
+System.ServiceModel.Dispatcher/WebMessageFormatter.cs
 System.ServiceModel.Syndication/Atom10FeedFormatter.cs
 System.ServiceModel.Syndication/Atom10FeedFormatter_1.cs
 System.ServiceModel.Syndication/Atom10ItemFormatter.cs
@@ -51,6 +52,7 @@
 System.ServiceModel.Web/IncomingWebResponseContext.cs
 System.ServiceModel.Web/OutgoingWebRequestContext.cs
 System.ServiceModel.Web/OutgoingWebResponseContext.cs
+System.ServiceModel.Web/WebAttributeInfo.cs
 System.ServiceModel.Web/WebChannelFactory.cs
 System.ServiceModel.Web/WebGetAttribute.cs
 System.ServiceModel.Web/WebInvokeAttribute.cs

Added: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog
    2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog
    2008-02-14 09:53:58 UTC (rev 95612)
@@ -0,0 +1,3 @@
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * WebGetAttributeTest.cs, WebInvokeAttributeTest.cs : new tests.


Property changes on: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog
___________________________________________________________________
Name: svn:executable
   + *

Added: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebGetAttributeTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebGetAttributeTest.cs
       2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebGetAttributeTest.cs
       2008-02-14 09:53:58 UTC (rev 95612)
@@ -0,0 +1,66 @@
+//
+// WebGetAttributeTest.cs
+//
+// Author:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Web;
+using NUnit.Framework;
+
+using CategoryAttribute = NUnit.Framework.CategoryAttribute;
+
+namespace MonoTests.System.ServiceModel.Description
+{
+       [TestFixture]
+       public class WebGetAttributeTest
+       {
+               [Test]
+               public void IOperationBehaviorMethods ()
+               {
+                       IOperationBehavior oper = new WebGetAttribute ();
+                       var pl = new BindingParameterCollection ();
+                       var od = ContractDescription.GetContract (typeof 
(TestService)).Operations [0];
+                       oper.AddBindingParameters (od, pl);
+                       Assert.AreEqual (0, pl.Count, "#1");
+
+                       // yeah it really does nothing.
+                       oper.AddBindingParameters (null, null);
+
+                       oper.ApplyClientBehavior (od, null);
+                       oper.ApplyDispatchBehavior (od, null);
+                       oper.Validate (od);
+               }
+
+               [ServiceContract]
+               public interface TestService
+               {
+                       [OperationContract]
+                       string TestMethod (string input);
+               }
+       }
+}


Property changes on: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebGetAttributeTest.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs
    2008-02-14 09:01:59 UTC (rev 95611)
+++ 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs
    2008-02-14 09:53:58 UTC (rev 95612)
@@ -0,0 +1,66 @@
+//
+// WebInvokeAttributeTest.cs
+//
+// Author:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Web;
+using NUnit.Framework;
+
+using CategoryAttribute = NUnit.Framework.CategoryAttribute;
+
+namespace MonoTests.System.ServiceModel.Description
+{
+       [TestFixture]
+       public class WebInvokeAttributeTest
+       {
+               [Test]
+               public void IOperationBehaviorMethods ()
+               {
+                       IOperationBehavior oper = new WebInvokeAttribute ();
+                       var pl = new BindingParameterCollection ();
+                       var od = ContractDescription.GetContract (typeof 
(TestService)).Operations [0];
+                       oper.AddBindingParameters (od, pl);
+                       Assert.AreEqual (0, pl.Count, "#1");
+
+                       // yeah it really does nothing.
+                       oper.AddBindingParameters (null, null);
+
+                       oper.ApplyClientBehavior (od, null);
+                       oper.ApplyDispatchBehavior (od, null);
+                       oper.Validate (od);
+               }
+
+               [ServiceContract]
+               public interface TestService
+               {
+                       [OperationContract]
+                       string TestMethod (string input);
+               }
+       }
+}


Property changes on: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to