I have been looking for a solution on the web, but I found no right solution to solve my problem:
I must create an Outlook addins which uses a "Service References". This one can have 4 different endpoint address (choosen by the user).
To reach the endpoint of my service, I have found this:
var appConfig = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
var serviceModel = System.ServiceModel.Configuration.ServiceModelSectionGroup.GetSectionGroup(appConfig);
var clientEndpoints = serviceModel.Client.Endpoints;
In my app.config the service is written like this (because of privacy, I have modified some values):
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="nameSOAPBinding">
<security mode="Transport" />
</binding>
<binding name="nameSOAPBinding1"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="endpointAddress"
binding="basicHttpBinding" bindingConfiguration="contractNameSOAPBinding"
contract="contractName" name="contractNameSOAP11" />
</client>
</system.serviceModel>
After exploring the C# var 'clientEndpoints' in details, I have not found the endpoint value (= the address) where I could have set the new value.
I am only looking for solution to modify the endpoint address value from C#. Am I on the right way? Is there a easier/better solution?