简体   繁体   English

在wcf Get方法中找不到端点,但在Post方法中确定端点

[英]Endpoint not found in wcf Get Method but OK in Post methods

I have wcf rest service. 我有休息服务。

I wrote POST methods and GET method. 我写了POST方法和GET方法。 both worked fine until couple of days, but suddenly the Post works fine but all of Get methods return "Endpoint not found". 两种方法都可以正常工作直到几天,但是突然Post可以正常工作,但是所有Get方法都返回“ Endpoint not found”。 I've checked milions of times the Url template but it's all OK. 我已经检查了数百万次的Url模板,但都没问题。 here is my code: 这是我的代码:

    [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);

Sorry, my mistake. 抱歉,是我的错。 I requested with wrong url tempalte. 我要求使用错误的网址模板。 I sent GetGeoLocation?fullAddress=NY but I should send GetGeoLocation/NY 我发送了GetGeoLocation?fullAddress = NY,但我应该发送GetGeoLocation / NY

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM