Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Help moving a WCF web service on IIS6 from http to https

Posted on 2011-03-18
4
689 Views
Last Modified: 2012-05-11
In the past, I've create asmx web services. Now I've created my first web service in WCF, really by following a cookbook example. It deploys and runs fine on IIS6 under http. I'm running into problems moving it to https, though.

Asmx web services neither knew nor cared whether they were connected to via http or https - they weren't concerned with transport at all. All I had to do was install a cert in IIS, configure the SSL port, and I was in business.

WCF has lots of STUFF, like bindings, contracts, transport configurations, etc. No doubt after studying books and internet articles for a few weeks I could probably figure it out - the problem is I need to get running NOW!

There are actually two problems. One is the general problem that it won't work under SSL without correct configuration. The other is that the URL and Cert name is different from the server machine name, and if I browse to the service to try to obtain the WSDL, it returns a link to the machine name, not the proper URL.

Could someone help me to try to get this running under http? Greatly appreciate it.

Here's my current Web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
    </compilation>
  </system.web>
      <system.serviceModel>
            <behaviors>
                  <serviceBehaviors>
                        <behavior>
                              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                              <serviceMetadata httpGetEnabled="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
      aspNetCompatibilityEnabled="true"
      multipleSiteBindingsEnabled="true"
      />
      </system.serviceModel>
      <system.webServer>
            <modules runAllManagedModulesForAllRequests="true" />
      </system.webServer>
</configuration>


0
Comment
Question by:psyche6
  • 3
4 Comments
 
LVL 15

Expert Comment

by:pcsmitpra
ID: 35178969
The other is that the URL and Cert name is different from the server machine name,
>>>> You need to get a Correct CERT with Correct domain name on it, Otherwise you will remain getting errors.

Is WCF working good without SSL ? Have you registered .svc extension manually . (How To)
You can get it working with SSL but first need to make its working fine without SSL, You can see here to see how to get it over the SSL

Cheers
0
 
LVL 1

Author Comment

by:psyche6
ID: 35193091
Re: pcsmitpra.

Please READ questions before answering! Is WCS working good without SSL? Go back and read: "It deploys and runs fine on IIS6 under http".

Your other link refers to working with SSL accelerators (if you don't know what they are, follow your own link!), and has nothing to do with my question.

Can I award NEGATIVE points?
0
 
LVL 1

Accepted Solution

by:
psyche6 earned 0 total points
ID: 35203589
I had to have it working now, so I paid for a Microsoft Support call. I sent him my Web.config file; he tweaked it and send it back:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
    </compilation>
    <identity impersonate="true"/>
  </system.web>
  <system.serviceModel>
    <!-- Region added for Https Support -->
    <bindings>
      <basicHttpBinding>
        <binding name="basicBindingConf">
          <security mode ="Transport">
            <transport clientCredentialType="None"></transport>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="behavior" name="Psychemedics.SampleCollection">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicBindingConf"
          name="basicEndPoint" contract="Psychemedics.ISampleCollection" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <!-- Region added for Https Support -->
    <behaviors>
      <serviceBehaviors>
        <behavior name="behavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="false" 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 aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
</configuration>

It works - note that it's set up for https only, not both http and https. It also fixed the URL problem - when I browse to the service, it returns a correct URL link to the wsdl - not a link using the machine name rather than the correct certificate URL as it was doing before.

I actually almost understand all this ...

0
 
LVL 1

Author Closing Comment

by:psyche6
ID: 35230149
Didn't get an answer here - am posting paid Microsoft solution.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Schannel Error in Event Viewer 3 59
Hide http port number 5 51
page view and f5 big ip 4 16
FTP server backups 5 8
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question