I trying to create an ISO 8583 message using the openiso8583 library
It did not have field no 17 (Date, capture) so I extended the class.
Iso8583Finacle msg = new Iso8583Finacle();
msg.MessageType = Iso8583.MsgType._0120_AUTH_ADV;
msg[Iso8583Finacle.Bit._003_PROC_CODE] = "310000";
msg[Iso8583Finacle.Bit._004_TRAN_AMOUNT] = "0000000000000000";
msg[Iso8583Finacle.Bit._011_SYS_TRACE_AUDIT_NUM] = "380767397537";
msg[Iso8583Finacle.Bit._012_LOCAL_TRAN_DATETIME] = "20131003075957";
msg[Iso8583Finacle.Bit._017_CAPTURE_DATE] = "20131003";
However, it is throwing an error.
UnknownFieldException was unhandled
Field 17 is unknown
Can anyone tell me how to properly extend the message class?
When you extend the class, you need to override the CreateField method to return the correctly formatted field. Have a look at the wiki page for extending a message
https://code.google.com/p/openiso8583net/wiki/ExtendingIso8583