在wcf Get Method中找不到端点但在Post方法中找不到

时间:2017-05-28 10:32:56

标签: c# wcf restful-url

我有wcf休息服务。

我写了POST方法和GET方法。 两者都工作正常,直到几天,但突然邮报工作正常,但所有的Get方法返回" Endpoint not found"。 我已经检查了数百万次Url模板,但一切都好。 这是我的代码:

    [OperationContract]
    [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json,ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "AddActivities")]
    AddActivitiesResponse AddActivities(List<Activity> activities);

    [OperationContract]
    [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "GetGeoLocation/{fullAddress}/{account}")]
    GetGeoLocationResponse GetGeoLocation(string fullAddress, string account);

1 个答案:

答案 0 :(得分:0)

抱歉,我的错误。我要求错误的网址tempalte。 我发送了GetGeoLocation?fullAddress = NY 但我应该发送GetGeoLocation / NY