【问题标题】:Why does WCF endpoint address change every time?为什么 WCF 端点地址每次都会改变?
【发布时间】:2012-05-20 19:10:41
【问题描述】:

我是 WCF 的新手

为什么每次我运行这个服务时它都在不同的地址上运行,而不是在我写的地址上运行?

如果这很简单,我很抱歉:(

<configuration>
  <system.serviceModel>
  <services>
    <service behaviorConfiguration="PBServiceBehavior" name="PhoneBookService.PbService">
      <endpoint name="PbHttpEndpoint" 
          address="http://localhost:9001/PhonebookService" 
          binding="basicHttpBinding"
          contract="PhoneBookService.IPbService" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="PBServiceBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true"  />
      </behavior>
    </serviceBehaviors>
  </behaviors>
     <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>
 <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

【问题讨论】:

    标签: wcf endpoint


    【解决方案1】:

    如果您的 WCF 服务由 IIS 或 Visual Studio 中的内置 Web 服务器 (Cassini) 托管,则您的配置被使用。

    取而代之的是您在 IIS 中定义的虚拟目录*.svc 文件所在的位置),或者内置 Cassini Web 服务器使用的动态定义(并且可能更改)的地址在 Visual Studio 中将确定您的端点地址。

    【讨论】:

      【解决方案2】:

      也许您必须检查此设置

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-05-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多