--
--
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/659014e4-abfe-4707-895b-0e613c77f501%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import java.io.IOException;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISORequestListener;
import org.jpos.iso.ISOServer;
import org.jpos.iso.ISOSource;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.channel.NACChannel;
import org.jpos.iso.packager.ISO87APackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;
import org.jpos.util.ThreadPool;
public class Test {
public static void main(String[] args) throws ISOException, IOException {
Logger l = new Logger();
l.addListener(new SimpleLogListener());
NACChannel sc = new NACChannel(new ISO87APackager(), new byte[] { 5, 6, 7, 8, 9 });
sc.setLogger(l, "serverchannel");
ISOServer server = new ISOServer(7776, sc, new ThreadPool(10, 100));
server.setLogger(l, "server");
server.addISORequestListener(new ISORequestListener() {
@Override
public boolean process(ISOSource source, ISOMsg m) {
System.out.println(ISOUtil.hexdump(m.getHeader()));
try {
m.dump(System.out, ">>");
m.setResponseMTI();
source.send(m);
}
catch (ISOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
});
Thread t = new Thread(server);
t.start();
NACChannel cs = new NACChannel("127.0.0.1", 7776, new ISO87APackager(), new byte[] { 0, 1, 2, 3, 4 });
cs.setLogger(l, "clientchannel");
ISOMsg m = new ISOMsg();
m.setMTI("0200");
m.set(2, "123456789");
cs.connect();
cs.send(m);
cs.receive();
}
}
output
<log realm="server" at="Thu Dec 22 15:47:53 IST 2016.283" lifespan="57ms">
<iso-server>
listening on port 7776
</iso-server>
</log>
<log realm="clientchannel/127.0.0.1:7776" at="Thu Dec 22 15:47:53 IST 2016.305" lifespan="82ms">
<connect>
127.0.0.1:7776
</connect>
</log>
<log realm="clientchannel/127.0.0.1:7776" at="Thu Dec 22 15:47:53 IST 2016.309" lifespan="3ms">
<send>
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.ISO87APackager -->
<field id="0" value="0200"/>
<field id="bitmap" value="{2}" type="bitmap"/>
<field id="2" value="123456789"/>
</isomsg>
</send>
</log>
<log realm="serverchannel/127.0.0.1:40262" at="Thu Dec 22 15:47:53 IST 2016.314" lifespan="2ms">
<receive>
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.ISO87APackager -->
<header>0001020304</header>
<field id="0" value="0200"/>
<field id="bitmap" value="{2}" type="bitmap"/>
<field id="2" value="123456789"/>
</isomsg>
</receive>
</log>
>><isomsg direction="incoming">
>> <!-- org.jpos.iso.packager.ISO87APackager -->
>> <header>0001020304</header>
>> <field id="0" value="0200"/>
>> <field id="bitmap" value="{2}" type="bitmap"/>
>> <field id="2" value="123456789"/>
>></isomsg>
<log realm="serverchannel/127.0.0.1:40262" at="Thu Dec 22 15:47:53 IST 2016.315">
<send>
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.ISO87APackager -->
<header>0003040102</header>
<field id="0" value="0210"/>
<field id="bitmap" value="{2}" type="bitmap"/>
<field id="2" value="123456789"/>
</isomsg>
</send>
</log>
<log realm="clientchannel/127.0.0.1:7776" at="Thu Dec 22 15:47:53 IST 2016.316" lifespan="6ms">
<receive>
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.ISO87APackager -->
<header>0003040102</header>
<field id="0" value="0210"/>
<field id="bitmap" value="{2}" type="bitmap"/>
<field id="2" value="123456789"/>
</isomsg>
</receive>
</log>
--
--
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/fc36ccc8-1717-463a-9291-839c5821aef0%40googlegroups.com.
Hi Jayadeep, it would be helpful to see your server simulator setup including your bsh script, maybe you are missing the header when you create the response, how are you building it?
Haw are you sure the sendMessageHeader is not being called at all? It is somehow impossinbe since it is in the path of the send method.
Best regards and happy holidays for all jpos-users group.
Andrés.
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/63cd81aa-2339-42b8-9b22-c8430f6a133d%40googlegroups.com.