简体   繁体   English

由于该操作无效或在WCF中无法识别,因此无法处理该消息

[英]The message could not be processed because the action is invalid or unrecognized in WCF

As mentioned in title, I keep getting the exception of 正如标题中所述,我一直都在例外

"The message could not be processed because the action \'http://tempuri.org/MegaService/GetData\' is invalid or unrecognized." “由于操作\\ u0027http://tempuri.org/MegaService/GetData \\ u0027无效或无法识别,因此无法处理该消息。”

Let explain current situation. 让我们解释一下当前情况。

I have two services 1) web service (ASP.NET MVC Web application) and 2) WCF service which is called "MegaService". 我有两个服务1)Web服务(ASP.NET MVC Web应用程序)和2)WCF服务,称为“ MegaService”。 The web service calls functions in the MegaService. Web服务调用MegaService中的函数。 They are both existing services and working fine. 它们既是现有服务,也可以正常工作。

I have added some new functions in the MegaService for new features which are called by the web service. 我为Web服务调用的新功能在MegaService中添加了一些新功能。 Everything is working fine on my local machine (Visual Studio), which means that I can call the functions in the MegaService from the web service and get data out of the call. 在本地计算机(Visual Studio)上一切正常,这意味着我可以从Web服务调用MegaService中的函数,并从调用中获取数据。 I work in Visual Studio. 我在Visual Studio中工作。

To apply those new functions to the server, 1) I have updated reference of MegaService in the web service (in the Visual Studio like when you right click service reference and update reference) 2) Copy all the dll files in the bin directory of my local machine's visual studio project and replace dll files in the server with them. 要将这些新功能应用于服务器,1)我已经更新了Web服务中MegaService的引用(在Visual Studio中,就像您右键单击服务引用并更新引用一样)2)将所有dll文件复制到我的bin目录中本地计算机的Visual Studio项目,并用它们替换服务器中的dll文件。

Here is a problem. 这是个问题。 I can still call the existing (old) functions of MegaService but when I try to call the updated functions in the MegaService, I just end up getting this exception: "The message could not be processed because the action \'http://tempuri.org/MegaService/GetData\' is invalid or unrecognized." 我仍然可以调用MegaService的现有(旧)功能,但是当我尝试调用MegaService中的更新功能时,我最终得到了这个异常:“由于操作\\ u0027http:// tempuri,无法处理该消息。 org / MegaService / GetData \\ u0027无效或无法识别。”

I have already updated service reference and I confirmed that the dll file of service reference is also updated by modified date of the file. 我已经更新了服务参考,并且确认服务参考的dll文件也已通过文件的修改日期进行了更新。 I can still communicate to the MegaService and call existing functions but I can't only call the newly updated functions of the MegaService. 我仍然可以与MegaService通信并调用现有功能,但是我不仅可以调用MegaService的新更新的功能。

Can you guys think of any possible problem and solution, please? 你们能想到任何可能的问题和解决方案吗?

You don't have a code included. 您没有包含代码。 I am not sure if this is work but you can try: 我不确定这是否可行,但是您可以尝试:

Config File: 配置文件:

Under AppSettings 在AppSettings下

 <appSettings>
    <add key="EndPointAddress" value="http://localhost:1920/Service1.svc"/>
  </appSettings>

Under system.serviceModel 在system.serviceModel下

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService1" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:1920/Service1.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
                name="BasicHttpBinding_IService1" />
        </client>
    </system.serviceModel>

Make sure your endpoint address is absolutely right (Server Side). 确保您的终结点地址绝对正确(服务器端)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 接收方无法处理带有动作“”的消息, - The message with Action '' cannot be processed at the receiver, WCF MSMQ 消息处理多次 - WCF MSMQ message processed multiple times WCF 客户端异常:无法识别的消息版本 - WCF client exception: Unrecognized message version 由于EndpointDispatcher的ContractFilter不匹配,因此无法在接收方处理带有动作&#39;&#39;的消息。 - The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. 由于EndpointDispatcher的ContractFilter不匹配,带有Action的消息无法在接收方处理 - The message with Action cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher WCF:没有端点在侦听,可以接受消息 - WCF: There was no endpoint listening at, that could accept the message WCF OperationFormatter遇到无效的消息正文 - WCF OperationFormatter encountered an invalid Message body 自定义消息编码器 WCF - 无效签名 - Custom Message Encoder WCF - invalid signature WCF:无法满足安全令牌请求,因为身份验证失败 - WCF: The request for security token could not be satisfied because authentication failed WCF - “无法满足安全令牌请求,因为身份验证失败” - WCF - “The request for security token could not be satisfied because authentication failed”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM