I am working through the book Learning WCF and on the first tutorial lab HelloIndigo I am receiving the following error.
Could not connect to http://localhost:8000/HelloIndigo/HelloIndigoService. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8000.
It appears in the Client project on the line string s = proxy.HelloIndigo();
EndpointAddress ep = new EndpointAddress("http://localhost:8000/HelloIndigo/HelloIndigoService");
IHelloIndigoService proxy = ChannelFactory<IHelloIndigoService>.
CreateChannel(new BasicHttpBinding(), ep);
string s = proxy.HelloIndigo();
Console.WriteLine(s);
Console.WriteLine("Press <ENTER> to terminate Client");
Console.ReadLine();
I have intensively googled on this but I am none the wiser.
Can anyone explain the issue and how to remedy?
It could be several things, first things to check are:
Try puting the endpoint address in a browser and see if you can browse to it.
In Solution Explorer, right-click the solution and select "Properties". On the left, Under "Common Properties", select "Startup Project". On the right, select "Multiple startup projects" - move "Host" to the top and change Action to Start - move "Client" underneath "Host" and change Action to Start. When you click F5 to debug, studio will first start the Host project in a console app, and then it will start the Client project in a separate console app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With