ISO Message with the header and trailler

455 views
Skip to first unread message

Heru Nurasid

unread,
Jul 16, 2007, 1:00:50 AM7/16/07
to jpos-...@groups.google.com
Dear all members,
 
I have a problem to build the code of an ISO message with header and  trailler. How to build an ISO message with the header and trailler using JPOS ?.
 
For example an ISO message with ASCII packaging like this : 
 303230303030413030303030303038303030303030303030303333333030303030313030303030303236
with a header 02 and a trailler 03 was added to this ISO message, so  ISO message becomes a new ISO message as follow :
 
 0230323030303041303030303030303830303030303030303030333333303030303031303030303030323603
 
Could you help me for this problem ?. If you don't mind give me a sample of code (programing)  to build an ISO message with the header and trailler as we describe above. I would say thank you for your help and your attention.
 
 
Regards,
 

Heru Nurasid


Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search.

Mark Salter

unread,
Jul 16, 2007, 1:33:51 AM7/16/07
to jpos-...@googlegroups.com
Heru Nurasid wrote:

> For example an ISO message with ASCII packaging like this :
> 303230303030413030303030303038303030303030303030303333333030303030313030303030303236
> with a header 02 and a trailler 03 was added to this ISO message,
> so ISO message becomes a new ISO message as follow :
>
> 0230323030303041303030303030303830303030303030303030333333303030303031303030303030323603
>

I would probably modify your Channel to add (and remove on receive) the
bytes you want to add.

These bytes are use to mark the start and end of a message over a wire,
they look a little out of place on an ISO message, transmitted via TCP/IP?

What Packager and Channel are you using?


--
Mark

Alejandro Revilla

unread,
Jul 16, 2007, 8:11:59 AM7/16/07
to jpos-...@googlegroups.com
>
> I would probably modify your Channel to add (and remove on receive) the
> bytes you want to add.
>
Exactly, in BaseChannel there are some handy methods sendMessageTrailler
and getMessageTrailler as well as their header counterparts that are
easy to extend.

Heru Nurasid

unread,
Sep 7, 2007, 5:35:21 AM9/7/07
to jpos-...@googlegroups.com

I am sorry if I was late to answer your question, because I didn't know how
to join this forum. I have written the code as follow, but any error when I
compiled the code with javac SignOn.java. I used NACChannel and ISO87A
packager.
If You don't mind give me reason why does the error occur ?. Does the code
correct for add the header and the trailler ?. Thanks alot for your answer.


import org.jpos.iso.*;
import org.jpos.iso.channel.*;
import java.util.Date;
import org.jpos.iso.packager.ISO87APackager;
import java.io.*;

public class SignOn extends BaseChannel {


public static void main(String[] args) {

byte[] header = {'0','2'};
byte[] b = {'0','3'};

ISOMsg m=new ISOMsg();
try {
m.setMTI("0800");
m.set(new ISOField(7, ISODate.getDateTime(new Date())));
m.set(new ISOField(11, "000001"));
m.set(new ISOField(70, "061"));
m.set(new ISOField(100, "123456"));
m.setPackager(new ISO87APackager());

NACChannel channel = new NACChannel("localhost", 8000, new
ISO87APackager(), header);
((BaseChannel)channel).sendMessageTrailler(m,b);
channel.connect();
channel.send(m);
ISOMsg response = nc.receive();
if(response!=null){
response.dump(System. out,"");
}
channel.disconnect();
}
catch (ISOException ex) {
}
catch (IOException ex1) {
}
}


}

SignOn.java:26: sendMessageTrailler(org.jpos.iso.ISOMsg,byte[]) has
protected ac
cess in org.jpos.iso.BaseChannel
((BaseChannel)channel).sendMessageTrailler(m,b);
^
1 error

--
View this message in context: http://www.nabble.com/ISO-Message-with-the-header-and-trailler-tf4084537.html#a12551515
Sent from the jPOS - Users mailing list archive at Nabble.com.

Alejandro Revilla

unread,
Sep 7, 2007, 11:03:49 AM9/7/07
to jpos-...@googlegroups.com
> NACChannel channel = new NACChannel("localhost", 8000, new
> ISO87APackager(), header);
> ((BaseChannel)channel).sendMessageTrailler(m,b);
> channel.connect();
> channel.send(m);
>
What is this? you try to send a message trailler before actually getting
a connection to remote host. What you really want is to extend
NACChannel and override the sendMessageTrailler

--Alejandro

Heru Nurasid

unread,
Sep 25, 2007, 12:57:21 AM9/25/07
to jpos-...@googlegroups.com

Thanks Alejandro for your help. I can do it.

++ Heru ++

--
View this message in context: http://www.nabble.com/ISO-Message-with-the-header-and-trailler-tf4084537.html#a12873137

Reply all
Reply to author
Forward
0 new messages