Click here to Skip to main content
15,844,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have created a wcf service and hosted in my own computer . it is working fine if i consume that service in the same computer but if i try to consume that service from another computer it shows error ... configuration files of host and client is attached below ... what should i change in the configuration to consume this service from other computer in local area network

client configuration file :

<?xml version="1.0" encoding="utf-8" ?>
        <services />
                <binding name="configration" />
            <endpoint address=""
                binding="wsHttpBinding" bindingConfiguration="configration"
                contract="ServiceReference1.IService1" name="configration">
                    <dns value="" />

host configuration file :

<?xml version="1.0" encoding="utf-8" ?>

    <compilation debug="true" />
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
      <service behaviorConfiguration="WcfServiceLibrary1.Service1Behavior"
        <endpoint address="" binding="wsHttpBinding" name="configration"
            <dns value="" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <add baseAddress="http://*:8732/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />
          <timeouts openTimeout="00:10:00" />
        <behavior name="WcfServiceLibrary1.Service1Behavior">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False" />


the error i am getting is..............

unhandled exception has occurred in your application .could not connect to error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to repond
Updated 17-Sep-14 1:37am
SandeepKushwah 17-Sep-14 14:38pm    
The error is because of the Endpoint address. IP address of your host comuputer is <dns value=""> that is, whereas you client is looking for the service at and hence its unable to locate. Make sure you have two computers interconnected in the same network.

1 solution

Make sure that both computers are connected in LAN and exhibit in the same IP address that is 192.168.1.(anything).
You can do one more thing... Create one more endpoint with netTCP binding and then try. Also please post the error you are getting while accessing the service on other computer.
Share this answer
Adi5555 17-Sep-14 6:38am    
i have added the give error to my question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900