【问题标题】:Unable to get wsdl from service with multiple bindings hosted in IIS无法从 IIS 中托管的多个绑定的服务中获取 wsdl
【发布时间】:2013-04-19 07:14:15
【问题描述】:

我有一个托管在 IIS7.5 中的 WCF 4.5 服务。 该服务对 Net 3.5+ 客户端使用 netTcpBinding,对 Silverlight 5 客户端使用 basicHttpBinding。此绑定上的地址是特定的 (address="SL")。 ServiceMetadata "httpGetEnabled" 设置为 true。 现在我想从 BIRT 使用这个服务,所以我试图获取一个 wsdl 文件。 我不知道要使用哪个 URL,因为 IIS 拒绝了请求。

以下是配置文件中有趣的部分:

<system.serviceModel>
<serviceHostingEnvironment>
  <serviceActivations>
    <add factory="My.CustomServiceHostFactory" relativeAddress="~/My.AdminService.svc" service="My.AdminService" />
  </serviceActivations>
</serviceHostingEnvironment>
<services>
  <service name="My.AdminService">
    <endpoint address="SL" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_SL"
     name="BasicHttpBinding_IAcadmin" contract="My.AdminService.IAcadmin" />
    <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
     contract="My.AdminService.IAcadmin">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
     contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

服务发布在以下网址:

http://localhost/My.AdminService

现在,如果我理解正确的话,WSDL 地址应该是:

http://localhost/My.AdminService/My.AdminService.svc/SL/?wsdl

此 URL 被 IIS 拒绝并出现 404 错误。

这似乎是 IIS 问题而不是 WCF 问题。无论如何,我使用的是正确的 URL 吗?

任何帮助表示赞赏。

【问题讨论】:

    标签: wcf iis wsdl


    【解决方案1】:

    你试过http://localhost/My.AdminService/SL 吗?这个文件夹存在吗?如果你把纯 html 放在那里 - 你可以在浏览器中打开它吗?

    【讨论】:

    • 是的,我试过了,返回错误 404.0。该文件夹不存在。如果我创建它并将文件放入其中,我可以在浏览器中打开它。请注意,对 localhost/My.AdminService/My.AdminService.svc 的 WCF 调用将成功。
    • @omatrot:你有没有发现问题出在哪里?我有同样的问题
    • @David:不幸的是,没有。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-31
    • 1970-01-01
    • 2015-01-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多