【发布时间】:2019-05-12 10:54:05
【问题描述】:
这个问题我快疯了: 我写了这段代码:
[ServiceContract]
public interface Idata
{
[WebInvoke(Method = "POST", UriTemplate = "getwinelist", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List<Wine> GetWineList();
}
在我的 web.config 文件中,我有这个:
<services>
<service name="WineFid.data">
<endpoint binding="webHttpBinding" contract="WineFid.Idata" behaviorConfiguration="webBehaviour" />
</service>
</services>
我的行为:
<endpointBehaviors>
<behavior name="webBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
如果我指向https://host.mydomain.net/main.svc,它会完美运行并向我展示经典的 Microsoft Web 服务页面,但是当我指向方法时:
https://host.mydomain.net/main.svc/getwinelist
服务器响应“404 resource not found....” 我的错误在哪里? 请注意,该服务托管在 Azure 上
提前致谢!
【问题讨论】:
标签: asp.net azure web-services wcf