首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在wcf Get方法中找不到终结点,但在Post方法中正常

在wcf Get方法中找不到终结点,但在Post方法中正常
EN

Stack Overflow用户
提问于 2017-05-28 18:32:56
回答 1查看 127关注 0票数 0

我有wcf rest服务。

我编写了POST方法和GET方法。这两个方法在几天前都工作得很好,但是突然之间,Post工作得很好,但是所有的Get方法都返回"Endpoint not found“。我已经检查了几百万次的网址模板,但它都是好的。下面是我的代码:

代码语言:javascript
运行
复制
    [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);
EN

回答 1

Stack Overflow用户

发布于 2017-05-28 20:42:24

抱歉,我搞错了。我请求了错误的url tempalte。我发送了GetGeoLocation?fullAddress=NY,但我应该发送GetGeoLocation/NY

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44226294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档