Hi, i just started working with wcf and maybe this is really stupid
question, but I haven't found any solution anywhere. I have simple
console server application. i.e.:
ServiceHost host = new ServiceHost(typeof(SomeNamespace.Service));
Uri address = new Uri(@"http://localhost:8080");
host.AddServiceEndpoint(typeof(SomeNamespace.IService), new WSHttpBinding(), address);
...and my question is: can I somehow access the instance of the service
SomeNamespace.Service ? I can acces this instance through
OperationContract from client app, but is there some way to access it
directly?
Thank you !
Loading
soumen dePosted Jun 2, 2009, 5:37 AM
Uri address = new Uri(@"http://localhost:8080");
Look @ the Uri you are using. When you create a WCF Service, u must deply it somewhere. and u should have a url for that, just check whethe the url is accesible from your server or not, if yes, then u should be able to invike the Service. But obviously localhost is not the way to call, it should have a machine name or IP atleast like
ServiceHost host = new ServiceHost(typeof(SomeNamespace.Service));
Uri address = new Uri(@"http://ABSCD-MyMachine:8080");
Soumen, India