I have a dll where user and password are passed through the app.config
to the webservice and I would like to see how to do this so that instead of passing a hardcode a variable is passed which can then be reported to the dll in time execution. Would this be possible? I am not very expert in c # the truth that is why it is costing me but I manage two possible scenarios:
key
that can be modified in the future from the program wsse:username
and the password
But I am not able to implement any of the two options and make them work.
The app.config
would be something like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="XXXXXX" value="XXXXXXX" />
<add key="XXXXX" value="xxxxxx" />
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="e3s-xxxx">
<security mode="Transport" />
</binding>
<binding name="e3sxxxx">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://xxxxx:443/ctxweb/secured_ssl/xxxx_waste"
binding="basicHttpBinding" bindingConfiguration="e3s-xxxx"
contract="E3S_XXXX.Ie3xxxx" name="e3s-xxxx" >
<headers>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>miusuario</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">miprueba</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</headers>
</endpoint>
Thank you very much everyone for your help.