none
WCF service error on my localhost RRS feed

  • Question

  • when I am running on my WCF service on my localhost,It throws the following error.

     

    Could not connect to http://localhost:1583/MyWCF/Service.svc. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:1583.

     

     

    I can't define clearly whats my wrong,as I am an new entrant to WCF.

     

    SP.Murugesa Pandian.

     

    Saturday, August 16, 2008 5:15 PM

Answers

  • Hi Murugesa,

    You are having a ".svc" file which means that you are hosting it in IIS (on IIS 6.0 or IIS 7.0). And when you host it in IIS the service's web.config file should look something like below:

     

    <system.serviceModel>

    <services>

    <service name="CalculatorService.Calculator">

    <endpoint

    address=""

    binding="wsHttpBinding"

    contract="CalculatorService.ICalculator" />

    </service>

    </services>

    </system.serviceModel>

     

    And the base address would be the same as what is hosted in IIS. It would map to the virtual directory where the svc file is located. Something like http://localhost/virtual_directory/Service.svc. Open IIS using Start -> Run -> inetmgr and right click the svc file and check by browsing if you are able to access and view it in browser. If yes, you should be able to view it even in browser.

     

    The svc file would have the class name where service is implemented.

     

    <%@ServiceHost

    Service="CalculatorService.Calculator" %>

     

    -Phani

    Sunday, August 17, 2008 10:56 AM

All replies

  • Hi SP.

     

    How are you hosting your service? via IIS or self-hosting?

     

    An

     

    Saturday, August 16, 2008 6:48 PM
  • Hi Murugesa,

    You are having a ".svc" file which means that you are hosting it in IIS (on IIS 6.0 or IIS 7.0). And when you host it in IIS the service's web.config file should look something like below:

     

    <system.serviceModel>

    <services>

    <service name="CalculatorService.Calculator">

    <endpoint

    address=""

    binding="wsHttpBinding"

    contract="CalculatorService.ICalculator" />

    </service>

    </services>

    </system.serviceModel>

     

    And the base address would be the same as what is hosted in IIS. It would map to the virtual directory where the svc file is located. Something like http://localhost/virtual_directory/Service.svc. Open IIS using Start -> Run -> inetmgr and right click the svc file and check by browsing if you are able to access and view it in browser. If yes, you should be able to view it even in browser.

     

    The svc file would have the class name where service is implemented.

     

    <%@ServiceHost

    Service="CalculatorService.Calculator" %>

     

    -Phani

    Sunday, August 17, 2008 10:56 AM