CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    60

    CHANGE WCF client IP

    I used Service Reference to create a WCF client class (much like the svcutil.exe tool). It generated this section in the app.config automatically:

    <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="BasicHttpBinding_WMON_ISqlCeDBController" closeTimeout="00:01:00"
    openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00"
    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="20000000" maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000"
    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
    useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="20000000"
    maxArrayLength="20000000" 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://localhost:8731/WMON/Database/WMON_SqlCeDBWcfService"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_WMON_ISqlCeDBController"
    contract="WMON_SqlCeWcfClient.WMON_ISqlCeDBController" name="BasicHttpBinding_WMON_ISqlCeDBController" />
    </client>
    </system.serviceModel>


    I have a GUI program with a settings tab to allow the user to change the WCF server IP. But I dont' know how to change it in the app.config.

    PLEASE HELP. I'm stuck.

    I posted this topic sometime ago in MSDN and never got proper answer. and MSDN search capabilities are terrible.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: CHANGE WCF client IP

    Quote Originally Posted by armen_shlang View Post
    I have a GUI program with a settings tab to allow the user to change the WCF server IP. But I dont' know how to change it in the app.config.
    Are you trying write the user changes back to the app config file? If so, app configs are mean't to be read-only. I'm not saying it can't be done, but I'm trying to understand what you are after.

    Quote Originally Posted by armen_shlang View Post
    ... MSDN search capabilities are terrible.
    It just takes a bit getting used to if you are new to it. Once you understand what data it's good for and how to search it, it becomes easy to use.

  3. #3
    Join Date
    Jan 2008
    Posts
    60

    Re: CHANGE WCF client IP

    Quote Originally Posted by Arjay View Post
    Are you trying write the user changes back to the app config file? If so, app configs are mean't to be read-only. I'm not saying it can't be done, but I'm trying to understand what you are after.
    .
    No I'm not trying to write to it, only change the value before it's used by the WCF client call.
    thanks for the reply

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: CHANGE WCF client IP

    Quote Originally Posted by armen_shlang View Post
    No I'm not trying to write to it, only change the value before it's used by the WCF client call.
    thanks for the reply
    Ok, just hand edit the following in the app config file..

    Code:
    address="http://localhost:8731/WMON/Database/WMON_SqlCeDBWcfService"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured