Author |
Message
|
gag_nm |
Posted: Sat Oct 10, 2015 4:16 am Post subject: TCP/IP |
|
|
Centurion
Joined: 16 Oct 2008 Posts: 102
|
HI,
please find my below flow.
MQInput-->ComputeNode---->TCPClientOut--->TCPCLientReceive--->MQOutput
i am successfully connecting TCP Server, but other team are saying they are not receving any Data.
please find below code in Compute node.
i have to send data only in ASCII plan Text.I am using below codepage mentioned in Code.
DECLARE CharOutput CHARACTER '<RER>1<ABC><XYX>';
SET OutputRoot.BLOB.BLOB = CAST(CharOutput AS BLOB CCSID 1200);
TCPClientOut Properties
Advance::
Close Connection : No
Output Stream Modififcation : Reserve output Stream(For use by future TCPIP Nodes) Then release at end of flow.
Input Stream Modififcation : Reserve Input Stream(For use by future TCPIP Nodes) Then release at end of flow.
Record Elements: Record in Unmodified Data.
TCPClientReceive Properties
Timeout : 60
Advance::
Close Connection : No
Output Stream Modififcation : Reserve output Stream(For use by future TCPIP Nodes) Then release at end of flow.
Input Stream Modififcation : Reserve Input Stream(For use by future TCPIP Nodes) Then release at end of flow.
can some one correct flow.. |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Oct 10, 2015 8:31 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Find out from the other end how they expect to receive the stream.
There are two ways of sending data over a TCP/IP connection
1) Send a short message that includes the lenght of the data that is to follow
Then you send the data. This needs TWO TCPIP nodes
2) Agree with the other end a termination character. Then you ADD this character to the message and send it. This requires one TCPIP Node
Unless you do one of the above the other end may very well say we have not received anything because there is no way for the other end to recognize the end of a message in a stream. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
gag_nm |
Posted: Sat Oct 10, 2015 9:13 pm Post subject: |
|
|
Centurion
Joined: 16 Oct 2008 Posts: 102
|
other end they are expecting data in ASCII Plan Text.
they expect to receive data in below format.
<STX>1<ETB>0<ETB><ETX>
I am using TCPIPClientoutput Node to send to TCP/IP server.
i have changed my code to
DECLARE CharOutput CHARACTER '<STX>1<ETB>0<ETB><ETX>';
SET OutputRoot.BLOB.BLOB = CAST(CharOutput AS BLOB CCSID 1200);
<ETX> is terminator
but still they are not receving data... |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Oct 10, 2015 10:42 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
You must be new to Telecoms. For those of us 'greybeards' this is old hat.
This
Code: |
<STX>1<ETB>0<ETB><ETX>
|
Does not mean what you think it does.
May I suggest that you read this
https://en.wikipedia.org/wiki/Control_character
You need to wrap your data in the HEX values for <STX> and <ETX> (x02 & x03)
You could look at letting the TCP nodes do it for you. It will witth the ETX but can't remember about the STX side.
all of this should be in the interface message spec that you are working to. You do have one don't you? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
gag_nm |
Posted: Sat Oct 10, 2015 11:25 pm Post subject: |
|
|
Centurion
Joined: 16 Oct 2008 Posts: 102
|
thanks for input , to convert to Hex values, do we have any fucntion or code page to convert it. |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Oct 11, 2015 12:04 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Can be done is ESQL
something like
Code: |
declare blSTX BLOB x'02';
declare blETX BLOB x'03'
|
then concatenate the blobs
Code: |
set OutputRoot.BLOB.BLOB = blSTX || blMyMessage || blETX;
|
code not tested but using UserTrace will tell you in detail what is going on at every step. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
gag_nm |
Posted: Sun Oct 11, 2015 8:13 pm Post subject: |
|
|
Centurion
Joined: 16 Oct 2008 Posts: 102
|
thanks for your support.
your code help me to proceed to send and receive data.
i have issue with Format of data.
input from message broker <STX>1<ETB>0<ETB><ETX>
Code: |
DECLARE blSTX BLOB x'02';
DECLARE blETX BLOB x'03';
DECLARE blETB BLOB x'17';
DECLARE TypeNumone CHARACTER '1';
DECLARE TypeNumZero CHARACTER '0';
DECLARE blTypeNumone BLOB CAST (TypeNumone AS BLOB CCSID 1200);
DECLARE blTypeNumZero BLOB CAST (TypeNumZero AS BLOB CCSID 1200);
DECLARE blbString BLOB;
Set blbString =blSTX || blTypeNumone ||blETB ||TypeNumZero ||blETB ||blETX ;
SET OutputRoot.BLOB.BLOB = String; |
At Server End, below data is received
[2][0]1[23][0]0[23][3]
it is supposed to be [2]1[23]1[23]0000[3], i don't know where [0] is coming from.
can you please check my code. |
|
Back to top |
|
 |
stoney |
Posted: Sun Oct 11, 2015 8:48 pm Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
Quote: |
i have to send data only in ASCII plan Text.I am using below codepage mentioned in Code. |
Quote: |
DECLARE blTypeNumone BLOB CAST (TypeNumone AS BLOB CCSID 1200);
DECLARE blTypeNumZero BLOB CAST (TypeNumZero AS BLOB CCSID 1200); |
Are you sure you wanted CCSID 1200 - UTF-16?
This will cast each single character into a two byte string. |
|
Back to top |
|
 |
gag_nm |
Posted: Sun Oct 11, 2015 9:06 pm Post subject: |
|
|
Centurion
Joined: 16 Oct 2008 Posts: 102
|
i have changed to 1208.now its working fine.
thanks guys for your inputs... |
|
Back to top |
|
 |
|