Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
cofig page of host service
XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="WCFServiceHost_DAS.MyServiceBehavior">
                    <serviceMetadata httpGetEnabled="false" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service behaviorConfiguration="WCFServiceHost_DAS.MyServiceBehavior"
                name="WCFServiceHost_DAS.MyService">
                <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
                    name="NetTcpBindingEndpoint" contract="WCFServiceHost_DAS.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.1.18:8523/WCFDASTestService" />
                    </baseAddresses>
                </host>
            </service>
        </services>
    </system.serviceModel>
</configuration>

config page of client service
XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <netTcpBinding>
               <binding name="NetTcpBindingEndpoint" closetimeout="00:01:00">
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                    hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                    maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                    maxReceivedMessageSize="65536">
                    <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384">
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliablesession ordered="true" inactivitytimeout="00:10:00">
                        enabled="false" />
                    <security mode="None">
                        <transport clientcredentialtype="Windows" protectionlevel="EncryptAndSign" />
                        <message clientcredentialtype="Windows" />
                    </security>
                </reliablesession></readerquotas></binding>
            
        
        <client>
            <endpoint address="net.tcp://192.168.1.18:8523/WCFDASTestService">
                binding="netTcpBinding" bindingConfiguration="NetTcpBindingEndpoint"
                contract="ServiceReference1.IMyService" name="NetTcpBindingEndpoint">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>

I have got exception when I used the service on different pc of same network.

Exceptions are

1. A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or ImpersonationLevel.

when I use security mode="Transport"

2. The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.

when I use security mode="None"

on client config page. Plz help me.
Posted
v3

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