【问题标题】:Hosting WCFweb service in IIS 7.5在 IIS 7.5 中托管 WCFweb 服务
【发布时间】:2011-07-25 08:38:59
【问题描述】:

我正在尝试在 Windows 7 64 位机器上的 IIS 7.5 中托管用 .NET 3.5 编写的 WCF 服务,但运气不佳。我还在机器上安装了 Sharepoint 2010。这是我的设置:

.svc 文件所在文件夹的物理路径为: C:\inetpub\wwwroot\SmartSolution\Services\Services\ContainerManagementService.svc

我在 IIS 中为这两个 Services 文件夹创建了一个 Web 应用程序。

这是 WCF 服务的配置文件:

      <service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior"
    name="MyNamespace.ContainerManagementService">
    <endpoint address="" binding="basicHttpBinding"
       name="ContainerManagementbasicHttpEndpoint" contract="MyNamespace.IContainer"/>                  
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8000/ContainerManagementService" />
      </baseAddresses>
    </host>
  </service>      
   <behaviors>      
    <behavior name="MyNamespace.ContainerManagementServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
</behaviors>

当我尝试浏览到:http://localhost/SmartSolution/Services/Services/ContainerManagementService.svc 时,我收到以下错误:

如果我单击“返回站点”,由于某种原因,我会被带到我的 Sharepoint Central 管理员。如何让 IIS 服务托管工作?

谢谢!

【问题讨论】:

    标签: wcf iis-7 iis-7.5


    【解决方案1】:

    您已在 8000 端口 上公开了该服务,因此您需要在 http://localhost:8000/ContainerManagementService

    调用它

    【讨论】:

    • 港口运气不好。你怎么知道它正在使用的端口是 8000,因为它没有在配置文件中设置?当我转到“8000”网址时,出现“Internet Explorer 无法显示网页”错误。
    • 因为您在 web.config 中将其定义为 8000 端口:&lt;add baseAddress="http://localhost:8000/ContainerManagementService" /&gt;
    • 感谢您的信息。不幸的是,端口 8000 没有运气。删除主机属性后,当我尝试点击:localhost/SmartSolution/Services/Services/…,我得到与上图相同的错误页面。我想知道它是否与共享点相关
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-14
    相关资源
    最近更新 更多