none
WCF service over laptop hosted WIFI RRS feed

  • Question

  • I have a WCF service that works on localhost, but I want to get it working between two laptops, hosting the wifi completely from my host laptop.

    I believe you can use "netsh wlan start hostednetwork" to create a private wifi, and I can connect to it using my other laptop through the network and sharing centre in Windows.  The problem comes when I try to use the service over it, it always comes back with "no endpoint listening", which is a clear indication that I have the addresses wrong!

    My question is what address should I put there?  I've tried the usual IPv4 address from ipconfig.  Perhaps the computer name or some combination thereof?

    Thanks.

    ps.  Please ask questions...  I may have missed something utterly obvious.  I have made the assumption that if it works over localhost it should work over wifi, if this is not true then *facepalm*

    <system.serviceModel>
        <services>
          <service name="namespace.service" behaviorConfiguration="behaviour1">
            <endpoint address="" binding="basicHttpBinding" contract="namespace.iservice" bindingConfiguration="binding1"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:54321"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding name="binding1" transferMode="Streamed" messageEncoding="Mtom">
              <security mode="None">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="behaviour1">
              <serviceMetadata httpGetEnabled="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

    • Edited by DanRawr Monday, February 24, 2014 8:35 AM
    Saturday, February 22, 2014 2:52 AM

All replies

  • You need to know the ip address of your server (WCF Service) on your WiFi network and put it in the url of your app
    Tuesday, February 25, 2014 5:34 AM
  • My exact process was:

    Open cmd.exe on host machine, and type "ipconfig".  From there, I got the IPv4 address, and put that into both the client and server configuration files in the base address node.

    Is there something wrong with what I did there?

    • Edited by DanRawr Tuesday, February 25, 2014 12:48 PM I wasn't clear.
    Tuesday, February 25, 2014 11:31 AM