0

私は次のjson文字列を持っています:

`{
    "portfolio": "HEXGENFUND",
    "transSrlNo": "1",
    "transCode": "BUY",
    "investReason": "004",
    "inflowOutflow": "I",
    "transDate": "2012-09-01",
    "tradeDate": "2012-09-01",
    "tradeDateUpto": "2012-09-01",
    "tradeTime": "11:27:9",
    "investCategory": "FVTPL",
    "custodian": "DEUTSCHE",
    "holdType": "HOLD",
    "securityType": "INV",
    "security": "DABU02",
    "assetClass": "EQU",
    "issuer": "DABU",
    "marketType": "MKT",
    "tradePriceType": "S",
    "requisitionType": "SO",
    "priceFrom": "100000",
    "priceTo": "100000",
    "marketPrice": "100000",
    "averagePrice": "100000",
    "price": "100000",
    "quantity": "2",
    "grossAmtTcy": "200000",
    "exchRate": "1",
    "grossAmtPcy": 200000,
    "grossIntTcy": "0",
    "grossIntPcy": 0,
    "netAmountTcy": 200000,
    "netAmountPcy": 200000,
    "acquCostTcy": 200000,
    "acquCostPcy": 200000,
    "yieldType": "N",
    "purchaseYield": "0",
    "marketYield": "0",
    "ytm": "0",
    "mduration": "0",
    "currPerNav": "0",
    "desiredPerNav": "0",
    "currHolding": "0",
    "noofDays": "0",
    "realGlPcy": 0,
    "realGlTcy": "0",
    "nowLater": "N",
    "isAllocable": "false",
    "acquCostReval": 0,
    "acquCostHisTcy": 200000,
    "acquCostHisPcy": 0,
    "exIntTcy": 0,
    "exIntPcy": 0,
    "accrIntReval": 0,
    "accrIntTcy": 0,
    "accrIntPcy": 0,
    "grossAodTcy": 0,
    "grossAodPcy": 0,
    "grossAodReval": 0,
    "bankAccAmtAcy": 200000,
    "bankAccAmtPcy": 200000,
    "taxAmountTcy": 0,
    "unrelAmortTcy": 0,
    "unrelAmortPcy": 0,
    "unrelGlTcy": 0,
    "unrelGlPcy": 0,
    "realGlHisTcy": 0,
    "realGlHisPcy": 0,
    "tradeFeesTcy": 0,
    "tradeFeesPcy": 0
}`

httpclientを介して上記のパラメーターを受け取るメソッドを呼び出そうとします。以下のようなメソッドを呼び出すと:

uri = "http://localhost:8080/api/trade/createrequisition";
HttpPost postURI = new HttpPost(uri);
            postURI.setHeader("Content-type", "application/json");
            // Setup the request parameters
            BasicHttpParams params = new BasicHttpParams();
            params.setParameter("CreateRequisitionRO", jsonROConverter.serialiseRequisionRO(request));
            params.setBooleanParameter("validateOnly", validateOnly);
            postURI.setParams(params);

            HttpResponse responseURL = client.execute(postURI);

これは、呼び出されたメソッドのシグネチャです。

public @ResponseBody
    void createRequisition(@RequestBody CreateRequisitionRO[] request,
            @RequestHeader("validateOnly") boolean validateOnly) {....}

これは私が得る例外です:

java.io.EOFException: No content to map to Object due to end of input

何が問題になる可能性があります。

これを修正するのを手伝ってください。

4

1 に答える 1