How to create the XML for DE-48 and DE-55

1,360 views
Skip to first unread message

bharath kumar

unread,
Oct 25, 2016, 7:03:04 AM10/25/16
to jPOS Users
Hi All,

I am new to JPOS, I am trying to send and receive the ISOMsg using htest simulator and Finsim, Field DE-48 is contains 100 subelement, while i am receiving the data(R9203421) from channel, i am getting as  child element tag value (ID+length+data) format.

currently i am using below xml format:
<isofield id="48" length="999" name="Additional Data - Private Use" class="org.jpos.iso.IFE_LLLCHAR" />
<< whether i need to create 100 subelement tags inside DE-48? >>

currently i am getting data as.
      <field id="48" value="R9203421"/>

But i am expecting value from  below format. Please guide me what value need to change in the existing XML.
 <isomsg id="48">
        <field id="1" value="R"/>
        <field id="92" value="421"/>
      </isomsg>

Field DE-55 is in binary data format. please suggest how to parse the DE-55 without TLV tag?
<isofield id="55" length="255" name="ICC Chip Card data" class="org.jpos.iso.IFE_LLLBINARY" />

      <field id="55" value="9F02060000000010009F03060000000000009F1A020344950500000000005F2A0200369A031610259C01009F3704628CFF0A82025C009F36020ABD9F10120114A50000040000DAC1006FDCF5FB1100FF9F3303E0E0809F2701809F2608AF3C31DB6CCCE0B45F280200369F34030103029F1E0F3334333433373337333736333833319F3403420302" type="binary"/>

Thanks & Regards
Bharathkumar J

chhil

unread,
Oct 25, 2016, 7:40:41 AM10/25/16
to jPOS Users

You need to get the whole field and do the tlv (tag length value)  parsing yourself.
If field 55 is using ber tlv,  you can use the jpos provided parser tlvlist (I think that's what it's called).

Having said this there is a newer tlv package in the jpos repo that allows you to set up the packagers to display the data like you want in the log file and access the tag field's value . You need to look up the test cases for tagged field in the repo to understand how it's used.

I would recommend going the route of parsing it out yourself. 

-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/e081dee0-892d-40ba-bdb7-d6d4d03152b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bharath kumar

unread,
Oct 25, 2016, 7:58:34 AM10/25/16
to jPOS Users
Hi Chhil,

Thanks for quick reply, 
For Field De-48, I am unable to parse the data using below TLV code,

  TLVList tlv = new TLVList(); 
