【问题标题】:Howto: WCF service external to solution (not domain!) with AutoCompleteExtender操作方法:使用 AutoCompleteExtender 解决方案(不是域!)外部的 WCF 服务
【发布时间】:2012-01-31 00:21:21
【问题描述】:

我编写了一个 WCF 服务,该服务在我希望在其中使用的解决方案之外。我这样做是为了拥有一项可在许多解决方案中重复使用的服务。我们已经多次将此服务复制为解决方案的 asmx 组成部分,这不是一个好的维护方案。我终于有时间以正确的方式解决这个问题。任何帮助将不胜感激!我看到的所有关于此的帖子都让我陷入困境。我的解决方案(和服务)在 VS2010、Framework 4.0、vb.net 中。

当在端点中使用 webHttpBinding 绑定时,当我将服务添加到我的解决方案时,会添加引用,但 web.config 没有与所需的 system.serviceModel 配置组一起添加。我能找到的所有文章都在谈论将服务作为解决方案的一部分,但这是我试图避免的。

有什么想法吗?这是我的服务 web.config 的 system.serviceModel 部分:

<system.serviceModel>
<behaviors>

  <endpointBehaviors>
    <behavior name="AspNetAjaxBehavior">
      <enableWebScript/>
    </behavior>
  </endpointBehaviors>

  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>

</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

<services>
  <service name="Com.mydomain.Services.WCF_ACE.ACE">
    <endpoint address=""
              behaviorConfiguration="AspNetAjaxBehavior"
              binding="webHttpBinding"
              contract="Com.mydomain.Services.WCF_ACE.I_ACE" />
          </service>
</services>

【问题讨论】:

  • AutoCompleteExtender 与您的 wcf 服务问题有什么关系?

标签: vb.net wcf visual-studio-2010 frameworks


【解决方案1】:

所以您正在尝试使用您构建的 wcf 服务。附加的配置文件中似乎缺少客户端部分。

客户端配置总是与服务配置不同。您可以手动将其添加到客户端解决方案中。

【讨论】:

  • 据我所见,在添加服务引用时,客户端配置已添加到使用服务的解决方案中的 web.config 中。这没有发生,我无法找到关于如何手动定义它的好文档。我宁愿让 VS 做它应该做的事情。我看到的所有使用 AutoCompleteExtender 的帖子都谈到本地 asmx 或本地启用 ajax 的服务作为解决方案的一部分。我希望服务在解决方案之外。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-12
  • 1970-01-01
  • 2014-08-24
  • 2014-02-21
  • 2013-02-12
  • 2011-03-21
相关资源
最近更新 更多