I have a script task that accesses a web service. I cannot use the web service task as I need to set header information which is not in my sample below. In the code window i set a web reference to my web service and the URL is set to dynamic. I need to change this URL based on environment. The URL appears to be stored in the app.config file. My question is how do I change this value on the fly? I can pass in variables to the script itself but do not see a way to modify the app.config file. I have seen other examples but none meet my requirements.
Here is my code and the configuration file example. Is there a better way that I am not aware of?
This is a simplified example
TestWS wsCall = new TestWS();
int returnValue = wsCall.DoSomething();
App.Config File
I am trying to change the Value of the URL at runtime
<applicationSettings>
<ST_ebae43bfbdb74b829486e1f379544e4f.csproj.Properties.Settings>
<setting name="ST_ebae43bfbdb74b829486e1f379544e4f_csproj_TestWS"
serializeAs="String">
<value>http://localhost:1485/TestWS.asmx</value>
</setting>
</ST_ebae43bfbdb74b829486e1f379544e4f.csproj.Properties.Settings>
</applicationSettings>