tlv.unpack((byte[])response.getValue(48)); 
byte[] iad = null;       
int tag; 
Enumeration enume = tlv.elements(); 
System.out.println(enume);
while(enume.hasMoreElements()){ 
TLVMsg tlvq = (TLVMsg)enume.nextElement(); 
 iad = tlvq.getValue(); 
 tag = tlvq.getTag(); 
 System.out.println(Integer.toHexString(tag) + " : "  +ISOUtil.hexString(iad));

I am getting classcast exception
java.lang.String cannot be cast to [B

Please suggest how to parse the DE-48 value?

Thanks & Regards
Bharathkumar J

Mark Salter

unread,
Oct 25, 2016, 3:05:44 PM10/25/16
to jpos-...@googlegroups.com
On 25/10/16 12:58, bharath kumar wrote:
> I am getting classcast exception
> java.lang.String cannot be cast to [B
Full Exception?

--
Mark

Mark Salter

unread,
Oct 25, 2016, 6:39:32 PM10/25/16
to jpos-...@googlegroups.com
On 25/10/16 12:58, bharath kumar wrote:
> tlv.unpack((byte[])response.getValue(48));

Is it this line failing?

What is your packager for field 48?

--
Mark

bharath kumar

unread,
Oct 26, 2016, 2:58:36 AM10/26/16
to jPOS Users
Hi Mark,

I am using GenericPackager for this fields.

-- 
Bharath

chhil

unread,
Oct 26, 2016, 3:19:27 AM10/26/16
to jpos-...@googlegroups.com

There ​are​ a different​ types of TLV (tag length value).

One is of type e.g. 001006ABCDEF thats tag 001 , length 6 and value ABCDEF where tag and length are 3 wide each (they could be any size, in this example its 3 each).

You cannot use TLVList to parse this, TLVList is specific for BER TLV (search the group or google to understand the format). Usually EMV data in a field uses this format (maybe your field 55 can use it).

For field 48 if its not BER TLV , you need to parse it yourself or use jpos TaggedField packagers (I recommend you parse it by writing simple java class.

​​

I am using GenericPackager for this fields.

You need to write your own packager xml or use an existing one based on your specification.

​ What mark was asking , what is the definition of field 48 inside your packager xml file.​

​As an example 
https://github.com/jpos/jPOS/blob/master/jpos/src/dist/cfg/packager/postpack.xml#L253-L257

In your deploy file for the channel, you specify you xml file location, jpos will create the packager using something like

​...​

GenericPackager pkg = new GenericPackager (xml packager file location).

​-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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/5369ebd1-540c-4bb8-9f8c-8fdfee5cbc4a%40googlegroups.com.

bharath kumar

unread,
Oct 26, 2016, 5:32:55 AM10/26/16
to jPOS Users
Hi All,

I am fixed DE-48 XML, I have used MasterCardEBCDICSubFieldPackager packager and IFMC_LLCHAR to solve the problem.

Thank you helping me to figure-out  DE48, Now i am trying to create a XML for DE-55,

my doubt is,  Is it possible to create XML for DE-55 or we have to use TLVList only?

DE-48 XML:
 <isofieldpackager id="48" length="999" name="Additional Data - Private Use" class="org.jpos.iso.IFE_LLLCHAR" packager="org.jpos.iso.packager.MasterCardEBCDICSubFieldPackager">
        <isofield id="0" name="TCC" length="1" class="org.jpos.iso.IF_CHAR" />
         <isofield 
          id="92" 
          length="6" 
          name="CVC 2 or CVV2" 
          class="org.jpos.iso.IFMC_LLCHAR"/> 
    </isofieldpackager>

Regards
Bharathkumar J
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.

chhil

unread,
Oct 26, 2016, 6:21:54 AM10/26/16
to jpos-...@googlegroups.com
You can follow the emv test code on how the packager needs to be set up. I suggest cloning the repo and exploring the code a bit.



Having said this, I would recommend using tlvlist.

-chhil




To unsubscribe, send email to jpos-users+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/3f00c8a1-5210-4971-943b-fae66f923764%40googlegroups.com.

Victor Salaman

unread,
Oct 26, 2016, 7:49:51 AM10/26/16
to jpos-...@googlegroups.com
Is your endpoint expecting an XML encoded field 55?

/V

To unsubscribe, send email to jpos-users+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/3f00c8a1-5210-4971-943b-fae66f923764%40googlegroups.com.

bharath kumar

unread,
Oct 26, 2016, 8:16:27 AM10/26/16
to jPOS Users
Hi,

I am using Binary for receiving data, i am getting like below:

 <field id="55" value="9F02060000000010009F03060000000000009F1A020344950500000000005F2A0200369A031610269C01009F3704E84BD67082025C009F36020B1B9F10120114A50000040000DAC100E89B48956800FF9F3303E0E0809F2701809F26089357AE64B67A525C5F280200369F34030103029F1E0F3334333433373337333736333833319F3403420302" type="binary"/>

XML for the above field is <isofield id="55" length="999" name="ICC Chip Card data" class="org.jpos.iso.IFE_LLLBINARY" />

While doing manual parser i am able to get TLV value 

9f02 : 000000001000
9f03 : 000000000000
9f1a : 0344
95 : 0000000000
5f2a : 0036
9a : 161026
9c : 00
9f37 : E84BD670
82 : 5C00
9f36 : 0B1B
9f10 : 0114A50000040000DAC100E89B48956800FF
9f33 : E0E080
9f27 : 80
9f26 : 9357AE64B67A525C
5f28 : 0036
9f34 : 010302
9f1e : 333433343337333733373633383331
9f34 : 420302


My doubt is whether we can receive a XML format instead of binary data like below

 <isomsg id="48">
        <!-- org.jpos.iso.packager.MasterCardEBCDICSubFieldPackager -->
        <field id="0" value="R"/>
        <field id="92" value="421"/>
      </isomsg>


Thanks & Regards
Bharath

chhil

unread,
Oct 26, 2016, 9:36:07 AM10/26/16
to jpos-...@googlegroups.com
Did you even try the links that were provided that would enable you to get a pretty log ?

Alternatively you can always add the parsed TLV to the context of your participant and pretty print it.

-chhil

To unsubscribe, send email to jpos-users+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/1eca2aed-c150-4915-acd4-7b8182431f3d%40googlegroups.com.

Mark Salter

unread,
Oct 27, 2016, 4:57:32 PM10/27/16
to jpos-...@googlegroups.com
On 26/10/16 07:58, bharath kumar wrote:
> I am using GenericPackager for this fields.
I can see this is going to be a struggle.

I wanted to know how the packager define field 48.

You have not answered either of my other questions and so have not
provided the detail that will help us help you solve why you have failed
to use the TLV processing that will suit your needs.

--
Mark

Mark Salter

unread,
Oct 27, 2016, 5:01:43 PM10/27/16
to jpos-...@googlegroups.com
On 26/10/16 13:16, bharath kumar wrote:
> I am using Binary for receiving data, i am getting like below:
>
> <field id="55"
> value="9F02060000000010009F03060000000000009F1A020344950500000000005F2A0200369A031610269C01009F3704E84BD67082025C009F36020B1B9F10120114A50000040000DAC100E89B48956800FF9F3303E0E0809F2701809F26089357AE64B67A525C5F280200369F34030103029F1E0F3334333433373337333736333833319F3403420302"
> type="binary"/>

Get, tlv data in a binary field.
>
> XML for the above field is <isofield id="55" length="999" name="ICC Chip
> Card data" class="org.jpos.iso.IFE_LLLBINARY" />
The packager definition for field 48 is org.jpos.iso.IFE_LLLBINARY - ok.

>
> While doing manual parser i am able to get TLV value
Whyspend a second, share the full exception stack detail and get help to
correct your code - which is wrong?

>
> 9f02 : 000000001000
[manual tlv output snip]
> 9f34 : 420302
This data will parse cleanly with TLVList if you correct your code.

>
>
> My doubt is whether we can receive a XML format instead of binary data
> like below
"Receive" from your requesting system or just as output format in the log?

>
> <isomsg id="48">
> <!-- org.jpos.iso.packager.MasterCardEBCDICSubFieldPackager -->
> <field id="0" value="R"/>
> <field id="92" value="421"/>
> </isomsg>
Can you confirm in the request - as xml or in the log output?

--
Mark

Victor Salaman

unread,
Oct 27, 2016, 5:22:37 PM10/27/16
to jpos-...@googlegroups.com
I stopped following this thread. I can't understand what the author is trying to achieve.

The DE55 is correctly formatted as BER TLVs from his example, yet he wants to parse/express as XML. The most important aspect in working with a community is learning how to formulate questions correctly so everyone understands the point your trying to get across. Here, the question has eluded me :(

/V

--
--
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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/38ee0554-2c64-083f-eab5-b0c8af3919b3%40talktalk.net.

Mark Salter

unread,
Oct 27, 2016, 5:59:37 PM10/27/16
to jpos-...@googlegroups.com
On 27/10/16 22:22, Victor Salaman wrote:
> I stopped following this thread. I can't understand what the author is
> trying to achieve.
I nearly did, but then thought I would at least fight for answers to
question that will I think solve the issue and kill the thread.

>
> The DE55 is correctly formatted as BER TLVs from his example, yet he
> wants to parse/express as XML. The most important aspect in working with
> a community is learning how to formulate questions correctly so everyone
> understands the point your trying to get across. Here, the question has
> eluded me :(
I hope to clear that - I think the OP wants to log as xml structure of
the TLV instead of the 'binary' string; we shall - I hope - see


--
M

chhil

unread,
Oct 28, 2016, 2:57:38 PM10/28/16
to jpos-...@googlegroups.com
If the complete thread is traversed,my understanding of the problem:
He uses a subfield packager that is displaying the subfields in xml format for field 48. He wants to display field 55 contents similarly. He has been told multiple times if he wants to do that he would need to use the tagged field packager in his xml packager file. 
Use of tlvlist was recommended and log it himself in a pretty format.

-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+unsubscribe@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+unsubscribe@googlegroups.com.

Mark Salter

unread,
Oct 29, 2016, 3:50:20 AM10/29/16
to jpos-...@googlegroups.com
On 28/10/16 19:57, chhil wrote:
> If the complete thread is traversed,my understanding of the problem:
> He uses a subfield packager that is displaying the subfields in xml
> format for field 48. He wants to display field 55 contents similarly. He
> has been told multiple times if he wants to do that he would need to use
> the tagged field packager in his xml packager file.
> Use of tlvlist was recommended and log it himself in a pretty format.
I agree.

It is just that this person has no idea how to ask for what we think he
wants, and doesn't care to answer question that would help him to do so.

I do think 'we' do too much work here, the OP is the person responsible
for all heavy lifting.

If they can't and don't 'see' or answer any questions asked then I don't
want to help them...

... until they start to help themselves.

I notice the waves of ignorance presented here sometimes seem to follow
a time trend that I suffer in my 'real' work - and I am getting sick of
it there too :-)

--
Mark

bharath kumar

unread,
Nov 2, 2016, 7:42:44 AM11/2/16
to jPOS Users
Hi All,

Thanks for your help, sorry i went for a holiday, that's why i did't reply for your message.

Chhil is correct:
"He uses a subfield packager that is displaying the subfields in xml format for field 48. He wants to display field 55 contents similarly. He has been told multiple times if he wants to do that he would need to use the tagged field packager in his xml packager file. 
Use of tlvlist was recommended and log it himself in a pretty format."

 I am trying to form the XML tag for DE-48, have to try chhil suggestion.

Regards
Bharath

Mark Salter

unread,
Nov 2, 2016, 8:33:52 AM11/2/16
to jpos-...@googlegroups.com
On 02/11/16 11:42, bharath kumar wrote:
> I am trying to form the XML tag for DE-48, have to try chhil suggestion.
I don;t think you do, but perhaps you are not as confused as you seem.

by the way you have replied on an Off Topic branch of this discussion
and messed up the formatting - the web interface on groups is really
bad, so don't feel too bad :-)

But you might want to reply to a more relevant post with the real
explanation of what you are trying to achieve - we don;t know yet you
see :-)

--
Mark
Reply all
Reply to author
Forward
0 new messages