I posted this to the forum last week, but have not heard anything, so I am posting it as a new request.
I am new to both 8583 and to this framework (which so far is really nice)
I am creating a new 0200 message using the code in the Client example. My config.xml for the relevant part is:
<template type="0200">
<field num="2" type="LLVAR">8765432109876543210</field>
<field num="3" type="NUMERIC" length="6">000000</field>
<field num="4" type="AMOUNT">2000</field>
<field num="18" type="NUMERIC" length="4">0000</field>
<field num="32" type="LLVAR">0000</field>
<field num="37" type="ALPHA" length="12">000000000001</field>
<field num="41" type="ALPHA" length="8">00000000</field>
<field num="49" type="NUMERIC" length="3">840</field>
<field num="58" type="NUMERIC" length="10">1000010002</field>
<field num="63" type="ALPHA" length="2">00</field>
</template>
When I create a message
IsoMessage req = mfact.newMessage(0x200);
req.setValue(2, "0123456789012345678", IsoType.LLVAR, 0);
req.setValue(4, 20.00, IsoType.AMOUNT, 0);
req.setValue(12, req.getObjectValue(7), IsoType.TIME, 0);
req.setValue(13, req.getObjectValue(7), IsoType.DATE4, 0);
req.setValue(15, req.getObjectValue(7), IsoType.DATE4, 0);
req.setValue(37, System.currentTimeMillis() % 1000000, IsoType.NUMERIC, 12);
I see what I expect:
TYPE: 0200
F 2(LLVAR): 0123456789012345678 -> '0123456789012345678'
F 3(NUMERIC): 000000 -> '000000'
F 4(AMOUNT): 20.00 -> '000000002000'
F 7(DATE10): Thu May 22 19:17:54 PDT 2008 -> '0522191754'
F 11(NUMERIC): 3990 -> '003990'
F 12(TIME): Thu May 22 19:17:54 PDT 2008 -> '191754'
F 13(DATE4): Thu May 22 19:17:54 PDT 2008 -> '0522'
F 15(DATE4): Thu May 22 19:17:54 PDT 2008 -> '0522'
F 18(NUMERIC): 0000 -> '0000'
F 32(LLVAR): 0000 -> '0000'
F 37(NUMERIC): 74006 -> '000000074006'
F 41(ALPHA): 00000000 -> '00000000'
F 49(NUMERIC): 840 -> '840'
F 58(NUMERIC): 1000010002 -> '1000010002'
F 63(ALPHA): 00 -> '00'
I then send it:
req.write(sock.getOutputStream(), 2);
What I parse this on the server end right after getting it:
log.debug(String.format("Parsing incoming: '%s'", new String(msg)));
I see:
Parsing incoming: '?0200723A400108808042000000000000002000052219175400399019175405220522000004000000000007400600000000840100001000200'
which is missing the second field LLVAR
It looks like it is not getting written out.
Any ideas why? Any more info you need?
Thanks!
Anonymous
Did you add field 2 to the <parse type="0200"> section of the config.xml file? If you don't specify it in the template, the field will be ignored. I suppose I need to log some kind of warning when an incoming message contains fields not specified in the parse template.
The latest SVN version of MessageFactory warns you if you give it a message to parse that has fields not specified in the parsing guide.
Is the "parsing incoming" message showing the data you read from the socket, or is that an already parsed IsoMessage?
I suspect you don't have field 2 defined as LLVAR in the parse guide for messages of type 200.