These docs are for v1.0. Click to read the latest docs for v3.0.

Comunidade

Ask a Question
Back to All

500 - Internal Server Error para uma cotação

Bom dia!
Segue abaixo os dados de uma cotação que está gerando erro interno. Não consegui identificar qual dos campos está ocasionado esta excessão.

HTTP POST https://quotation-apigateway.rte.com.br/api/v1/gera-cotacao

const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/*+json',
Authorization: 'Bearer ...'
},
body: '{"PickupAddress":{"ZipCode":"89128000","Address":"RODOVIA SC 414","Number":"1055","Supplement":"null","District":"VILA DO SALTO","City":"LUIZ ALVES","UnitFederation":"SC"},"DestinationAddress":{"ZipCode":"35450015","Address":"R DOUTOR GUILHERME","Number":"122","Supplement":"null","District":"CENTRO","City":"ITABIRITO","UnitFederation":"MG"},"OriginZipCode":"89128000","OriginCityId":8539,"DestinationZipCode":"35450015","DestinationCityId":3236,"TotalWeight":139.956,"EletronicInvoiceValue":13815.88,"CustomerTaxIdRegistration":"09315905000125","ReceiverCpfcnp":"03954332000284","ContactName":"ContactName","ContactPhoneNumber":"00000000","Packs":[{"AmountPackages":6,"Weight":139.956,"Length":64,"Height":34,"Width":44}]}'
};

fetch('https://quotation-apigateway.rte.com.br/api/v1/gera-cotacao', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));

RESPONSE 500 - INTERNAL SERVER ERROR

{
"ErrorMessage": "Erro OperationalSectorDetailInfo - Parity => Specified cast is not valid.",
"StackTrace": " at Rodonaves.Engine.DbHelper.ORMapper.SetClassInstance(Object classInstance, DbDataReader dataReader, String[] ignoreProperties)\n at Rodonaves.Quotation.Dal.Oracle.OperationalSectorDal.NewClassInfo(IDataReader dr) in /src/Rodonaves.Quotation.Dal.Oracle/OperationalSectorDal.cs:line 334\n at Rodonaves.Quotation.Dal.Oracle.OperationalSectorDal.GetOperationSectorToBillOfLadingAsync(String cep, Int32 cityId, Int32 unitId, Int32 personId, Int32 districtId, String addressNumber, Boolean isDelivery) in /src/Rodonaves.Quotation.Dal.Oracle/OperationalSectorDal.cs:line 314\n at Rodonaves.Quotation.Bll.Unit.GetSectorFullAsync(UnitToCityInfo unitToCity, String cep, Int32 cityId, Int32 personId, String addressNumber, String districtDescription, Boolean isDelivery) in /src/Rodonaves.Quotation.Bll/Unit.cs:line 109\n at Rodonaves.Quotation.Bll.Unit.GetUnitAndSectorsAsync(CustomerInfo customer, Boolean isDelivery) in /src/Rodonaves.Quotation.Bll/Unit.cs:line 74\n at Rodonaves.Quotation.Bll.Unit.SetUnitAndSectorDestinyAsync(QuotationInfo info) in /src/Rodonaves.Quotation.Bll/Unit.cs:line 37\n at Rodonaves.Quotation.Bll.Quotation.SetUnitsAndSectors(QuotationInfo info) in /src/Rodonaves.Quotation.Bll/Quotation.cs:line 318\n at Rodonaves.Quotation.Bll.Quotation.DoQuotationAsync(QuotationInfo info, Boolean isSimulation) in /src/Rodonaves.Quotation.Bll/Quotation.cs:line 121\n at Rodonaves.Quotation.Bll.Quotation.CreateQuotationAsync(QuotationInfo info) in /src/Rodonaves.Quotation.Bll/Quotation.cs:line 158\n at Rodonaves.Quotation.Controllers.QuotationController.PostQuotationAsync(CreateQuotationRequest request) in /src/Rodonaves.Quotation/Controllers/QuotationController.cs:line 61\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at System.Threading.Tasks.ValueTask`1.get_Result()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)\n at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)\n at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context)\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)"
}