0

I have the app, where already there is the service.

ServiceHost serviceHost = null;
serviceHost = new ServiceHost(typeof(*.*.*.*.com.MapViewPortTypeClient), new Uri(uri));

Can i create another instance of ServiceHost in this application, for example:

ServiceHost serviceHostKW = null;
serviceHostKW = new ServiceHost(typeof(*.*.*.*.com.ClientKW), new Uri(uriKW));

So after this it will be 2 services (servers) in this app. Will I have any problems?

novicegis
  • 519
  • 3
  • 5
  • 13
  • 1
    You will have no problems. There was similar question http://stackoverflow.com/questions/54419/how-to-host-2-wcf-services-in-1-windows-service/77401 – Redwan Oct 22 '13 at 09:25
  • you can have n-numer of service calls. – Jay Oct 22 '13 at 09:26

2 Answers2

1

Yes you can create as many ServiceHost instances, as you want.. but obviously url:port should be different

Arsen Mkrtchyan
  • 49,896
  • 32
  • 148
  • 184
0

Yes!! You can Host Multiple services in one solution with multiple endpoints and hosting. Go through this Link http://dotnetmentors.com/multiple-wcf-services-in-one-solution-with-multiple-endpoints-and-hosting.aspx hope it will be helpful.

Ajit Kumar
  • 534
  • 3
  • 8