我有两个WCF服务Exchange1.svc和Exchange2.svc都设置为RESTful JSON consummables。 Exchange1.svc工作正常,但是当我尝试发布到Exchange2.svc时,我收到了找不到Endpoint消息。WCF RESTFul服务 - 404端点未找到2服务
我在做什么错?
我IExchange2接口:
[ServiceContract]
public interface IExchange2
{
[System.ServiceModel.OperationContract(Name = "InsertReading")]
[WebInvoke(UriTemplate = "/InsertReading?memberID={memberID}", Method = "POST", ResponseFormat = WebMessageFormat.Json)]
void InsertReading(string memberID);
}
我试图打的网址是:http://localhost:49701/Exchange2.svc/DiaInsertReading?memberID=6519548
我的配置是:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="MyNamespace.Exchange1Behavior">
<webHttp/>
</behavior>
<behavior name="MyNamespace.Exchange2Behavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="MyNamespace.Exchange1">
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="MyNamespace.Exchange1Behavior" contract="MyNamespace.IExchange1" />
</service>
<service name="MyNamespace.Exchange2">
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="MyNamespace.Exchange2Behavior" contract="MyNamespace.IExchange2" />
</service></services></system.serviceModel>
只是错过了我原来的帖子中更新的URL的一部分... – AshesToAshes 2012-04-09 10:50:20