2010-01-14 120 views
0

我有一个WCF客户端在不同的项目中调用ASP.NET Web服务。我收到以下错误信息:使用WCF调用ASP.NET Web服务时出现异常

服务器无法处理服务器无法识别的HTTP标头的SOAPAction的http://localhost/IMyWebService/MeMethod

Web服务代码值:

[WebService(Namespace = "http://tempuri.org/")] 
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
[System.ComponentModel.ToolboxItem(false)] 
[System.Web.Script.Services.ScriptService] 
public class MyWebService : System.Web.Services.WebService, IMyWebService 
{ 
    [WebMethod] 
    public string MyMethod() {return "";} 

} 

public interface IMyWebService 
{ 
    string MyMethod(); 
} 

WCF客户端代码:

[ServiceContract] 
public interface IMyWCFService 
{ 
    [OperationContractAttribute(Action = "http://localhost/IMyWebService/MeMethod")] 
    string MyMethod(); 
} 

有谁知道问题是什么。

感谢

回答

0

我不知道如果这是一个错字或没有,但您使用在客户端的动作拼写MeMethod,而在服务方法的拼写的MyMethod。