2

Using http://j8583.sourceforge.net/ I have parsed ISO message to XML in Java.

ISO to XML:

 <j8583config>
 <parse>
  <PROCESSINGCODE>000000</PROCESSINGCODE> 
  <SYSTEMTRACEAUDITNUMBER>000001</SYSTEMTRACEAUDITNUMBER> 
  <Cardacceptorterminalidentification>3239313130303031</Cardacceptorterminalidentification> 
  <Reservednational>001054455354204D45535347</Reservednational> 
  <Networkmanagementinformationcode>0301</Networkmanagementinformationcode> 
  </parse>
  </j8583config>

Now I need to do vice-versa. I need to create ISO message from XML.

Can someone please guide for this.

Any help is appreciated.

Dheeraj Kumar
  • 3,917
  • 8
  • 43
  • 80

1 Answers1

0

j8583 doesn't do that. You'll have to parse the XML yourself, create an IsoMessage and set the fields you want from the values in the XML fields.

At most, you could transform the XML to something resembling a message template, then create a MessageFactory and create a message with it, but that sounds terribly inefficient.

Perhaps a XSLT transformation could do the trick?

Chochos
  • 5,155
  • 22
  • 27
  • How would XSLT transformation help with this? Would it transform xml values to binary or something? – Dheeraj Kumar Oct 19 '16 at 06:34
  • It would transform the XML file to an ISO8583 message, which you could then parse with your `MessageFactory` if you add the message type and bitmap yourself. But it's just a guess. – Chochos Oct 19 '16 at 06:35
  • I found some code here: http://read.pudn.com/downloads141/sourcecode/java/612948/src/j8583/example/Example.java__.htm But it has binary/hex inputs. Can something like this work with xml input? – Dheeraj Kumar Oct 19 '16 at 06:37
  • I found some code here: http://read.pudn.com/downloads141/sourcecode/java/612948/src/j8583/example/Example.java__.htm But it has binary/hex inputs. Can something like this work with xml input? – Dheeraj Kumar Oct 19 '16 at 06:44
  • I have followed above link and able to set fields, but not bale to set bitmaps. How j8583 generate an iso message from anything like even from csv... can you please help? – Dheeraj Kumar Oct 20 '16 at 06:50
  • j8583 does not parse csv or xml. It only parses ISO8583. – Chochos Oct 25 '16 at 18:16