Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 113443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:42:11+00:00 2026-05-11T02:42:11+00:00

I have a need to connect to a WCF service I wrote without having

  • 0

I have a need to connect to a WCF service I wrote without having to deploy an app.config for the client application I’m writing. However, I’ve been having a very difficult time trying to figure out how to set up things from the client side in code. This is as far as I’ve gotten… does anyone have any ideas what I need to do to get this to work? I’d really appreciate it.

This is the code I’ve got so far:

    String baseAddress = 'http://localhost/CommService';      WSDualHttpBinding binding = new WSDualHttpBinding();     binding.Name = 'WSDualHttpBinding_ICommService';     binding.ClientBaseAddress = new Uri(baseAddress);     binding.ReliableSession.Ordered = true;     binding.ReliableSession.InactivityTimeout = new TimeSpan(0, 10, 0);     binding.ReceiveTimeout = new TimeSpan(0, 10, 0);     binding.SendTimeout = new TimeSpan(0, 0, 5);      InstanceContext context = new InstanceContext(this);     client = new CommServiceClient(context, 'WSDualHttpBinding_ICommService');     client.Endpoint.Binding = binding; 

And this is my client app’s app.config:

<system.serviceModel>     <bindings>         <wsDualHttpBinding>             <binding name='WSDualHttpBinding_ICommService' closeTimeout='00:01:00'                 openTimeout='00:01:00' receiveTimeout='00:10:00' sendTimeout='00:00:05'                 bypassProxyOnLocal='false' transactionFlow='false' hostNameComparisonMode='StrongWildcard'                 maxBufferPoolSize='524288' maxReceivedMessageSize='65536'                 messageEncoding='Text' textEncoding='utf-8' useDefaultWebProxy='true'>                 <readerQuotas maxDepth='32' maxStringContentLength='8192' maxArrayLength='16384'                     maxBytesPerRead='4096' maxNameTableCharCount='16384' />                 <reliableSession ordered='true' inactivityTimeout='00:10:00' />                 <security mode='Message'>                     <message clientCredentialType='Windows' negotiateServiceCredential='true'                         algorithmSuite='Default' />                 </security>             </binding>         </wsDualHttpBinding>     </bindings>     <client>         <endpoint address='http://localhost/CommService/'             binding='wsDualHttpBinding' bindingConfiguration='WSDualHttpBinding_ICommService'             contract='Services.ICommService' name='WSDualHttpBinding_ICommService'>             <identity>                 <dns value='localhost' />             </identity>         </endpoint>     </client> </system.serviceModel> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:42:12+00:00Added an answer on May 11, 2026 at 2:42 am

    You can easily achieve what you want. See code below :

     Uri baseAddress = new Uri('http://localhost/CommService');  WSDualHttpBinding wsd = new WSDualHttpBinding();  EndpointAddress ea = new EndpointAddress(baseAddress, EndpointIdentity.CreateDnsIdentity('localhost'));  client  = new CommServiceClient(new InstanceContext(this), wsd, ea); 

    Let me explain a bit :

    • first we create an instance of a WSDualHttpBinding with the default settings (those are the exact ones the generated app.config has). If you want to modify any of the settings, you can modify them trough the exposed properties.
    • then we create an EndPointAddress with th desired URL and identity. No need to link it with a binding because we will link all of them in the Service Client constructor.
    • lastly we create the Service Client. One of the contructor overloads allows us to specify a Binding and an Endpoint Address.
    • in general every element available in the app.config file has an associated Class in .NET code and every attribute or child element has an associated Property in the specified class.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a application with JPA Hibernate without Spring and I need connect to
Lets suppose I have an .NET client application that connects to a WCF service,
For an application, I need to have a SSL certificate for a WCF service,
I have an application where I need to connect to a game app within
I have a WCF service lib and client[Winform] that connect using netTCPbinding. the client
I need to test WCF service, but have only one computer, so my service
I have a WCF Service running SOAP and allowing Flex / Flash to connect
I am writing a WCF service where I need to access the Hash Code
I have a Web application and a WCF service hosted on the same Windows
I have 2 MVC apps that need to connect to a 3rd application. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.