2014-03-19 59 views
0

我有服务“默认”页面的问题。像往常一样,我已经创建了服务,并且无法使其工作。WCF服务页面不出现,但帮助页面工作

默认服务页面不显示。它显示:

未找到端点。请参阅服务帮助页面以构建对服务的有效请求。

当我点击帮助页面链接时,显示列出操作的普通帮助页面。

我的配置有什么问题?

这里是我的web.config文件:

<?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> 
+0

有你贴的ServiceContract和OperationContract特性在接口上服务 ? – Max

+0

您是否试过使用[WCF Test Client](http://msdn.microsoft.com/zh-cn/library/bb552364(v = vs.110).aspx)访问您的服务? 转至:“c:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ Common7 \ IDE \ WcfTestClient.exe”(将路径更改为您自己的版本) –

回答

0

我已经加入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>