CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2004
    Posts
    105

    Communication Between Two WCF Services

    Hi,
    I have two WCF Services say Ser1 and Ser2. Both services are running in two different machines and both services are Windows services. I want to communicate those two services. Is it possible?.
    Here Clien1 is client to Ser1 and Client2 is Clinet to Ser2.
    Cliet2 Reqeusts/Sends data to Ser1 through Ser2 and Client1 Requests/sends data to Ser2 through Ser1. This we need to break

    Data transfer between Ser1 and Ser2 is not happenening if these servers are as Windows Services. But we can able to communicate if these Ser1 and Ser2 are console apllications.

    Rest of the configurations like App.Config and Proxies are exactly same for both as a Service or as a Console application.

    I want to konw why both servers are not communicating if I configure these as Service or Process?
    Why communication is possible only if these servers are console applications.

    Thanks and regards
    Ravi.Battula
    Ravi.Battula

  2. #2
    Join Date
    Nov 2004
    Posts
    105

    Re: Communication Between Two WCF Services

    Hi,

    I am getting this exception

    {System.ServiceModel.CommunicationException: 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:00:59.9680000'. ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: 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:00:59.9680000'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
    at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
    at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
    --- End of inner exception stack trace ---
    at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
    at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
    at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
    at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count, TimeSpan timeout)
    at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
    at System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
    at System.Net.Security.NegotiateStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
    at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
    --- End of inner exception stack trace ---
    at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
    at System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
    --- End of inner exception stack trace ---

    Server stack trace:
    at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
    at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

    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 System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)
    at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)
    at System.ServiceModel.ClientBase`1.Open()
    Ravi.Battula

  3. #3
    Join Date
    Nov 1999
    Location
    Denmark
    Posts
    260

    Re: Communication Between Two WCF Services

    if you have IIS running on both you can use Web services

  4. #4
    Join Date
    Nov 2004
    Posts
    105

    Re: Communication Between Two WCF Services

    Quote Originally Posted by Rudegar
    if you have IIS running on both you can use Web services
    No,

    I am not using WEb service, It is windows service and I am using netTcpBinding.

    Regards
    Ravi.Battula
    Ravi.Battula

  5. #5
    Join Date
    Nov 1999
    Location
    Denmark
    Posts
    260

    Re: Communication Between Two WCF Services

    if the services do any! type of GUI
    they have to be run as
    Log on as:
    Local System acount
    and have "allow service to interact with desktop
    under the service's properties in services

  6. #6
    Join Date
    Nov 2004
    Posts
    105

    Re: Communication Between Two WCF Services

    This Service is not GUI type of service.

    Client can able talk with this service. If client calls any method of that service, Sevice has to invoke a method in other service using WCF service contract, But it is failing here, If I run these services as console applications, It can able eto invoke other server method.

    Regards
    Ravi.Battula
    Ravi.Battula

  7. #7
    Join Date
    Nov 2004
    Posts
    105

    Re: Communication Between Two WCF Services

    Hi

    I solved it. Actually the problem is not with coding or configuration. The proble is with security settings.Earlier I launched this server as Local system account. Now I changed to Administator account. It starts working

    Regards
    Ravi.Battula
    Ravi.Battula

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured