Author: atsushi
Date: 2006-12-04 02:37:36 -0500 (Mon, 04 Dec 2006)
New Revision: 68931

Modified:
   trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
   trunk/olive/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs
   trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ChangeLog
   
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostTest.cs
Log:
2006-12-04  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * ServiceHostBase.cs : (GetContract) If the service type is
          IMetadataExchange, don't require ServiceMetadataBehavior.

        * ServiceHostTest.cs : added test for ServiceMetadataBehavior
          existence check for non-IMetadataExchange type.



Modified: trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog 
2006-12-04 06:48:15 UTC (rev 68930)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel/ChangeLog 
2006-12-04 07:37:36 UTC (rev 68931)
@@ -1,3 +1,8 @@
+2006-12-04  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * ServiceHostBase.cs : (GetContract) If the service type is
+         IMetadataExchange, don't require ServiceMetadataBehavior.
+
 2006-10-22  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * ServiceHostBase.cs : on closing channel dispatchers, they will

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs    
    2006-12-04 06:48:15 UTC (rev 68930)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs    
    2006-12-04 07:37:36 UTC (rev 68931)
@@ -187,7 +187,7 @@
                        // is the exception case that does not require full
                        // type name. Hence I treat it as a special case.
                        if (typeName == 
ServiceMetadataBehavior.MexContractName) {
-                               if (!Description.Behaviors.Contains (typeof 
(ServiceMetadataBehavior)))
+                               if (!Description.Behaviors.Contains (typeof 
(ServiceMetadataBehavior)) && Array.IndexOf 
(Description.ServiceType.GetInterfaces (), typeof (IMetadataExchange)) < 0)
                                        throw new InvalidOperationException (
                                                "Add ServiceMetadataBehavior to 
the ServiceHost to add a endpoint for IMetadataExchange contract.");
                                        

Modified: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ChangeLog    
2006-12-04 06:48:15 UTC (rev 68930)
+++ trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ChangeLog    
2006-12-04 07:37:36 UTC (rev 68931)
@@ -1,3 +1,8 @@
+2006-12-04  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * ServiceHostTest.cs : added test for ServiceMetadataBehavior
+         existence check for non-IMetadataExchange type.
+
 2006-10-05  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * WSHttpBindingTest.cs : more property check for x509 parameters.

Modified: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostTest.cs
   2006-12-04 06:48:15 UTC (rev 68930)
+++ 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel/ServiceHostTest.cs
   2006-12-04 07:37:36 UTC (rev 68931)
@@ -173,6 +173,16 @@
                }
 
                [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void AddServiceEndpointMex ()
+               {
+                       using (ServiceHost h = new ServiceHost (typeof (Foo), 
new Uri ("http://localhost:8080";))) {
+                               // it expects ServiceMetadataBehavior
+                               h.AddServiceEndpoint 
(ServiceMetadataBehavior.MexContractName, 
MetadataExchangeBindings.CreateMexHttpBinding (), "mex");
+                       }
+               }
+
+               [Test]
                public void AddServiceEndpointMetadataExchange ()
                {
                        ServiceHost host = new ServiceHost (typeof 
(MyMetadataExchange));

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

Reply via email to