WCF服务未在休息状态下工作

WCF服务未在休息状态下工作,wcf,sharepoint,sharepoint-2010,Wcf,Sharepoint,Sharepoint 2010,我正在尝试在sharepoint上创建自定义wcf服务。 不幸的是,该服务在WCF测试客户端上运行良好,但当我试图通过web/浏览器访问它时,它给了我空屏幕或空响应结果 请有人帮我,谢谢你 接口 方法 Web.config文件 您可以考虑将配置文件更改为如下内容: <configuration> <system.serviceModel> <services> <service name="WcfJsonRestSe

我正在尝试在sharepoint上创建自定义wcf服务。 不幸的是,该服务在WCF测试客户端上运行良好,但当我试图通过web/浏览器访问它时,它给了我空屏幕或空响应结果

请有人帮我,谢谢你

接口 方法 Web.config文件


您可以考虑将配置文件更改为如下内容:

    <configuration>
  <system.serviceModel>
    <services>
      <service name="WcfJsonRestService.Service1">
        <endpoint address="http://localhost:8732/service1" 
                  binding="webHttpBinding" 
                  contract="WcfJsonRestService.IService1"/>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior>
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

您的界面和实现符合您的目标。您是否对服务端点使用WebHttpBinding?
    public string GetAllB(int val)
    {
        return "Enterted Value is this" + val;
    }
    <behaviors>
    <serviceBehaviors>
    <behavior  name="Kuservice.Service1ServiceBehavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deploying the solution. -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deploying the solution to avoid disclosing exception information. -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>     
   </serviceBehaviors>

  <endpointBehaviors>
  <behavior name="web">
      <webHttp/>
    </behavior>
  </endpointBehaviors>


</behaviors>
    <configuration>
  <system.serviceModel>
    <services>
      <service name="WcfJsonRestService.Service1">
        <endpoint address="http://localhost:8732/service1" 
                  binding="webHttpBinding" 
                  contract="WcfJsonRestService.IService1"/>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior>
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>