.net – Publishing WCF .NET 3.5 to IIS 6 (Windows Server 2003)

iis-6iis-7netwcf

I've been developing a WCF web service using .NET 3.5 with IIS7 and it works perfectly on my local computer. I tried publishing it to a server running IIS 6 and even though I can view the WSDL in my browser, the client application doesn't seem to be connecting to it correctly. I launched a packet sniffing app (Charles Proxy) and the response for the first message comes back to the client empty (0 bytes). Every message after the first one times out.

The WCF service is part of a larger application that uses ASP .NET 3.5. That application has been working fine on IIS 6 for awhile now so I think it's something specific to WCF. I also tried throwing an exception in the SVC file to see if it made it that far and the exception never got thrown so I have a feeling it's something more low level that's not working.

Any thoughts? Is there anything I need to install on the IIS5 server? If so how am I still able to view the WSDL in my browser?

The service is being consumed via an SVC file using basicHttpBinding

Here's the meat of the Web.Config (let me know if you need any other part of it):

<system.net>
  <defaultProxy>
    <proxy usesystemdefault="False" proxyaddress="http://127.0.0.1:80" bypassonlocal="True"/>
  </defaultProxy>
</system.net>

<system.serviceModel>
  <services>
    <service name="Nexternal.Service.XMLTools.VNService" behaviorConfiguration="VNServiceBehavior">
      <!--The first endpoint would be picked up from the confirg
      this shows how the config can be overriden with the service host-->
      <endpoint address="" binding="basicHttpBinding" contract="Nexternal.Service.XMLTools.IVNService" />
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" name="mexHttpBinding" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="VNServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>

Best Answer

I host WCF services in IIS 5.1 and 6 all the time. There is nothing special about it outside of having .Net 3.0+ installed on the server, which I see you have based on the ASP.NET 3.5 comment above.

Are you hosting the service in a .svc file? If you could provide some additional information, I'm sure this issue could be resolved quickly. How are you hosting the WCF Service? What does your endpoint / behaviors look like in your config file? What type of Binding are you using? Remember you can only host http bindings in IIS 6 and lower. Using IIS 7 allow you to use WAS which allow you to use non-http bindings for your services.

Considering that you can see your wsdl, I would say your MEX endpoint is working, but your other Endpoint is not.

Related Topic