WCF服务页面没有出现,但帮助页面可以工作
本文关键字:帮助 工作 服务 WCF | 更新日期: 2023-09-27 17:50:56
我的服务"default"页面有问题。我已经创建了一个服务,像往常一样,不能让它工作。
默认服务页面未显示。它表明:
未找到端点。关于构造对服务的有效请求,请参阅服务帮助页面。
当我点击帮助页面链接时,显示了列出操作的正常帮助页面。
我的配置有什么问题?
这是我的网。配置文件:
<?xml version="1.0"?>
<configuration>
<appSettings />
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime />
</system.web>
<system.serviceModel>
<services>
<service name="PromoCenyParseService.PromoCenyParseService"
behaviorConfiguration="ServiceBehavior">
<endpoint address="http://xxxxxxx.ovh.net:7741/PromoCenyParseService.svc"
binding="webHttpBinding"
contract="PromoCenyParseService.IPromoCenyParseService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior>
<webHttp helpEnabled="true" />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
我已经解决了这个问题,通过添加baseAddress到我的服务,像这样:
<service name="PromoCenyParseService.PromoCenyParseService"
behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://xxxxxxx.ovh.net:7741/PromoCenyParseService.svc"/>
</baseAddresses>
</host>
<endpoint address=""
binding="webHttpBinding"
contract="PromoCenyParseService.IPromoCenyParseService" />
</service>