Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

Operation 'ProcessRequestForMessage' in contract 'IRequestHandler' specifies Method '*' on the WebGetAttribute/WebInvokeAttribute.

$
0
0

Hello,

I have created WCF data service Framework 4.6.1 and EF6. I am getting below error when i try to publish the service. Appreciate your inputs as i am new to this:

Operation 'ProcessRequestForMessage' in contract 'IRequestHandler' specifies Method '*' on the WebGetAttribute/WebInvokeAttribute, but the only allowed values for Method are GET or POST. Other values are not supported by 'System.ServiceModel.Description.WebScriptEnablingBehavior'. 

My code looks like:

[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class MyService : DataService<ObjectContext>
    {

        public static void InitializeService(IDataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.UseVerboseErrors = true;
        }

        protected override ObjectContext CreateDataSource()
        {
            var context = new RegistryContext();
            var objectContext = ((IObjectContextAdapter)context).ObjectContext;
            objectContext.ContextOptions.ProxyCreationEnabled = false;

            return objectContext;
        }
    }

Config file looks like:

<system.serviceModel><services><service name="Services.MyService"><endpoint address="" behaviorConfiguration="Services.MyServiceAspNetAjaxBehavior"
          binding="webHttpBinding" contract="System.Data.Services.IRequestHandler" /></service></services><behaviors><endpointBehaviors><behavior name="Service.MyServiceAspNetAjaxBehavior"><enableWebScript /></behavior></endpointBehaviors><serviceBehaviors><behavior name=""><serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /><serviceDebug includeExceptionDetailInFaults="false" /></behavior></serviceBehaviors></behaviors><protocolMapping><add binding="basicHttpsBinding" scheme="https" /></protocolMapping><serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /></system.serviceModel>

 


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>