本文介绍了无法加载“ProcessRequestForMessage”操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个引用visual studio生成的model.edmx的WCF 4.0服务

I have a WCF 4.0 Service referencing a model.edmx generated by visual studio

 公共类myService:DataService< Model.myEntities>

    {
$


        public static void InitializeService(DataServiceConfiguration config)

        {

            config.SetEntitySetAccessRule(" *",EntitySetRights.All);

            config.SetServiceOperationAccessRule(" *",ServiceOperationRights.All);

            config.UseVerboseErrors = true;   



        }

  public class myService : DataService<Model.myEntities>
    {

        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
            config.UseVerboseErrors = true;   

        }

}

尝试浏览时出现以下错误。 是否有我需要注意的配置设置?

And get the following error while trying to browse it.  Are there any config settings that I need to be aware of?

无法加载"ProcessRequestForMessage"操作,因为它有一个参数或返回类型为System.ServiceModel.Channels.Message的类型或具有MessageContractAttribute的类型以及不同类型的其他参数。当使用System.ServiceModel.Channels.Message
或带有MessageContractAttribute的类型时,该方法不得使用任何其他类型的参数。

The operation 'ProcessRequestForMessage' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When using System.ServiceModel.Channels.Message or types with MessageContractAttribute, the method must not use any other types of parameters.

推荐答案

您通过哪种方式展示此类服务?当您使用某种非REST友好的绑定或契约时,通常会抛出此异常。告诉我们,,,

Which kind of binding are you exposing such service through? this exceptions is usually thrown when you are using some kind of either binding or contract that is not REST-friendly. let us know,,,

问候,


这篇关于无法加载“ProcessRequestForMessage”操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 00:08