A
Andrew Jocelyn
Hi
How do I programmatically change (read/write) the values in this app.config
file at runtime? Specifically I want to change the client endpoint address
but it would be nice to change other values too. I thought this is what
ServiceHost is for but is seems way more complicated to use for what I'm
trying to do.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="DataServiceSoap" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="01:00:00" sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="67108864" maxBufferPoolSize="524288"
maxReceivedMessageSize="67108864"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://webservice.com/Service.asmx"
binding="basicHttpBinding" bindingConfiguration="DataServiceSoap"
contract="MyService.DataServiceSoap" name="DataServiceSoap" />
</client>
</system.serviceModel>
Many thanks
Andrew
How do I programmatically change (read/write) the values in this app.config
file at runtime? Specifically I want to change the client endpoint address
but it would be nice to change other values too. I thought this is what
ServiceHost is for but is seems way more complicated to use for what I'm
trying to do.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="DataServiceSoap" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="01:00:00" sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="67108864" maxBufferPoolSize="524288"
maxReceivedMessageSize="67108864"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://webservice.com/Service.asmx"
binding="basicHttpBinding" bindingConfiguration="DataServiceSoap"
contract="MyService.DataServiceSoap" name="DataServiceSoap" />
</client>
</system.serviceModel>
Many thanks
Andrew