ISOSource Send Raw Byte only

97 views
Skip to first unread message

ombon...@gmail.com

unread,
Jan 22, 2018, 10:08:12 PM1/22/18
to jPOS Users
Hi All,

Greetings..I have some problem about send message back to client. Normally, we use ISOMsg as object to reply. But in some case, i need send byte only..without a header.

ex.
Normally =
Header + ISOMsg ->
0000000000 + 0800 + bitmap + another bitvalue
Some Case = byte only
byte only
4E4F54414C4C4F574544

 I already use send(byte[] b) function from baseChannel class.Of cource with some adjustment like[

1. Add send(byte[] b ) function in ISOSource interface
void send(byte[] header) throws IOException, ISOException;

2. Change MuxPoll and QMux Class into public abstract class (before was public class only)


But i didn't work. It seems, ISOSource didn't recognize the client. The message was not send back by server.

byte[] header = ISOUtil.hex2byte("4E4F54414C4C4F574544");
source.send(header);


Please advice. 
Thanks

Jon

chhil

unread,
Jan 22, 2018, 10:42:49 PM1/22/18
to jpos-...@googlegroups.com
I have not tried this, just thinking out aloud.

Create a new ISOmsg, set its header to the data you want to send and try sending this empty isomsg with a header.


-chhil

ombon...@gmail.com

unread,
Jan 22, 2018, 10:55:41 PM1/22/18
to jPOS Users
Hi Chill,

Thanks for fast response..Is that possible to send a IsoMsg without another bit value? i think i've tried and get an error.

Thanks
Regards,
Jon

chhil

unread,
Jan 22, 2018, 10:58:23 PM1/22/18
to jpos-...@googlegroups.com
I havent tried it, it was just a thought. If you are not sure, do try it.

-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/b1d1ff90-97d7-4571-9480-4d6abdbe5cf3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ombon...@gmail.com

unread,
Jan 23, 2018, 3:52:44 AM1/23/18
to jPOS Users
Hi chill,

Sorry, i think  make a mistake here..what i need is a header + some byte data. This byte data has no static length. 
ex.
Normal case = header + isoMsg
Negative case 1 = header + some byte data with length=10
Negative case 2 = header + some byte data with length=15

I have tried to set response message Packager with my own custom packager. But after all, it will transform into packager that i have declared at server.xml (ISO87BPackager).
i forget to mention, i use NACChannel and ISO87BPackager.
Thanks.

Jon


On Tuesday, January 23, 2018 at 10:58:23 AM UTC+7, chhil wrote:
I havent tried it, it was just a thought. If you are not sure, do try it.

-chhil
On Tue, Jan 23, 2018 at 9:25 AM, <ombon...@gmail.com> wrote:
Hi Chill,

Thanks for fast response..Is that possible to send a IsoMsg without another bit value? i think i've tried and get an error.

Thanks
Regards,
Jon

On Tuesday, January 23, 2018 at 10:42:49 AM UTC+7, chhil wrote:
I have not tried this, just thinking out aloud.

Create a new ISOmsg, set its header to the data you want to send and try sending this empty isomsg with a header.


-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

chhil

unread,
Jan 23, 2018, 9:10:34 AM1/23/18
to jpos-...@googlegroups.com
What prevents you from setting the header with the additional bytes as the new header? 

-chhil

To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

Alejandro Revilla

unread,
Jan 23, 2018, 3:10:10 PM1/23/18
to jPOS Users
Remember ISOChannel interface has a ` void send(byte[] b)` that's probably what Jon wants.




chhil

unread,
Jan 23, 2018, 7:02:53 PM1/23/18
to jpos-...@googlegroups.com
​Yes , the channel does have it, was aware of it, but getting the right channel to respond to ​from the ISOSource was something 
I was not sure about and then he would have to add the length prefixing to it to as the send(byte[]) just does raw data.

Definitely something worth trying we know which channel the request came on.

-chhil

Alejandro Revilla

unread,
Jan 23, 2018, 7:09:17 PM1/23/18
to jPOS Users
You're right, it's raw data, it doesn't add message length, header, etc so your empty ISOMsg approach is good.

One could also do something similar to the FrozenLogEvent, an ISOMsg whose "pack" method would return your byte[].




chhil

unread,
Jan 23, 2018, 7:19:01 PM1/23/18
to jpos-...@googlegroups.com

One could also do something similar to the FrozenLogEvent, an ISOMsg whose “pack” method would return your byte[].


That would be nice.

-chhil

ombon...@gmail.com

unread,
Jan 23, 2018, 11:25:41 PM1/23/18
to jPOS Users
Hi All,

let's summarise the situation, 

1. condition what i need was  A header + byte data. Just ignore my first post. It has different specification.
2. if i use ISOchannel send(byte[] b), can ISOsource know client address?
    ex: i make a byte from a header + my byte data,  then i use send(byte[] b) function. will ISOsource send to client?
3. I must send only header+byte because our existing system. Hope it answer your curios chill.

I haven't tried this yet. ASA, i will inform here.
Thanks.
Jon




-chhil


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.

Andrés Alcarraz

unread,
Jan 24, 2018, 1:48:11 AM1/24/18
to jpos-...@googlegroups.com

3) of course ISOSource is the client connection to the remote host (or a proxy) but represents the specific connection to the end that initiated the transaction.


El 24/01/18 a las 01:25, ombon...@gmail.com escribió:

ombon...@gmail.com

unread,
Jan 24, 2018, 8:00:47 PM1/24/18
to jPOS Users
Hi all,

finally it's done. After adding some code on base channel send(byte{} b), now its works.
Thanks all

chhil

unread,
Jan 25, 2018, 12:42:08 AM1/25/18
to jpos-...@googlegroups.com
Curious on why you had to update the basechannel and what the update was.
Would you rather have extended your current channel to do what you needed to do? 

-chhil

To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

ombon...@gmail.com

unread,
Jan 25, 2018, 11:05:45 PM1/25/18
to jPOS Users
Hi chill,

I'm adding length and send it to client.  So at all, it not byte only. My bad all, sorry for wrong spesification.But now it works.
Thank all :D

Regards,
jon
Reply all
Reply to author
Forward
0 new messages