如何在JMETER的ISO8583采样器中获取发送到服务器的字节数组?

huangapple 未分类评论41阅读模式
英文:

How can I get the byte array that is sent to server in JMETER for ISO8583 sampler?

问题

30 32 30 30 45 32 33 45  30 36 38 31 32 30 43 31
39 30 30 43 30 30 30 30  30 30 30 30 31 30 30 30
30 30 30 31 31 36 36 32  37 33 38 31 32 30 36 30
30 30 31 33 35 36 33 31  30 30 30 30 30 34 30 34
30 31 34 30 32 31 32 31  39 32 32 35 30 31 34 30
32 31 30 34 30 34 39 38  30 32 30 38 30 38 30 32
31 30 30 30 30 32 30 36  36 32 37 33 38 31 32 38
36 32 37 33 38 31 32 30  36 30 30 30 31 33 35 36 
3D 39 38 30 32 31 30 31  32 32 37 32 4C 6F 63 61 
6C 20 20 20 4D 65 72 63  68 61 6E 74 31 32 33 34
35 36 37 30 30 34 36 37  31 31 38 36 42 30 42 38
31 30 31 33 30 33 36 34  36 39 34 34 45 37 35 36
31 36 45 43 35 44 42 37  30 30 36 38 38 38 39 39
39 30 30 36 30 30 30 30  30 31 30 36 36 32 37 33
38 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31
31 31 
英文:

I am trying to request the byte array that in ISO8583 Sampler generate (has been packed) for generate field 128 for my ISO Message.

Now when I try to get it in JSR233 Assertion with this code in script part :

log.info("******sampler data***** ="+ prev.getSamplerData() );

the result that is generated is :

2020-04-04 01:40:27,560 INFO o.a.j.a.J.JSR223 Assertion: ******sampler data***** =<isomsg direction="outgoing">
  <!-- org.jpos.iso.packager.GenericPackager[G:/switchRepository/integration-test/src/test/resources/iso-isopackager-v87-tosan-plus-test.xml] -->
  <field id="0" value="0200"/>
  <field id="2" value="45853812060001356"/>
  <field id="3" value="310000"/>
  <field id="7" value="0404014021"/>
  <field id="11" value="219225"/>
  <field id="12" value="014021"/>
  <field id="13" value="0404"/>
  <field id="14" value="9802"/>
  <field id="15" value="0808"/>
  <field id="22" value="021"/>
  <field id="23" value="000"/>
  <field id="25" value="02"/>
  <field id="32" value="627381"/>
  <field id="35" value="6273812060001356=98021012272"/>
  <field id="41" value="LLLLL"/>
  <field id="42" value="MMMMMMMM1234567"/>
  <field id="49" value="364"/>
  <field id="52" value="6944E75616EC5DB7"/>
  <field id="61" value="888999"/>
  <field id="62" value="000001"/>
  <field id="128" value="1111111111111111"/>
</isomsg>

<!--
0000  30 32 30 30 45 32 33 45  30 36 38 31 32 30 43 31  0200E23E068120C1
0010  39 30 30 43 30 30 30 30  30 30 30 30 31 30 30 30  900C000000001000
0020  30 30 30 31 31 36 36 32  37 33 38 31 32 30 36 30  0001166273812060
0030  30 30 31 33 35 36 33 31  30 30 30 30 30 34 30 34  0013563100000404
0040  30 31 34 30 32 31 32 31  39 32 32 35 30 31 34 30  0140212192250140
0050  32 31 30 34 30 34 39 38  30 32 30 38 30 38 30 32  2104049802080802
0060  31 30 30 30 30 32 30 36  36 32 37 33 38 31 32 38  1000020662738128
0070  34 35 38 35 38 31 32 30  36 30 30 30 31 33 35 36  45853812060001356
0080  3D 39 38 30 32 31 30 31  32 32 37 32 4C 6F 63 61  =98021012272Loca
0090  6C 20 20 20 4D 65 72 63  68 61 6E 74 31 32 33 34  l   MMMMMMMM1234
00a0  35 36 37 30 30 34 36 37  31 31 38 36 42 30 42 38  567004671186B0B8
00b0  31 30 39 33 31 33 30 32  45 33 34 32 45 33 33 36  10931302E342E336
00c0  46 30 34 38 39 30 32 33  30 33 30 36 32 30 33 38  F048902303062038
00d0  31 30 31 33 30 33 36 34  36 39 34 34 45 37 35 36  101303646944E756
00e0  31 36 45 43 35 44 42 37  30 30 36 38 38 38 39 39  16EC5DB700688899
00f0  39 30 30 36 30 30 30 30  30 31 30 36 36 32 37 33  9006000001066273
0100  38 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  8111111111111111
0110  31 31                                             11
-->

But I only want get the following part of the information :

30 32 30 30 45 32 33 45  30 36 38 31 32 30 43 31
39 30 30 43 30 30 30 30  30 30 30 30 31 30 30 30
30 30 30 31 31 36 36 32  37 33 38 31 32 30 36 30
30 30 31 33 35 36 33 31  30 30 30 30 30 34 30 34
30 31 34 30 32 31 32 31  39 32 32 35 30 31 34 30
32 31 30 34 30 34 39 38  30 32 30 38 30 38 30 32
31 30 30 30 30 32 30 36  36 32 37 33 38 31 32 38
36 32 37 33 38 31 32 30  36 30 30 30 31 33 35 36 
3D 39 38 30 32 31 30 31  32 32 37 32 4C 6F 63 61 
6C 20 20 20 4D 65 72 63  68 61 6E 74 31 32 33 34
35 36 37 30 30 34 36 37  31 31 38 36 42 30 42 38
31 30 31 33 30 33 36 34  36 39 34 34 45 37 35 36
31 36 45 43 35 44 42 37  30 30 36 38 38 38 39 39
39 30 30 36 30 30 30 30  30 31 30 36 36 32 37 33
38 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31
31 31 

On the other hand I would like to get only the hex string that was generated in the sampler for the request that will be send.
How can I get it from the sampler?

thanks

答案1

得分: 0

你似乎在使用 ISOUtil.hexdump(...),请改用 ISOUtil.hexString(...) 方法。

英文:

You seem to be using ISOUtil.hexdump(...), use ISOUtil.hexString(...) method instead.

huangapple
  • 本文由 发表于 2020年4月4日 18:19:08
  • 转载请务必保留本文链接:https://java.coder-hub.com/61026654.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定