1

I have been searching high and low for a solution to my problem, tried various suggestions but none have worked for me so far.

I can access the WCF service perfectly fine locally, but just cannot seem to access it from another computer within a normal LAN network.

Note: I am no expert in WCF, but have done my fair share in research. I have tried different bindings, netTcpBinding does not work for me as I get the error that its not supported.

Also, my Firewall is turned off, so I'm quite sure its not a firewall issue, and I am the built-in web server from Visual Studio, I am not sure how to host it via IIS, or where to start by doing that.

<system.serviceModel>
<services>
  <service name="WCFService.TorrentService">
    <endpoint contract="WCFService.ITorrentService"
              address="TorrentService"
              binding="basicHttpBinding">
    </endpoint>
    <endpoint address="TorrentService/MEX/"
              binding="mexHttpBinding"
              contract="IMetadataExchange">
    </endpoint>
    <host>
      <baseAddresses>
        <add baseAddress="http://192.168.7.111:3697/TorrentService"/>
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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"/>
      <useRequestHeadersForMetadataAddress>
        <defaultPorts>
          <add scheme="http" port="3697" />
        </defaultPorts>
      </useRequestHeadersForMetadataAddress>
    </behavior>
  </serviceBehaviors>
</behaviors>
<protocolMapping>
    <add binding="basicHttpBinding" scheme="https" />
</protocolMapping>    
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

Im pretty sure there's a lot of things thats not supposed to be there in the config file, as I have tried a lot of different solutions but none has worked for me so far.

When I Try to access the service from another machine, by doing the following

http://s8.postimg.org/yqps7k6f9/untitled.png
http://s8.postimg.org/yqps7k6f9/untitled.png

gunr2171
  • 16,104
  • 25
  • 61
  • 88
Johan Aspeling
  • 765
  • 1
  • 13
  • 38
  • possible duplicate of [WCF service in local network](http://stackoverflow.com/questions/15421518/wcf-service-in-local-network) – myermian Oct 28 '13 at 03:26
  • You will have better luck pasting your error as text instead as an image, but I'll fix your image for you. – gunr2171 Oct 28 '13 at 03:27
  • You need to publish your service to IIS –  Oct 28 '13 at 03:42
  • you can host it for your local network using IIS Express. Take a look at this answer. http://stackoverflow.com/a/5438322/2270839 – Kevin Oct 28 '13 at 04:07
  • I Followed an example of Rahul Rajat Singh, from his tutirial on how to host the service using IIS, as well as self hosting here: http://www.codeproject.com/Articles/550796/A-Beginners-Tutorial-on-How-to-Host-a-WCF-Service?msg=4688861#xx4688861xx, – Johan Aspeling Oct 28 '13 at 16:10
  • I connected to the service from my other computer in the network with the following string: http://192.168.7.111:8733/Design_Time_Addresses/PeerTopeerService/Service1/mex, where that is the IP and port on the hosting computer. Now, I cant use the functions on the WCF service, I get the following error: "There was no endpoint listening at http://localhost:8733/Design_Time_Addresses/PeerToPeerService/Service1/ that could accept the message. This is often caused by an incorrect address or SOAP action. See Exception, if present, for more details." – Johan Aspeling Oct 28 '13 at 16:13

2 Answers2

1

If you have your wcf working on a localhost so problem is to share it with other machines. I believe you are using the standard dev server or IIS Express. One way to archive what you want is to use IIS Express and follow the next article http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer.

Once you make all necessary settings for IIS Express and for security on you machine I am sure you will get assess to the wcf service. But try both approaches: using ip address and computer name!!!

Anton
  • 731
  • 4
  • 5
-2

Please start your project and then access from another machine. The host service should be running before you access it from another machine.