none
WCF with SSL- not finding localhost RRS feed

  • Question

  • Hi guys,

    I'm trying to get WCF to use SSL with ANYTHING for FIVE DAYS now. I've gone through countless walkthroughs, generated more certificates than a mail order diploma company, even tried hot fixes. After working with MS dev tools since VB1, I am now considering flipping burgers as a career option. WCF, as far as I can see, is a complete lemon.

    Anyway, to get to my actual question: If I run through this walkthrough:

    http://msdn.microsoft.com/en-us/library/ff648840.aspx

    I get to step 11 (adding the service reference) and get "There was an error downloading metadata from the address. Please verify that you have entered a valid address".

    Details of the error gives: There was an error downloading 'https://localhost/SSL6/Service.svc'. Unable to connect to the remote server No connection could be made because the target machine actively refused it 127.0.0.1:443

    I'm using VS2008 on Windows 7 with IIS7. I followed the walkthrough exactly (apart from step 5 which was different on IIS7- I went into "SSL Settings" for the VD), so it shows my config (yes I've used httpsGetEnabled and mexHttpsBinding).

    Anyone care to save my sanity and job?

    Thursday, May 20, 2010 5:30 AM

Answers

  • Finally cracked it. There were at least three issues at play.

    1) A DNS issue of some kind with localhost. It's still unresolved on my machine, but I can work around it by using the IP addy.

    2) Another issue may have been that apparently, WCF doesn't work with IIS 7 OOTB. So you need to run command prompt as administrator, and run the following command -

    "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

    3) After I got through the certificate stuff I was still getting HTTP error 503, "Service unavailable". That ended up being leftovers from my previous attempts, still listening to ports:

    http://blogs.msdn.com/webtopics/archive/2010/02/17/a-not-so-common-root-cause-for-503-service-unavailable.aspx

    So to get a hello world level service happening with WCF and SSL took me a whole week, and in my travels I discovered many pilgrims who had taken about the same amount of time. MS:FAIL.

    • Marked as answer by kalorvoe Wednesday, June 2, 2010 5:57 AM
    Friday, May 21, 2010 1:56 AM
  • Hi,

      Can you please visit the following link:

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=487

     

    Regards

     

    MAhesh Sabnis

    Friday, May 21, 2010 11:33 AM

All replies

  • Hi,

       Please check your URL is Valid or not.

    I got the same eorror  servral times.

    first,You make sure you start the host .

    second, you make sure using the correct URL.

     

    in your case, please check your service URL through  Browser in IIS Manegement.

    You browser your svc file, then IE will show a URL, Just test it in IE,to make sure  you can see the WSDL.

     


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【中文论坛】:微软WCF中文技术论坛
    【英文论坛】:微软WCF英文技术论坛

    Thursday, May 20, 2010 7:22 AM
  • If I go into IIS, select the VD in content view, right-click on the svc file and browse, I get "Internet Explorer cannot display the webpage". Chrome gives "Google Chrome could not connect to localhost".

     

    IE troubleshooting gives "the remote device or resource won't accept the connection".

     

    If I browse using the IP address rather than using localhost via http, it says that it's secured with https ok. If I browse using the IP and https, I get HTTP error 503. The service is unavailable.

    So it looks to me like a DNS issue combined with... something. The URL seems ok. What do you mean by "start the host"? IIS6 had a start/stop, but IIS7 is incomprehensible. Do you mean run the service web site project? When I try to do that I get "Unable to start debugging on the web server. Unable to connect to the web server. Verify that the web server is running and that incoming HTTP requests are not blocked by a firewall".

     

    Thursday, May 20, 2010 10:31 PM
  • Finally cracked it. There were at least three issues at play.

    1) A DNS issue of some kind with localhost. It's still unresolved on my machine, but I can work around it by using the IP addy.

    2) Another issue may have been that apparently, WCF doesn't work with IIS 7 OOTB. So you need to run command prompt as administrator, and run the following command -

    "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

    3) After I got through the certificate stuff I was still getting HTTP error 503, "Service unavailable". That ended up being leftovers from my previous attempts, still listening to ports:

    http://blogs.msdn.com/webtopics/archive/2010/02/17/a-not-so-common-root-cause-for-503-service-unavailable.aspx

    So to get a hello world level service happening with WCF and SSL took me a whole week, and in my travels I discovered many pilgrims who had taken about the same amount of time. MS:FAIL.

    • Marked as answer by kalorvoe Wednesday, June 2, 2010 5:57 AM
    Friday, May 21, 2010 1:56 AM
  • Hi,

      Can you please visit the following link:

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=487

     

    Regards

     

    MAhesh Sabnis

    Friday, May 21, 2010 11:33 AM