2012-07-05 13 views
0

解壓字段時發生異常,當我向服務器發送請求時,在服務器日誌中,我得到正確的結果。這是我對服務器的要求如下在JPOS

ISOMsg isoMsg = new ISOMsg(); 
      isoMsg.setMTI(Constants.RequestType.MESSAGE_REQUEST.getValue()); 
      isoMsg.set(3,Constants.Services.DEPOSIT_FUNDS_REQUEST.getValue()); 
      isoMsg.set(4, depositFundRequest.getAmount().toString()); 
      isoMsg.set(7, ISODate.getDateTime(today, TimeZone.getTimeZone("GMT+03"))); 
      isoMsg.set(11, ServiceUtils.generate(6)); 
      //isoMsg.set(12, "100629072055"); 
      isoMsg.set(17, ISODate.getDate(today)); 
      //isoMsg.set(24, "200"); 
      isoMsg.set(32, "111111"); 
      //isoMsg.set(35, "6278519999011712"); 
      isoMsg.set(37, ServiceUtils.generate(12)); 
      //isoMsg.set(41, "TERMID01"); 
      //isoMsg.set(43, "11"); 
      isoMsg.set(46,"00KESD000000000000500000000000D0000000000000000KES"); 
      isoMsg.set(49,"KES"); 
      isoMsg.set(102,depositFundRequest.getAccount()); 
      isoMsg.set(123, userContextService.getCurrentUser());//UserId 
      isoMsg.set(126,Constants.Field126.CASH_IN.getValue()); 
      channel.send (isoMsg); 
      ISOMsg responseMsg = channel.receive(); 

但是,在客戶端傳入時我收到以下異常。

org.jpos.iso.ISOException: org.jpos.iso.IFA_LLCHAR: Problem unpacking field 43 (java.lang.NegativeArraySizeException) unpacking field=43, consumed=97 

我使用ASCII打包和BCD通道,請幫我解決異常

回答

1

您可以在打包使用org.jpos.iso.IFE_LLCHAR現場43。

0

您最好仔細檢查一下您用來解析服務器接收到的數據的ISOPackager。如果您使用的包裝商與服務器使用的包裝商不同,那麼出現錯誤的可能性很大。有輕微不匹配時(例如ISO87APackager vs ISO87BPackager)發生異常。

+2

在你的答案中是否真的有解決方案? – 2014-02-25 05:39:35

相關問題