I have one solution in which I have 2 projects with:
- ASP.NET MVC Application to consume wcf services.
- 5 WCF services.
I have added one web service reference in the project 1. Now, I need to use different services based on the user e.g.
User Type 1
: Only allow to consume Service 1.
User Type 2
: Only allow to consume Service 2.
etc.
I have Service URL's like localhost:6227/Service1.svc
, localhost:6227/Service2.svc
etc.
I have stored all service URL's in the db and I need to change URL for each user type to consume his allowed service only without adding more end points and only change URL from the backend based on user type. I need relevant link or code to solve this problem.
Edit
In Web Config
I have added just this endpoint in the mvc application and I don't want to use web config to change address in here but I want to change address in the code for each user type while application is running.
<client>
<endpoint address="http://localhost:6227/Service1.svc"
binding="customBinding" bindingConfiguration="CustomBinding_IService1"
contract="Service1.IService1" name="CustomBinding_IService1" />
</client>