Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, everybody!

I have created a WCF/WPF application. WCF is using Entity Framework to get data from database.
And on my local computer everything is working just fine.

But, how can I make this work in LAN? I have couple of computers in my home, so I wanted to work in this application on all of them.

This is how app.config from service look like:
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- 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. -->
  <system.serviceModel>
    <services>
      <service name="ISKUService.Service1">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/Design_Time_Addresses/ISKUService/Service1/" />
          </baseAddresses>
        </host>
        <!-- Service Endpoints -->
        <!-- Unless fully qualified, address is relative to base address supplied above -->
        <endpoint address="" binding="basicHttpBinding" contract="ISKUService.IService1">
          <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          -->
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <!-- Metadata Endpoints -->
        <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
        <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, 
          set the value below to false 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" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>
</configuration>


Thanx!

What I have tried:

I have tried to change
HTML
<add baseAddress="http://localhost:8733/Design_Time_Addresses/ISKUService/Service1/" />

into
HTML
<add baseAddress="http://192.168.1.13:8733/Design_Time_Addresses/ISKUService/Service1/" />


This is the error that I get on the other computer:

https://s4.postimg.io/otyu519xp/error.jpg[^]
but no luck...
Posted
Updated 18-Aug-16 2:50am
v3
Comments
Afzaal Ahmad Zeeshan 17-Aug-16 16:04pm    
What is the error that you receive?
tomjah86 17-Aug-16 16:46pm    
This error comes up on the other computer in the same network...these 2 computers can share files normally...

https://s4.postimg.io/otyu519xp/error.jpg
Beginner Luck 17-Aug-16 21:33pm    
try put this url "http://192.168.1.13:8733/Design_Time_Addresses/ISKUService/Service1/" in bowser of another computer that trying to access it. This will test if this end point is access by that computer
Bernhard Hiller 18-Aug-16 4:00am    
Did you check firewall settings?
tomjah86 18-Aug-16 4:40am    
What should I change in firewall setting?

 
Share this answer
 
You publish the WCF app in the IIS and it should be available for your LAN. In order to access the WCF, use the virtual address and port where it was published. Also please make sure that the port is open for communication
 
Share this answer
 

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