none
WCF Service - works locally, not over network. RRS feed

  • Question

  • Hi all,

    So I've got a WCF network service that works fine when I have both the server and client locally. When I move the service to another machine on the network I can happily update my service reference in the client, but when a call to the service is made in the client I get the "Service is in a faulted state" error. HEre are my app/web.config files, I'm sure I'm doing something daft in once of these. I've also turned my private firewalls off for testing.

    Server

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.diagnostics>
          <!--sources>
            <source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
              <listeners>
                <add name="traceListener"
                    type="System.Diagnostics.XmlWriterTraceListener"
                    initializeData= "c:\log\Traces.svclog" />
              </listeners>
            </source>
          </sources>-->
            <sources>
                <source propagateActivity="true" name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelTraceListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
            </sources>
            <sharedListeners>
                <add initializeData="c:\users\jibrohni\documents\visual studio 2012\projects\wcfservicehost\wcfservicehost\app_tracelog.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
                    <filter type="" />
                </add>
            </sharedListeners>
        </system.diagnostics>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
        <system.serviceModel>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="">
                        <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
                        <serviceDebug includeExceptionDetailInFaults="true" />
                    </behavior>
                    <behavior name="WCFServiceHostTutorial.MyServiceBehaviour">
                        <serviceMetadata httpGetEnabled="true"/>
                        <serviceDebug includeExceptionDetailInFaults="true"/>
                    </behavior>
                    <behavior name="debug">
                      <serviceDebug includeExceptionDetailInFaults="true" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
            <services>
                <service name="WCFServiceHostTutorial.MyService">
                    <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
                        name="NetTcpBindingEndpoint" contract="WCFServiceHostTutorial.IMyService">
                        <identity>
                            <dns value="localhost" />
                        </identity>
                    </endpoint>
                    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
                        name="MexTcpBindingEndpoint" contract="IMetadataExchange" />
                    <host>
                        <baseAddresses>
                            <add baseAddress="net.tcp://192.168.10.164:8523/WCFTestService" />
                          <!--<add baseAddress="net.tcp://192.168.10.155:8523/WCFTestService" />-->
                        </baseAddresses>
                    </host>
                </service>
            </services>
        </system.serviceModel>
    </configuration>

    Client

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.diagnostics>
            <sources>
                <source propagateActivity="true" name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelTraceListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
            </sources>
            <sharedListeners>
                <add initializeData="c:\users\jibrohni\documents\visual studio 2012\projects\client\client\app_tracelog.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
                    <filter type="" />
                </add>
            </sharedListeners>
        </system.diagnostics>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
        <system.serviceModel>
            <bindings>
                <netTcpBinding>
                    <binding name="NetTcpBindingEndpoint" />
                </netTcpBinding>
            </bindings>
            <client>
                <endpoint address="net.tcp://192.168.10.164:8523/WCFTestService"
                    binding="netTcpBinding" bindingConfiguration="NetTcpBindingEndpoint"
                    contract="DDServiceReference.IMyService" name="NetTcpBindingEndpoint">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>


    Please tell me it's something daft! I can't see what it is and I'm confused that I can see and update the service reference successfully, but not make a service call.

    My service is also set-up like so:

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Reentrant)]

    which I'm unsure of.

    Thanks folks,

    Jib

    Thursday, November 21, 2013 1:48 PM

Answers

All replies