[wcf] .NET allows for service contract methods to be decorated only by Web{Get,Invoke...
authorMarek Habersack <grendel@twistedcode.net>
Wed, 10 Nov 2010 18:17:29 +0000 (19:17 +0100)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 10 Nov 2010 18:22:26 +0000 (19:22 +0100)
commit8a63927fd1e5216e8e356a5aa93363a65ef5fdfd
tree58bada5cbdc06e053a3d8dfdf3c629b604f1a21a
parente152071d2a0061d7aa6d7f40b220b78f43132aa2
[wcf] .NET allows for service contract methods to be decorated only by Web{Get,Invoke}Attribute

Usually WCF requires that each service method is marked with the OperationContract attribute with the exception
of methods decorated with the Web{Get,Invoke}Attribute attributes which are defined in System.ServiceModel.Web.
This patch adds a simple way to extend the ContractDescriptionGenerator in order to provide this functionality
without circular dependency of System.ServiceModel on System.ServiceModel.Web. Several extenders can be registered
with the description generator and they will be invoked in the registration order until any of them returns 'true'.
Extenders are passed a reference to the OperationContract attribute with which the current method is decorated - if
the reference is null, the extender should create a default instance of the attribute so that the description generator
considers the method as one to be included in the contract description.
mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs
mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs