2010-01-14 89 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。