Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2009-10-07 16:57:57 +0400
committerAtsushi Eno <atsushieno@gmail.com>2009-10-07 16:57:57 +0400
commit3ae78fa0b4140b4122718c8733942b889e199dea (patch)
tree1d61595e83ad222e912e20a52a44fa42233ea039 /mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs
parent2e58802be58f869db32e1596d69972364e883ee6 (diff)
2009-10-07 Atsushi Enomoto <atsushi@ximian.com>
* WebScriptServiceHostFactory.cs : I have to again revert the previous change; it does fill endpoints regardless of hosting environment (now with tests). * WebScriptEnablingBehavior.cs : validate body style. * WebHttpBehavior.cs : operations could miss WebGet/WebInvoke and we should not crash by NRE because of missing of those atts. * WebScriptServiceHostFactoryTest.cs : add tests for contract and wrapped validity. svn path=/trunk/mcs/; revision=143637
Diffstat (limited to 'mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs')
-rw-r--r--mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs
index a13b703c628..e517ee95d9d 100644
--- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs
+++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs
@@ -55,6 +55,7 @@ namespace System.ServiceModel.Activation
throw new ArgumentNullException ("serviceType");
}
+#if false
protected override void ApplyConfiguration ()
{
base.ApplyConfiguration ();
@@ -68,9 +69,17 @@ namespace System.ServiceModel.Activation
AddServiceEndpoint (iface, new WebHttpBinding (), new Uri (String.Empty, UriKind.Relative));
}
}
+#endif
protected override void OnOpening ()
{
+ if (Description.Endpoints.Count == 0) {
+ if (ImplementedContracts.Count > 1)
+ throw new InvalidOperationException ("WebScriptServiceHostFactory does not allow more than one service contract in the service type");
+ foreach (var pair in ImplementedContracts) // actually one
+ AddServiceEndpoint (pair.Key, new WebHttpBinding (), new Uri (String.Empty, UriKind.Relative));
+ }
+
foreach (ServiceEndpoint se in Description.Endpoints)
if (se.Behaviors.Find<WebHttpBehavior> () == null)
se.Behaviors.Add (new WebScriptEnablingBehavior ());