когда я отправляю тело ответа на запрос становится пустым, но статус 200?
что я делаю не так?
вот мой метод вызова
private void getTransferBtwCenterAndOffice(){
showProgressDialog(getString(R.string.wait_message));
ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);
String userName = tinyDb.getString(Constant.userName);
String passWord = tinyDb.getString(Constant.token);
List<TransferCenterStoreParameters> parameters = new ArrayList<>();
parameters.add(new TransferCenterStoreParameters("StoreCode","B201"));
String base = userName + ":" + passWord;
String authHeader = "Basic "+ Base64.encodeToString(base.getBytes(),Base64.NO_WRAP);
Call<TransferCenterStoreResponse> call = apiService.TRANSFER_CENTER_STORE_RESPONSE_CALL(authHeader,"BR_SP_BRN_GET_STORE_ACTIVE_SHIPMENTS",parameters);
call.enqueue(new Callback<TransferCenterStoreResponse>() {
@Override
public void onResponse(Call<TransferCenterStoreResponse> call, retrofit2.Response<TransferCenterStoreResponse> response) {
hideProgressDialog();
Log.d(CLASS_NAME, "onResponseeeeeeeee: "+response);
if(response != null && response.body() != null){
if(response.body().getTransferBtwCenterStoreResult().getResultCode().equals("200")){
List<TransferCenterStore> mList = response.body().getTransferCenterStoresList();
}
else{
getAlert(response.body().getTransferBtwCenterStoreResult().getErrorMessage());
}
}
}
@Override
public void onFailure(Call<TransferCenterStoreResponse> call, Throwable t) {
hideProgressDialog();
Log.e(CLASS_NAME, t.toString());
}
});
}
вот мой интерфейс
@FormUrlEncoded
@POST("GetDispatchList")
Call<TransferCenterStoreResponse> TRANSFER_CENTER_STORE_RESPONSE_CALL(
@Header("Authorization") String authHeader,
@Field("ProcName") String procName,
@Field("Parameters") List<TransferCenterStoreParameters> objects) ;
здесьтело моего параметра
{"ProcName": "BR_SP_BRN_GET_STORE_ACTIVE_SHIPMENTS", "Parameters": [{"Name": "StoreCode", "Value": "B201"}]}
вот мой переводЦентр-магазинответ ответа
public class TransferCenterStoreResponse {
@SerializedName("ResultModel")
private TransferBtwCenterStoreResult transferBtwCenterStoreResult;
@SerializedName("Dispatches")
private List<TransferCenterStore> transferCenterStoresList;
public TransferBtwCenterStoreResult getTransferBtwCenterStoreResult() {
return transferBtwCenterStoreResult;
}
public void setTransferBtwCenterStoreResult(TransferBtwCenterStoreResult transferBtwCenterStoreResult) {
this.transferBtwCenterStoreResult = transferBtwCenterStoreResult;
}
public List<TransferCenterStore> getTransferCenterStoresList() {
return transferCenterStoresList;
}
public void setTransferCenterStoresList(List<TransferCenterStore> transferCenterStoresList) {
this.transferCenterStoresList = transferCenterStoresList;
}
}
вот мой ответ
{
"ResultModel": {
"ResultStatus": "Success",
"ResultCode": "200",
"ErrorMessage": null,
"Token": "BD0F1E3D1F8E43B79BCE96FA6572A2AD",
"ResultJson": "",
"ConnectionUrl": "http://192.168.3.40:1313/",
"UserName": null,
"ResultNative": "",
"ResultDt": null
},
"Dispatches": [
{
"ShippingNumber": "178-S-6-30770",
"ShippingDate": "2018-02-11T21:00:00Z",
"Description": "",
"InternalDescription": "",
"SeriesNumber": 322216,
"LogisticsCompanyBOL": "",
"WarehouseCode": "B456",
"ShipmentHeaderID": "3408fcec-9e8f-4e82-b556-a88500d3713f",
"Quantitity": 1
}
]
}