views:

76

answers:

1

I have a WCF client which calls an ASP.NET web service in a different project. I get the following error message:

System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction http://localhost/IMyWebService/MeMethod

Web Service code:

[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 client code:

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

Does anyone know what the problem is.

Thanks

A: 

I'm not sure if this is a typo or not, but the action you are using in the client is spelt MeMethod, while the method on the service is spelt MyMethod.

Kragen