找不到SharePoint Server WCF服务 [英] SharePoint Server WCF service not found

查看:89
本文介绍了找不到SharePoint Server WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了以下服务以用于SharePoint 2013服务器场:

I have created the following service to be used on a SharePoint 2013 Farm:

VersionHistoryService.svc:

VersionHistoryService.svc :

<%@ ServiceHost语言="C#" Debug ="true"
    Service =" Corp_WebServices.VersionHistoryService,$ SharePoint.Project.AssemblyFullName $"
    CodeBehind =""VersionHistoryService.svc.cs"
    Factory ="Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory,Microsoft.SharePoint.Client.ServerRuntime,版本= 15.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c". %>

<%@ ServiceHost Language="C#" Debug="true"
    Service="Corp_WebServices.VersionHistoryService, $SharePoint.Project.AssemblyFullName$"
    CodeBehind="VersionHistoryService.svc.cs"
    Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

VersionHistoryService.svc.cs:

VersionHistoryService.svc.cs :

   [BasicHttpBindingServiceMetadataExchangeEndpoint]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
   公共类VersionHistoryService:IVersionHistoryService
    {
      公共Stream GetVersionHistory(字符串listID,字符串viewID,字符串itemsID)

    [BasicHttpBindingServiceMetadataExchangeEndpoint]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class VersionHistoryService : IVersionHistoryService
    {
        public Stream GetVersionHistory(string listID, string viewID, string itemsID)

IVersionHistoryService.cs:

IVersionHistoryService.cs :

  [ServiceContract]
   公共接口IVersionHistoryService
    {
       [OperationContract]
       [WebGet(UriTemplate =" GetVersionHistory/{listID}/{viewID}/{itemsID}"))]
      流GetVersionHistory(字符串listID,字符串viewID,字符串itemsID);

  [ServiceContract]
    public interface IVersionHistoryService
    {
        [OperationContract]
        [WebGet(UriTemplate = "GetVersionHistory/{listID}/{viewID}/{itemsID}")]
        Stream GetVersionHistory(string listID, string viewID, string itemsID);

当我调用网址"http://<服务器名称>/_ vti_bin/Corp/VersionHistoryService.svc/mex"时,我收到带有服务信息的xml返回信息,但是,如果我调用该服务:"http://<服务器名称>/__ vti_bin/Corp/VersionHistoryService.svc/GetVersionHistoryFile/{0D11568C-09D9-4018-80BF-211ED8EBCDC5}/null/null" 我什么也没得到.

When i call the url "http://<Servername>/_vti_bin/Corp/VersionHistoryService.svc/mex" i get an xml return with the service info, however if i call the service : "http://<Servername>/_vti_bin/Corp/VersionHistoryService.svc/GetVersionHistoryFile/{0D11568C-09D9-4018-80BF-211ED8EBCDC5}/null/null" I get nothing.

我不确定自己缺少什么.

Im not sure what im missing.

任何人都可以帮忙吗?

瑞佩斯

推荐答案

在您的代码UriTemplate中,我没有找到名为GetVersionHistoryFile的方法,而只有GetVersionHistory,所以我认为端点URL会在下面L

In your code, UriTemplate, I didn't found a method named GetVersionHistoryFile but only GetVersionHistory, so I think the endpoint url would like belowL

"http://<Servername>/_vti_bin/Corp/VersionHistoryService.svc/GetVersionHistory/{listID}/{viewID}/{itemsID}

以下是在SharePoint中构建自定义WCF服务的示例,供您参考:

And here is a sample to build custom WCF Service in SharePoint for your reference:

SharePoint 2013: Create a Custom WCF REST Service Hosted in SharePoint and Deployed in a WSP

谢谢

最好的问候


这篇关于找不到SharePoint Server WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