This is another in an increasing number of threads you start, but do not
continue with; please take a look at your other messages - and my
responses to them - to save me repeating myself?
--
Mark
Here are some related readings on the tasks:
http://www.andyorrock.com/2006/09/implementing_th.html
http://www.andyorrock.com/2007/01/onboarding_a_ne.html
Sanjeeva, you are persistently missing the point - you need to provide
or information and tell us *exactly* what is needed by this host for us
to help you.
The data you want to send to this host is TLV data:-
82 (Application Interchange Profile).
0000 58 00 X.
84
0000 A0 00 00 00 04 10 10 .......
95 (Terminal Verification Results).
0000 40 00 00 80 00 @....
9A (Transaction Data).
0000 09 03 10 ...
9C (Transaction Type).
0000 00 .
5F2A (Transaction Currency Code).
0000 03 92 ..
5F34 (PAN Sequence Number).
0000 01 .
9F02 (Amount, Authorized).
0000 00 09 09 09 09 00 ......
9F09
0000 00 02 ..
9F10 (Issuer Application Data).
0000 01 01 03 A0 28 06 00 00 ....(...
9F1A (Terminal Country Code).
0000 03 56 .V
9F1E (IFD Serial Number).
0000 30 33 35 31 31 36 34 35 03511645
9F26 (Application Cryptogram).
0000 31 22 1B C0 8E 16 3B 78 1"....;x
9F27
0000 80 .
9F33 (Terminal Capability Profile).
0000 E0 E0 C8 ...
9F34
0000 5E 03 00 ^..
9F35 (EMV Terminal Type).
0000 22 "
9F36 (Application Transaction Counter).
0000 05 50 .P
9F37 (Unpredictable Number).
0000 29 13 15 22 ).."
9F53
0000 52 R
But the *important* question is:-
How does the host you want to send it to expect it to look like? Does
it even expect it in field 55, what is the format of this field (for the
host) - binary, ascii character hex, ebcdic character hex. For all we
know it might be expecting the chip data in fields under the third bitmap!
If this data does travel in field 55 then the packager definition of
field 55 must match that which the host is expecting; *and* you need to
know what the host needs in the rest of the message.
Are you really just sending field 55 - I would suspect this host is
giving you an error (96 - system malfunction?) because you have not sent
enough data? As an example, how will the host know which card is in
use, or is the IFD serial enough?
--
Mark
820258008407A0000000041010950540000080009A030903109C01005F2A0203925F3401019F02060009090909009F090200029F1008010103A0280600009F1A0203569F1E0830333531313634359F260831221BC08E163B789F2701809F3303E0E0C89F34035E03009F3501229F360205509F3704291315229F530152"
This is not valid TLV, you are missing a nibble from the value
component! c'82024440' would be valid.
>
> host expecting format for filed 55 is BCD Format..
>
> Ex..
>
> original string is
> String de55="820258008407A0000000041010950540000080009A030903129C01005
> F2A0203925F3401019F02060009090909009F090200029F1008010103A0280600009F1A0203569F1E08303335313
> 13634359F260831221BC08E163B789F2701809F3303E0E0C89F34035E03009F3501229F360205509F3704291315229F530152";
>
> Host Expecting is " 82 02 25 80 ...."
So you have a *binary* field which is not truly bcd (binary coded
decimal). BCD only contains the 'digits' 0123456789, as soon as you
have values >9 (ABCDEF) you have a binary field.
You want to send x'82022580' and not c'82022580' == x'3832303232353830'.
>
> my problem is : now host is taking istead of 82 it is taking 3832.. i want
> only to pass as 82 only...
It is seeing ascii values because you are sending ascii characters,
which means your field 55 definition is ascii and not binary as you need.
You need to make sure the Packager you are using has a binary jpos field
for 55.
What packager are you using? Can you show us how it defines field 55
please? How about posting the entire packager (source or xml)?
You are going to need to worry about the format of the length of the
data in field 55. How is the host expecting the length (of field 55) to
be presented to it? There are options here too.
--
Mark
> i am using jpos 1.4.1 server and using utility is ISOMsg to frame my iso
> messages...
> Example ..
> Object obj = ((ISOBasePackager) packager).getFieldPackager(55);
>
> if i am using this then i am getting the object as
> :org.jpos.iso.IFB_LLLCHAR@4d76b4
Why not show us the packager code or xml itself?
>
>
> .. what i understand from your mail
> '3832303232353830'.
>
> instead of 8 i need to pass as 0x38 .. is this correct..
No, in setting the value of a field you can pass in a String; But the
field that receives this data and will pack it for transmission needs to be
org.jpos.iso.IFB_LLLBINARY
To send binary rather than character data.
You fail to answer my questions, so we will have to assume for now that
you have the correct length structure.
--
Mark
The ISOMsg.set(int,String) will convert it for you as field 55 is an
instance of a ISOBinaryFieldPackager.
>
> Can you please help me on this...
>
> MY Code:
> ISOPackager packager = new ISO93BPackager();
> packager.setLogger(log,"packager-logger");
> org.jpos.iso.header.NACHeader head = new
> org.jpos.iso.header.NACHeader("6002220000");
> iso=new ISOMsg();
> iso.setPackager(packager);
> iso.setHeader(head);
> iso.setHeader(ISOUtil.hex2byte("6002220000"));
> byte [] hea = iso.getHeader();
> logger.fine("header " + hea);
> logger.fine("hexString " + ISOUtil.hexString(hea));
> iso.setMTI(WinPosConstants.SALE_REQUEST);//"0200";
>
> Here i am passing my string..
> iso.set(55,de55);
You don't show how the field de55 is defined, but if it is a String then
with the ISO93BPackager (field 55 == IFB_LLLBINARY) it should just
'work'. Please note that we still don't know (you have not told us) how
the host is expecting to see this EMV data, so I am working on the
limited detail I have picked out of your postings.
If you did want to convert a String of hexadecimal character to a byte[]
of binary data to pass into the ISOMsg.set(int,byte[]), you can use
ISOUtil.hex2byte(String), just like you did in setHeader above :-
iso.setHeader(ISOUtil.hex2byte("6002220000"));
So, now to my questions, please attempt to answer or say that you cannot :-
- Have you changed the packager you are using to ISO93BPackager; what
was it before?
- Why don't you need to pass in a card number, perhaps in field 2?
--
Mark
> previously i have ISOPackager packager = new ISO87BPackager(); and iso=new
> ISOMsg();
> iso.setPackager(packager);
>
Ok at least that explains the difference and improvement.
>
> now i made the change to ISOPackager packager = new ISO93BPackager();
> iso=new ISOMsg();
> iso.setPackager(packager);
>
> in this package is having field 55 IFB_LLLBINARY
>
> finally the host is expecting BCD Format.
I have already mentioned that this statement is not terribly accurate,
but never mind.
>
> if i pass the value like iso.set(55,ISOUtil.hex2byte(String), then i am
> getting the
>
> *Exception:*
> *java.lang.ClassCastException: java.lang.String cannot be cast to [B
> at org.jpos.iso.IFB_LLLBINARY.pack(IFB_LLLBINARY.java:76)
> at org.jpos.iso.ISOBasePackager.pack(ISOBasePackager.java:134)
> at org.jpos.iso.ISOMsg.pack(ISOMsg.java:292)
> at
Can you carefully recheck this please?
If you ran the code :-
iso.set(55,ISOUtil.hex2byte("82024440"));
Then are passing in a byte[] and I don't see how the class cast
exception could occur?
If however you ran the code:-
iso.set(55,"82024440");
then this exception might occur, depending on if the hex2byte helper
code was present in 1.4.1 (see below).
Please ensure you are compiling your code before each run attempt.
> *My JPOs Version is jpos 1.4.1*
Any reason why you cannot use the latest version at all?
In your copy of ISOMsg, does it's ISOMsg.set(int, String) method , look
anything like:-
/**
* Creates an ISOField associated with fldno within this ISOMsg
* @param fldno field number
* @param value field value
*/
public void set(int fldno, String value) throws ISOException {
if (value != null) {
if (!(packager instanceof ISOBasePackager)) {
// No packager is available, we can't tell what the field
// might be, so treat as a String!
set(new ISOField(fldno, value));
}
else {
// This ISOMsg has a packager, so use it
Object obj = ((ISOBasePackager)
packager).getFieldPackager(fldno);
if (obj instanceof ISOBinaryFieldPackager) {
set(new ISOBinaryField(fldno, ISOUtil.hex2byte(value)));
} else {
set(new ISOField(fldno, value));
}
}
}
else
unset(fldno);
}
I don't have 1.4.1 to hand, so can you check for me please?
--
Mark
> After adding this ISOMsg.java,
Adding what please? I asked you to check what your
ISOMsg.set(int,String) looked like, not to change it?
>
> I got this Exception...
So what does the setting of field 55 currently look like for the run
below? Surprisingly this would be nice to know. I know you can see it,
but we can't?
Hold on one second....
.. you are mixing things up left right and centre. This is not the
Exception you said you had just now at all.
>
> Packing Dude at Fri Mar 13 15:51:32 GMT+05:30 2009
> Finsihed Packing Fri Mar 13 15:51:32 GMT+05:30 2009
> <log realm="nac_relm" at="Fri Mar 13 15:51:32 GMT+05:30 2009.973">
[snip log]
> <exception name="[B cannot be cast to java.lang.String">
> java.lang.ClassCastException: [B cannot be cast to java.lang.String
> at org.jpos.iso.IFB_LLLCHAR.pack(IFB_LLLCHAR.java:77)
Why are you back using *IFB_LLLCHAR* again? *This* Exception is because
you are passing a byte[] into a field that is expecting a *String*;
meaning you are trying to use IFB_LLLBINARY but are not!
How are you specifying the packager - on the ISOMsg and on the Channel?
Show your code here, or send it all to me off-list if you would prefer
everyone not to see it.
This random confusion has to stop! If you want help here (from me
anyway), you *must* present all the facts of what you are doing, not a
tiny part and not your interpretation.
Here I go again...
Please read, absorb and even ask questions about :-
www.catb.org/~esr/faqs/smart-questions.html
In my opinion, you really need to do this *before* continuing any further?
Other group members, please pull me up if I am being too harsh - I hope
you would!
--
Mark
I do agree with you. It is sometimes hard to tell when someone is just
not bothering to help themselves rather than struggling with a foreign
language.
Sometimes too I think we have people that are not familiar with any of
the basic problem investigation techniques; assuming that their problem
is someone else's fault. Trust in others code also is a factor; I know
that if something I do with our code does not work first time it is
usually an error I have made.
> but he does not think of the time you spent on him.
Well, I agree this is very likely.
>
> thanks giving is not just saying thanks, one have to demonstrate it
> with fact like making an effort to simplify things to the one you are
> thanking.
I agree again.
>
> I apologize for my english.
No need for apologies, your English puts my Spanish to shame 8).
--
Mark
HelloHai,
Previously i am using ISO87BPackager for my iso messages and NAC Channel is having ISO93Packager, so , there is Mismatch is came.Now i am using same packages in both NAC as well as ISOMsg, my problem resolved.