I have a client / server application and I am trying to use the WCF service that I created, but saving the exception for the exception, and I was not able to figure it out.
This is the WCF server code:
<configuration> <system.serviceModel> <serviceHostingEnvironment multipleSiteBindingsEnabled="true"> <services> <service name="ChatService.ChatService" behaviorConfiguration="behaviorConfig"> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:7997/Host/"/> <add baseAddress="http://localhost:7998/Host/"/> </baseAddresses> </host> <endpoint address="tcp" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="ChatService.IChat"/> <endpoint address="net.tcp://localhost:7996/Host/mex" binding="mexTcpBinding" contract="IMetadataExchange"/> </service> </services> </serviceHostingEnvironment> <behaviors> <serviceBehaviors> <behavior name="behaviorConfig"> <serviceMetadata httpGetEnabled="true" httpGetUrl=""/> <serviceDebug includeExceptionDetailInFaults="false"/> <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"/> <dataContractSerializer maxItemsInObjectGraph="2147483647"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <netTcpBinding> <binding name="tcpBinding" maxBufferSize="67108864" maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864" transferMode="Buffered" closeTimeout="00:00:10" openTimeout="00:00:10" receiveTimeout="00:20:00" sendTimeout="00:01:00" maxConnections="100"> <security mode="None"> </security> <readerQuotas maxArrayLength="67108864" maxBytesPerRead="67108864" maxStringContentLength="67108864"/> <reliableSession enabled="true" inactivityTimeout="00:20:00"/> </binding> </netTcpBinding> </bindings> </system.serviceModel> </configuration>
and this is the WCF client service:
<configuration> <connectionStrings> <add name="IClient.Properties.Settings.Co_WorkersDataBaseConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Co-WorkersDataBase.mdb" providerName="System.Data.OleDb" /> </connectionStrings> <system.serviceModel> <bindings> <netTcpBinding> <binding name="NetTcpBinding_IChat" 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="67108864" maxBufferSize="67108864" maxConnections="100" maxReceivedMessageSize="67108864"> <readerQuotas maxDepth="32" maxStringContentLength="67108864" maxArrayLength="67108864" maxBytesPerRead="67108864" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="20:00:10" enabled="true" /> <security mode="None"> <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /> <message clientCredentialType="Windows" /> </security> </binding> </netTcpBinding> </bindings> <client> <endpoint address="net.tcp://localhost:7997/Host/tcp" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IChat" contract="CHATSERVICE.IChat" name="NetTcpBinding_IChat" /> </client> </system.serviceModel> </configuration>
What I'm trying to do is establish a connection to the server, but all I get is exceptions!
The server did not provide a meaningful response, this may be due to a contract mismatch, a premature disconnection of the session, or an internal server error
Server stack trace: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at IClient.CHATSERVICE.IChat.EndConnect(IAsyncResult result) at IClient.CHATSERVICE.ChatClient.EndConnect(IAsyncResult result) in C:\Users\Desktop\IClient\Service References\CHATSERVICE\Reference.cs:line 641 at IClient.CHATSERVICE.ChatClient.OnEndConnect(IAsyncResult result) in C:\Users\Desktop\IClient\Service References\CHATSERVICE\Reference.cs:line 652 at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
PS: I get this exception when I click the Connect button of the client application, the Server works simultaneously with the client application.
Help me please!
source share