0

Using Visual Studio 2010 / .NET 4.0

I've been at this for hours but I'll try to be specific.

I'm deploying a WCF 4.0 Service to IIS 7. It works fine under http. I can add a service reference from Visual Studio against the WCF service and code against it no problem.

Of course the problem is that the service needs to run under https.

I've managed to manhandle the web.config file so it will run under https (at least I can see the .svc and ?wsdl display in the browser).

But of course IIS is returning the machine name, not the domain name throughout the wsdl.

So when I try to add the service reference I get somehting like this.

The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading 'https://machinename/MyServiceName.svc?xsd=xsd0'. - The remote name could not be resolved: 'machinename'

I know the problem is that IIS is not returning host headers so WCF is guessing and handing back the machine name.

Of course IIS7 won't allow me to add host headers to a site that is using SSL. I've Googled and seen others set host headers with using appcmd something like this

appcmd set site /site.name: /+bindings.[protocol='https',bindingInformation='*:443:']

Tried it and it tells me that the site has been modified

But instead of modifiying the existing SSL binding I get an additional binding that has a host name, but no certificate attached to it. Any attempt to select a SSL through the IIS UI wipes out the hostname. I'm using a wildcard certificate from GoDaddy

1) Anyone see this problem with appcmd? Have any ideas on how to solve. 2) Can I set the domain name in the webconfig. All my attempts to do so to date have produced various IIS Yellow Screens of Death complaining about one parameter or another. I include a copy for your entertainment and suggestions.

<services>
  <service name ="NameThisService" behaviorConfiguration="TheDefaultBehaviour">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="webBinding" contract="IService" >
    </endpoint>


  </service>
</services>

<bindings>
  <wsHttpBinding>
    <binding name="webBinding">
      <security mode="Transport">
        <transport clientCredentialType="None"/>
      </security>
    </binding>
  </wsHttpBinding>
</bindings >


<behaviors>
  <serviceBehaviors>
    <behavior name="TheDefaultBehaviour">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpsGetEnabled="true" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>

    </behavior>
  </serviceBehaviors>
</behaviors>




<serviceHostingEnvironment multipleSiteBindingsEnabled="false"/>

Help Me
  • 1
  • 1

1 Answers1

0

If the command line doesn't work you CAN do it in the UI. You will need to play around with the Friendly name of the certificate. Link below.

http://blog.armgasys.com/?p=80

Help Me
  • 1
  • 1