Recent posts:
Recent replies:

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.

Hi Nicky,

Thanks for your reply. Yes, that was the 1st thing I checked and made sure when I got the error. The operation and the service both use the same Charset and Endian settings. I tried changing them to Little and JavaUTF but to no luck. I tried changing the timeout to various setting like 30, 60 seconds. But the XML file is only 2KB.

Hi Vic,

Thank you so much for your reply. I'm about to contact WRC but thought someone will give me an answer here. And I also read the documentation of TCP adapters(Inbound&Outbound) and according to the documentation it should work. 

I wonder the same why the Operation is not using XML adapter. It was developed by someone about 5 years ago. Unfortunately this outbound operation is in an external system to my team's production. We have no control over it to make any modifications and the other team does not have any developers. 

To give you an idea of what we are doing, let me introduce

X- Source System(Ensemble)

Y-Legacy System(Some Legacy Application)

Z-Our new System (Ensemble)

There was a connection between X and Y. We asked the source system people to send us the same messages by creating another outbound operation using the same outbound class(Using Ensemble production UI). 

Later I inspected the outbound operation source code. It is using EnsLib.TCP.CountedOutboundAdapter to send the XML data.

So I imagined, if I use EnsLib.TCP.CountedInboundAdapter it will get data. But to my surprise, it is not working.

My Service code is very simple and Basic.

Include NthUtility Class NTH.Service.TestTcpInboundService Extends NTH.AIH.Service.BaseAimService
{ Parameter ADAPTER = "EnsLib.TCP.CountedInboundAdapter"; }


The BaseAimService Implements the OnProcessInput() method.

Method OnProcessInput(pInput As %Stream.GlobalCharacter, Output pOutput As %Stream.GlobalCharacter, ByRef pHint As %String) As %Status { $$$TRACE("Data"_pInput.Read() Quit $$$OK }

The trace never gives any data. pInput is always empty.  

Thanks again for the reply Vic,

I hope this helps you in answering my issue.

Followers:
Sai has no followers yet.
Following:
Sai has not followed anybody yet.
Global Masters badges:
Sai has no Global Masters badges yet.