0

[Update]

I was able to bring up the JPOS client and server simulator on the same box using this link : http://jpos.org/blog/2013/07/setting-up-the-client-simulator/( Please note the setup is pretty similar to one described in the link for running a server simulator too).

What i did next was to basically try to see the tcpdump ( also using wireshark). But what i see is not what i expected. Here's what i see ( Please note the data part)

Data (325 bytes)

0000  3c 69 73 6f 6d 73 67 3e 0a 20 20 3c 21 2d 2d 20   <isomsg>.  <!-- 
0010  6f 72 67 2e 6a 70 6f 73 2e 69 73 6f 2e 70 61 63   org.jpos.iso.pac
0020  6b 61 67 65 72 2e 58 4d 4c 50 61 63 6b 61 67 65   kager.XMLPackage
0030  72 20 2d 2d 3e 0a 20 20 3c 66 69 65 6c 64 20 69   r -->.  <field i
0040  64 3d 22 30 22 20 76 61 6c 75 65 3d 22 31 38 30   d="0" value="180
0050  30 22 2f 3e 0a 20 20 3c 66 69 65 6c 64 20 69 64   0"/>.  <field id
0060  3d 22 37 22 20 76 61 6c 75 65 3d 22 30 37 32 30   ="7" value="0720
0070  30 30 33 36 33 39 22 2f 3e 0a 20 20 3c 66 69 65   003639"/>.  <fie
0080  6c 64 20 69 64 3d 22 31 31 22 20 76 61 6c 75 65   ld id="11" value
0090  3d 22 37 39 39 38 31 33 22 2f 3e 0a 20 20 3c 66   ="799813"/>.  <f
00a0  69 65 6c 64 20 69 64 3d 22 31 32 22 20 76 61 6c   ield id="12" val
00b0  75 65 3d 22 37 39 39 38 30 35 22 2f 3e 0a 20 20   ue="799805"/>.  
00c0  3c 66 69 65 6c 64 20 69 64 3d 22 36 33 22 20 76   <field id="63" v
00d0  61 6c 75 65 3d 22 4d 6f 6e 20 4a 75 6c 20 32 30   alue="Mon Jul 20
00e0  20 30 30 3a 33 36 3a 33 39 20 50 44 54 20 32 30    00:36:39 PDT 20
00f0  31 35 22 2f 3e 0a 20 20 3c 69 73 6f 6d 73 67 20   15"/>.  <isomsg 
0100  69 64 3d 22 31 32 30 22 3e 0a 20 20 20 20 3c 66   id="120">.    <f
0110  69 65 6c 64 20 69 64 3d 22 30 22 20 76 61 6c 75   ield id="0" valu
0120  65 3d 22 32 39 31 31 30 30 30 31 22 2f 3e 0a 20   e="29110001"/>. 
0130  20 3c 2f 69 73 6f 6d 73 67 3e 0a 3c 2f 69 73 6f    </isomsg>.</iso
0140  6d 73 67 3e 0a                                    msg>.
    Data: 3c69736f6d73673e0a20203c212d2d206f72672e6a706f73...
    [Length: 325]

If you look at the data, it looks like the XML ISO Msg. I was expecting something like the HEX representation of ISO 8583 where the first bytes are the MTI and etc etc..

After looking at the client simulator file, i realized that its a XML Channel and packager. I looked at the following channel & packager link here jpos.org/doc/javadoc/org/jpos/iso/packager/package-summary.html jpos.org/doc/javadoc/org/jpos/iso/channel/package-summary.html

After changing the packager to PostChannel and PostPackager, i still see the problems on my client and i see it times out. Was wondering if there was a way to see the actual raw data via tcpdump/wireshark. The most close is the Postilion which has data length prepended to the raw data.

Harry
  • 528
  • 1
  • 5
  • 21
  • After looking at the client simulator file, i realized that its a XML Channel and packager. I looked at the following channel & packager link here http://jpos.org/doc/javadoc/org/jpos/iso/packager/package-summary.html http://jpos.org/doc/javadoc/org/jpos/iso/channel/package-summary.html . Do i need to change to one of the channels and packagers to the one i am looking for ( ex PostChannel and PostPackager) ?? – Harry Jul 20 '15 at 08:28
  • I tried changing to PostChannel and Packager (Postilion which has 2 byte as length prepended to data ), It failed. Was wondering what else needed to changed. – Harry Jul 21 '15 at 01:22

2 Answers2

1

After playing with the PostChannel and PostPackager, i was able to get it running and could see the message. The things i needed to do was basically change both the server simulator and client simulator configurations to use the desired Channel and Packager.

This is what i changed in both the server and client simulator

  1. Server Simulator : Change the file src/dist/deploy/05_serversimulator.xml to use the desired channel and packager
 <channel class="org.jpos.iso.channel.PostChannel" logger="Q2"
       packager="org.jpos.iso.packager.PostPackager">
  1. Client Simulator : Change the file ./src/dist/deploy/10_clientsimulator_channel.xml to use the desired channel and packager
   <channel class="org.jpos.iso.channel.PostChannel" logger="Q2"
       packager="org.jpos.iso.packager.PostPackager">

And then fire up the client and server simulators.

Harry
  • 528
  • 1
  • 5
  • 21
  • Indeed :) If you package requests as XML they will appear raw like XMLs, if you pack them like iso8583 it will appear like iso8583 :) – bbozo Aug 06 '16 at 06:58
0

Channels assist you in connecting to the other entity and add headers, length headers , tpdu etc based on the implementation of the channel used. PostChannel that you use here adds a 2 byte length header containing the size of the message. This assists the receiver in collecting the right amount of bytes from the tcp stream.

Packagers assist you in packing fields in the message, examples are fixed field, length prepended variables fields and what encoding these should have (hex,bcd, ascii).

The client server sims out of the box use xml for understanding the concepts.

chhil
  • 442
  • 4
  • 12