是否可以调用 SharePoint 中 Windows 服务中托管的 WCF 服务?

发布于 2024-08-20 03:27:02 字数 1912 浏览 4 评论 0原文

我有一个 WCF 服务托管在 Windows 服务中,位于我有 moss 的同一服务器中。

WCF 从控制台应用程序调用它效果很好,但如果我从 Sharepoint 内的页面调用它,它会抛出超时异常。

我将以下配置添加到 webconfig:

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IReplication" closeTimeout="00:10:00"
            openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" establishSecurityContext="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8000/Replication/service"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IReplication"
          contract="ServiceReference1.IReplication" name="WSHttpBinding_IReplication">
        <identity>
          <servicePrincipalName value="host/mypc-f1d530f" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>

知道发生了什么吗? 您是否有人成功做到了这一点?我在网上找不到任何示例。

I have a WCF Service hosted in a Windows Service in the same server where i have moss.

The WCF works well calling it from a Console application, but if i call it from a page within Sharepoint, it throws a timed out exception.

I added the following configuration to the webconfig:

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IReplication" closeTimeout="00:10:00"
            openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" establishSecurityContext="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8000/Replication/service"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IReplication"
          contract="ServiceReference1.IReplication" name="WSHttpBinding_IReplication">
        <identity>
          <servicePrincipalName value="host/mypc-f1d530f" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>

Any idea about what is happening?
Do you about anyone has successfully did that? I could not find any sample on the web.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清醇 2024-08-27 03:27:02

您应该尝试禁用环回检查,方法是在 HKLM\System\CurrentControlSet\Control\Lsa 下创建一个名为 DisableLoopbackCheckDWORD 并为其指定一个值1。不要忘记稍后重新启动计算机。

You should try to disable loopback checking, by creating a DWORD named DisableLoopbackCheck under HKLM\System\CurrentControlSet\Control\Lsa and give it a value of 1. Don't forget to restart your computer later.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文