I used ISOMessage.setHeader() method to add a header to ISO message
// Code
String header="ISO010100011";
byte[] bytearray=header.getBytes();
m.setHeader(bytearray);
// End code
but when i see message at a log I can message header as
<header>49534F303130313030303131</header> .It is obvious that I can
see it in that way . But I want to send header as a String
( ISO010100011 ) . So is there a any way to handle the header in that
way. Kindly assist me .
I believe the data being sent on the wire be fine....this is the data that
is being printed and if you look at the code of Baseheaderthe dump is doing
a hexstring of the header else you wont see the special unprintable chars...
On Thu, Jul 2, 2009 at 4:27 PM, Suranga <suranga.her...@gmail.com> wrote:
> Hi All,
> Thanks Chhil ,
> I used ISOMessage.setHeader() method to add a header to ISO message
> // Code
> String header="ISO010100011";
> byte[] bytearray=header.getBytes();
> m.setHeader(bytearray);
> // End code
> but when i see message at a log I can message header as
> <header>49534F303130313030303131</header> .It is obvious that I can
> see it in that way . But I want to send header as a String
> ( ISO010100011 ) . So is there a any way to handle the header in that
> way. Kindly assist me .
I got to know that we can set a header to the channel as a example
new NCCChannel(server,port,packager,header) but some channels are not
supported and I'm using BASE24TCPChannel which is also not supported.
is it same with ISOMessage.setHeader() or what is the difference .
Many Thanks,
Suranga.
On Jul 2, 5:02 pm, chhil <chil...@gmail.com> wrote:
> I believe the data being sent on the wire be fine....this is the data that
> is being printed and if you look at the code of Baseheaderthe dump is doing
> a hexstring of the header else you wont see the special unprintable chars...
> On Thu, Jul 2, 2009 at 4:27 PM, Suranga <suranga.her...@gmail.com> wrote:
> > Hi All,
> > Thanks Chhil ,
> > I used ISOMessage.setHeader() method to add a header to ISO message
> > // Code
> > String header="ISO010100011";
> > byte[] bytearray=header.getBytes();
> > m.setHeader(bytearray);
> > // End code
> > but when i see message at a log I can message header as
> > <header>49534F303130313030303131</header> .It is obvious that I can
> > see it in that way . But I want to send header as a String
> > ( ISO010100011 ) . So is there a any way to handle the header in that
> > way. Kindly assist me .
Suranga wrote: > new NCCChannel(server,port,packager,header) but some channels are not > supported and I'm using BASE24TCPChannel which is also not supported. > is it same with ISOMessage.setHeader() or what is the difference .
Yeah, it can be a bit confusing; just like this sentence is.
The header on the Channel would be the place to specify one that is fixed for the life of the channel.
The ISOMsg could be given a header, but especially when the header varies for each message.
If you have a header that never varies, you can hope your chosen Channel takes a header in on it's constructor (or modify it to).
The BaseChannel class checks for a specific ISOMsg.header and use it, if not it will use the Channel.header - if one is present.
BaseChannel.setOverrideHeader(true) could be used to reverse the precedence ISOMsg.header has over Channel.header.
Thanks all for clarify me about all the information and I manged to
add header to message.
One thing I want to know is
Before sending a message through a channel is it necessary to add
packager and pack the message or what is the purpose. Because after
set packager and pack the message I can only see bit map on message
logger (I have already uncommented the entries in dump method ) Kidly
advice.
> Suranga wrote:
> > new NCCChannel(server,port,packager,header) but some channels are not
> > supported and I'm using BASE24TCPChannel which is also not supported.
> > is it same with ISOMessage.setHeader() or what is the difference .
> Yeah, it can be a bit confusing; just like this sentence is.
> The header on the Channel would be the place to specify one that is
> fixed for the life of the channel.
> The ISOMsg could be given a header, but especially when the header
> varies for each message.
> If you have a header that never varies, you can hope your chosen Channel
> takes a header in on it's constructor (or modify it to).
> The BaseChannel class checks for a specific ISOMsg.header and use it, if
> not it will use the Channel.header - if one is present.
> BaseChannel.setOverrideHeader(true) could be used to reverse the
> precedence ISOMsg.header has over Channel.header.
Suranga wrote: > Thanks all for clarify me about all the information and I manged to > add header to message.
> One thing I want to know is
You should get the programmers guide - honestly.
> Before sending a message through a channel is it necessary to add > packager and pack the message or what is the purpose.
An ISOMsg needs a packager if it is going through a Channel.
The Channel will be calling the ISOMsg.pack() method you see, which in turn will call it's Packager.pack() method to gather the raw bytes for the Channel to send over the network.