Translate.Java
...public int prepare(long id, Serializable context) { Context ctx = (Context) o; HSMChannel channel = new HSMChannel(); channel.setPackager(new DummyPackager()); Properties props = new Properties (); props.put ("basepath", "file:schema/hsm-"); props.put ("host", "localhost"); props.put ("port", "5555"); Configuration c = new SimpleConfiguration (props); channel.setConfiguration(c); channel.connect(); FSDISOMsg msg = (FSDISOMsg) channel.createMsg(); msg.set("command","E123"); msg.set("KK", "00"); channel.send(msg); FSDISOMsg rec = (FSDISOMsg) channel.receive(); ctx.put("HSMRes", rec, true);
}...
RemoteJava.java
...public int prepare(long id, Serializable context) { Context ctx = (Context) o; FSDISOMsg fsd = (FSDISOMsg) ctx.get("HSMRes"); ISOMsg m = (ISOMsg) ctx.get("INCOMING");
QMUX mux = (QMUX) NameRegistrar.get("muxName"); m.set(52,fsd.get("PINBLOCK")) ISOMsg r = mux.request(m,100000);
}...
Your process looks good.
If your hsm supports echoing back of fields and is not a constant , use a channel adaptor and mux for the hsm with the unique echoed field as the mux key.
Use a mux to send and receive the message to and from the hsm.
-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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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/f6bf04ae-d14b-400f-8363-7e2aadf03389%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[File] 21_hsm_channel.xml :
<?xml version="1.0" encoding="UTF-8"?>
<channel-adaptor class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2" name="HSMChannel"> <channel class="org.jpos.iso.channel.FSDChannel" logger="Q2" packager="org.jpos.iso.packager.DummyPackager">
<property name="schema" value="file:cfg/hsm-resp-" /> <property name="packager-logger" value="Q2" /> <property name="host" value="192.168.xxx.xxx" /> <property name="port" value="xxxxx" /> </channel> <in>hsm-send</in> <out>hsm-receive</out>
</channel-adaptor>
====================================================================================================
[File] 31_hsm_mux.xml :
<?xml version="1.0" encoding="UTF-8"?><channel-adaptor class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2" name="HSMChannel"> <channel class="org.jpos.iso.channel.FSDChannel" logger="Q2" packager="org.jpos.iso.packager.DummyPackager">
<property name="schema" value="file:cfg/hsm-resp-" /> <property name="packager-logger" value="Q2" /> <property name="host" value="192.168.13.62" /> <property name="port" value="5100" /> </channel> <in>hsm-send</in> <out>hsm-receive</out>
</channel-adaptor>
====================================================================================================
[File] hsm-CA.xml :
<?xml version="1.0" encoding="UTF-8"?><schema id="CA"> <field id="source-tpk" type="A" length="33" /> <field id="destination-zpk" type="A" length="33" /> <field id="maximum-pin-length" type="N" length="2" /> <field id="source-pin-block" type="A" length="16" /> <field id="source-pin-block-format-code" type="N" length="2" /> <field id="destination-pin-block-format-code" type="N" length="2" /> <field id="account-number" type="N" length="12" /> <field id="end-message-delimeter" type="C" length="1" /> <field id="message-trailer" type="A" length="32" /></schema>
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/3dd14f43-2d87-49fb-8720-d0e792269fb7%40googlegroups.com.
[File] 31_hsm_mux.xml :
<?xml version="1.0" encoding="UTF-8"?><mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="HSMMux"> <in>hsm-receive</in> <out>hsm-send</out></mux>
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
<?xml version="1.0" ?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="thales-mux">
<in>thales-receive</in>
<out>thales-send</out>
<key>stan</key>
<ready>thales-adaptor-channel.ready</ready>
<unhandled>thales-unhandled</unhandled>
</mux>
<?xml version="1.0" encoding="UTF-8"?>
<schema>
<field id="stan" type="N" length="4"/>
<field id="command" type="A" length="2" key="true" />
</schema>
<schema>
<field id="stan" type="N" length="4" />
<field id="response" type="A" length="2" key="true" />
<field id="error" type="A" length="2" />
</schema>
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/dd00a79e-dc66-46ea-845d-7bbe3c98fc06%40googlegroups.com.
<log realm="Q2.system" at="Fri Dec 08 11:51:55 PHT 2017.549"> <info> deploy:/var/lib/tomcat6/Q2/31_hsm_mux.xml </info></log><log realm="org.jpos.q2.iso.QMUX" at="Fri Dec 08 11:51:55 PHT 2017.553"> <warn> init <iso-exception> java.lang.NumberFormatException: For input string: "stan" <nested-exception> java.lang.NumberFormatException: For input string: "stan" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:492) at java.lang.Integer.parseInt(Integer.java:527) at org.jpos.q2.iso.QMUX.toIntArray(QMUX.java:383) at org.jpos.q2.iso.QMUX.initService(QMUX.java:67) at org.jpos.q2.QBeanSupport.init(QBeanSupport.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75) at sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.jpos.q2.QFactory.createQBean(QFactory.java:112) at org.jpos.q2.Q2.deploy(Q2.java:425) at org.jpos.q2.Q2.deploy(Q2.java:255) at org.jpos.q2.Q2.run(Q2.java:164) at java.lang.Thread.run(Thread.java:724) </nested-exception> org.jpos.core.ConfigurationException: java.lang.NumberFormatException: For input string: "stan" (java.lang.NumberFormatException: For input string: "stan") at org.jpos.q2.iso.QMUX.toIntArray(QMUX.java:386) at org.jpos.q2.iso.QMUX.initService(QMUX.java:67) at org.jpos.q2.QBeanSupport.init(QBeanSupport.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75) at sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.jpos.q2.QFactory.createQBean(QFactory.java:112) at org.jpos.q2.Q2.deploy(Q2.java:425) at org.jpos.q2.Q2.deploy(Q2.java:255) at org.jpos.q2.Q2.run(Q2.java:164) at java.lang.Thread.run(Thread.java:724)Nested:java.lang.NumberFormatException: For input string: "stan" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:492) at java.lang.Integer.parseInt(Integer.java:527) at org.jpos.q2.iso.QMUX.toIntArray(QMUX.java:383) at org.jpos.q2.iso.QMUX.initService(QMUX.java:67) at org.jpos.q2.QBeanSupport.init(QBeanSupport.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75) at sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.jpos.q2.QFactory.createQBean(QFactory.java:112) at org.jpos.q2.Q2.deploy(Q2.java:425) at org.jpos.q2.Q2.deploy(Q2.java:255) at org.jpos.q2.Q2.run(Q2.java:164) at java.lang.Thread.run(Thread.java:724) </iso-exception> </warn></log>
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/f94c6834-8cc4-462b-a090-28e1188354c2%40googlegroups.com.