Hi Everyone, 

Thank you all for taking time to help me solve the issue.

After contacting the InterSystems support, we found that the issue is actually in a customized outbound TCP adapter. The adapter was sending a non counted stream using a counted adapter. 

My inbound adapter was expecting a counted stream(first 4 bytes containing the length of the message) but got non counted. So it failed always. I changed the outbound operation to use EnsLib.TCP.CountedXMLOutboundAdapter and my inbound to EnsLib.TCP.CountedInboundAdapter and they are working well together. 

Another thing I learned is that we can not use EnsLib.TCP.InboundAdapter directly in a service as this does not handle the incoming message and handles only connection setup. I think something like OnConnect() method needs to be overridden and implement our own logic to handle the incoming stream.

Once again, I appreciate your efforts. If you have similar issue or have questions regarding this, please send me a message and I will try to answer back soon.