The first two 0s represent the header.
Venon Mapfunde(PMP,Msc Software Engineering,Bsc Computer Science & Mathematics) Tel:+263 775 091 262 Email:taka...@gmail.com Skype: venon.mapfunde
--
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CACSnBajs%2B%2BVUcyWMksseu5gQPn-_m_m-yu378qGXOJedz1yHAg%40mail.gmail.com.
--
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/8cd2fe2f-b908-4d87-860e-83645cc33fc6n%40googlegroups.com.
Andrés Alcarraz
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/87de3ed6-bb7c-40eb-82b8-0ce5f5f76892n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/e8b44fa7-f805-4921-bb3b-b275d7d4efd1%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CACSnBaivAPp8omG-XmLnVrPK5Y1XguBNYtHA%3Die7MM878v2PHA%40mail.gmail.com.
package com.samsoftx.hsm.hsmclient;
import com.samsoftx.hsm.hsmclient.rest.JposController;
import lombok.extern.log4j.Log4j2;
import org.jpos.iso.ISOChannel;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.channel.NACChannel;
import org.jpos.iso.packager.GenericPackager;
import org.jpos.iso.packager.PackagerWrapper;
import org.jpos.iso.packager.PostPackager;
import org.jpos.util.LogSource;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.io.IOException;
import java.net.SocketException;
import static org.jpos.iso.ISOMsg.OUTGOING;
@SpringBootApplication
@Log4j2
public class HsmClientApplication implements CommandLineRunner {
// private final JposController jposController;
isoMsg.set(52, ISOUtil.hex2byte("B25CCEA90A659470"));
isoMsg.set(53, ISOUtil.hex2byte("A100203476E00003"));
String field55Value = "FF2081CA9F02060000000002809F03060000000000004F07A0000007790000820218009F360200B79F0702FFC09F2608F041D289899BCECD9F2701808E0E0000000000000000020102031F039F34030203009F1E0845303635333447369F0D05008834F8009F0E053070C800009F0F05008834F8009F10200FA501A301C0000000000000000000000F0100000000000000000000000000009F090200969F330364D0C89F1A0207169F350122950580800480005F2A0209329A032311069F4104000000039C01009F3704CBE68AE7";
isoMsg.set(55, ISOUtil.hex2byte(field55Value));
isoMsg.setPackager(packager);
return sendRequest(isoMsg);
}
private ISOMsg sendRequest(final ISOMsg isoMsg) throws Exception {
log.info("########################### Sending Messages: {}");
try {
final Logger logger = new Logger();
logger.addListener(new SimpleLogListener(System.out));
// final ISOChannel channel = new NACChannel("197.211.198.153", 9305, new PostPackager(), null);
//final ISOChannel channel = new NACChannel("197.211.198.153", 9305, new PostPackager(), ISOUtil.hex2byte("0"));
final ISOChannel channel = new NACChannel("197.211.198.153", 9305, packager, ISOUtil.hex2byte("0"));
((LogSource) channel).setLogger(logger, "xml-server-9000");
channel.connect();
channel.send(isoMsg);
final ISOMsg response = channel.receive();
return response;
} catch (final IOException | ISOException ex) {
if (ex instanceof SocketException) {
log.info("########################### Issuer unavailable: {}", ex.getMessage());
}
log.info("########################### Failing to connect: {}", ex.getMessage());
throw new IOException("Failed to connect");
}
}
}
<isofieldpackager
id="48"
length="9999"
emitBitmap="false"
name="Additional data - private"
class="org.jpos.iso.IFA_LLLLCHAR"
packager="org.jpos.iso.packager.GenericSubFieldPackager">
<isofield
id="1"
length="19"
name="POS DATA"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="16"
length="999"
name="Structured Data"
class="org.jpos.iso.IFA_LLLCHAR"/>
</isofieldpackager>
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/JjP3UoOxuXL13-Q81rEy670iPgrOrEGydDXxT3h0yBe0EZSbw9x13skRGtfjE7T5qDf6pWc4ggTmuUGeIRoTI619Mn0uAP5v0_Fm_wj-P04%3D%40pm.me.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CACSnBajZo1U_eE2bMgUK__ist%3DuYuxksGQdGsQkg%3DJtdejK6qw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/1-mfS-TvL3m8uQABA841ZiANsVTH3vK6oeH1qyVWj__8_VUTuUsGnZlCBQS6skWv2ganOzdEGCv2w0gJUiosHhZQR1XxxonK6Pj_UEJAKG8%3D%40pm.me.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CACSnBag-gyyvbg_6JQpnWLkT_%3DvJ9NAe_vdcxT9ry7Xrh_HPcA%40mail.gmail.com.
<dependency>
<groupId>org.jpos</groupId>
<artifactId>jpos</artifactId>
<version>2.1.6</version>
</dependency>
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/GYWndJn_Ebi2SqIzLigODwQcZtdX0yZek4nk8uo8g4Ruj0ZhgNanOtivVmexEEYxDbTyj1-iTa772bpi5AmHJwAADMibUUId80GWTlFXiT0%3D%40pm.me.
Currently using this version:<dependency> <groupId>org.jpos</groupId> <artifactId>jpos</artifactId> <version>2.1.6</version> </dependency>
I am thinking it is because you have not defined field 2 through 15; but am not sure.
Can you run under debug and confirm what is null, or try renumber number 16 subfield to 2 temporarily (in packager definition and code) just to check. If it works as '2' instead of '16', then define some dummy definitions for 2 through 15 (repeat sub field 1 since you are not setting for a quick try) and try again.
I can't say I have ever tried a generic packager with 'missing' or gaps in the sequence of subfield ids, but I think it might be that, so have a try as it is easier for you do/try than for me to make something up :-)
--
Mark
--
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/e7adf3e3-521d-4272-bad6-a685c3c6721e%40protonmail.com.