0

I'm working with Service References, and I want to configure the dynamic endpoint.

The settings below wanted to do within the source, not necessarily it within the web.config or app.config

This is possible or is a bad practice?

Config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="ProdutosCadastroSoap" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://app.omie.com.br/api/v1/geral/produtos/"
                binding="basicHttpBinding" bindingConfiguration="ProdutosCadastroSoap"
                contract="omieWS.Produto.ProdutosCadastroSoap" name="ProdutosCadastroSoap" />
        </client>
    </system.serviceModel>
</configuration>
Tiedt Tech
  • 719
  • 15
  • 46
  • Yes, you can configure endpoints in code. Was that your question? – stuartd Oct 14 '16 at 13:29
  • you would be making it non-configurable by moving out of appconfig/webconfig, if you have to change it later after deployments you have to change the source build/publish/deploy that's a overhead everytime. – inan Oct 14 '16 at 13:31
  • @inan in a controlled environment, making changes to config files and redeploying are effectively the same - once you've been through a multi-stage three week change control board approval process to actually get to make the change, whether you have to then just update the config file or deploy the service isn't much different. – stuartd Oct 14 '16 at 13:37
  • @stuartd I Agree, it all depends on his use case and working scenario, I wouldn't say it's bad practice I have done that in past due to some SSL issues. – inan Oct 14 '16 at 13:40
  • @stuartd My question is, how to do this in code, without having anything in the web.config or app.config – Tiedt Tech Oct 14 '16 at 14:00

0 Answers0