recently ,when i was coding a simple enought wf service program.

i found a weird problem by using the Wcf test client tool.

my wcf endpoint is  http://localhost:8000/WFServices

but if i acess this address in my chrome.

i got a message like this.

How to publish metadata for WF service---Weird problem.


The service page has some helpful tips to enable metadata for a WCF service.  Unfortunately the same tips do not apply to a WCF Workflow Service.  In previous releases of WCF you had to apply a service behavior using a named behavior configuration that applied to your service.  In .NET 4.0 or later you do not have to use a named behavior configuration and you don’t have to declare a <service> in your configuration file for more information on this see Simplified Configuration for WCF

Most of the time when creating Workflow Services you will use the default service configuration without declaring a <service> tag in your config file.  Enabling service metadata then is a simple matter of adding the following configuration.

<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="True"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

but there is a trap here . after you finish configuration you service .you must delete the all the files under the Debug folder . and press Ctrl + f5 to make the service work. otherwise you will got the same error too.  囧

相关文章:

  • 2022-12-23
  • 2021-06-09
  • 2022-01-10
  • 2021-09-24
  • 2021-10-13
  • 2021-12-21
  • 2021-07-20
  • 2021-12-31
猜你喜欢
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-03-05
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案