WCF and IIS 6 - WSDL Unaffected

I developed an ASP.NET application that includes a WCF service. This service must be consumed by third-party applications. This service worked great when testing in my development environment. My development environment uses IIS 7.0 on Window 7 RC 1. However, I cannot use this service when it is in my staging / production environment. My staging / production environment is Windows Server 2003, IIS 6.

When I try to refer to a service when it is in IIS 6, I get an error:

Error: Unable to get metadata ...

Interestingly, I noticed a subtle, but I find important, difference in my testing of an intermediate / production environment.

In my test environment, I noticed that I can access the service page through a URL with the following pattern:

http: //localhost/MyApp/services/myService.svc

I also noticed that in my test environment, I can see the WSDL information if I visit the URL with the following pattern:

http: //localhost/MyApp/services/myService.svc? wsdl

However, in my staging / production environment, I do not see the WSDL information. Oddly enough, I see the service page.

Here are the configuration settings related to my services in my production environment.

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="myServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
  </behaviors>

  <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
  <services>
    <service behaviorConfiguration="myServiceBehavior" name="myService">
      <endpoint address="" binding="basicHttpBinding" contract="myService" />
      <endpoint address="mex" binding="mexHttpBinding" 
        contract="IMetadataExchange" />
    </service>
  </services>
</system.serviceModel>

Why do I need to see the service page, but not the WSDL page in Windows Server 2003 IIS 6.0?

Thanks!

+3
source share
2 answers

, MSDN :

( MSDN)

+1

?

    <serviceMetadata httpGetEnabled = "true"/>

    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
      name="mexendpoint" contract="IMetadataExchange" />
+2

Source: https://habr.com/ru/post/1714300/


All Articles