Unrecognized field "currency" on xRoute2

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
Dobos Ionut
Posts: 25
Joined: Tue Dec 03, 2019 11:27 am

Unrecognized field "currency" on xRoute2

Post by Dobos Ionut »

Hello,

We are getting loads of errors (Bad Request) from PTV xRoute2 since yesterday evening. This is the error message:

Code: Select all

{
  "message": "Unrecognized field \"currency\" (class com.ptvgroup.xserver.profile.RequestProfile), not marked as ignorable (7 known properties: \"clusterPlanningProfile\", \"routingProfile\", \"mapLanguage\", \"vehicleProfile\", \"featureLayerProfile\", \"userLanguage\", \"renderingProfile\"])\n at [Source: (org.apache.cxf.transport.http.AbstractHTTPDestination$1); line: 119, column: 2] (through reference chain: com.ptvgroup.xserver.xroute.RouteRequest[\"requestProfile\"]->com.ptvgroup.xserver.profile.RequestProfile[\"currency\"])",
  "errorLine": 119,
  "errorColumn": 2,
  "faultType": "com.ptvgroup.xserver.exceptions.InvalidRequestFault"
}
It seems like the "currency" field from RequestProfile is no longer recognized, although it is still present in the documentation: https://xserver2-dashboard.cloud.ptvgro ... estProfile

Here's a request example:

Code: Select all

{
  "resultFields": {
    "polyline": true,
    "legs": {
      "enabled": true,
      "polyline": false,
      "tollSummary": true
    },
    "toll": {
      "enabled": true,
      "sections": true,
      "systems": true
    },
    "eventTypes": [
      "TOLL_EVENT",
      "COUNTRY_EVENT",
      "ROUTE_VIOLATION_EVENT"
    ],
    "segments": {
      "enabled": true,
      "polyline": true,
      "featureThemeIds": [
        "PTV_SpeedPatterns",
        "PTV_TrafficIncidents"
      ]
    }
  },
  "geometryOptions": {
    "responseGeometryTypes": [
      "PLAIN"
    ]
  },
  "routeOptions": {
    "tollOptions": {
      "useDetailedToll": true
    },
    "timeConsideration": {
      "$type": "ExactTimeConsiderationAtStart",
      "referenceTime": "2020-09-28T14:06:10+00:00"
    }
  },
  "requestProfile": {
    "featureLayerProfile": {
      "themes": [
        {
          "id": "PTV_SpeedPatterns",
          "enabled": true
        },
        {
          "id": "PTV_TrafficIncidents",
          "enabled": true
        }
      ]
    },
    "routingProfile": {
      "course": {
        "toll": {
          "tollPenalty": 0
        },
        "distanceTimeWeighting": 90,
				"combinedTransport": {
					"boatPenalty": 0
				}
      }
    },
    "vehicleProfile": {
      "electronicTollCollectionSubscriptions": "NONE",
      "engine": {
        "emissionTechnology": "SELECTIVE_CATALYTIC_REDUCTION",
        "emissionStandardEU": "EURO_EEV"
      },
      "axle": {
        "axleLoad": 15,
        "numberOfAxles": 5
      },
      "dimensions": {
        "height": "380",
        "heightAboveFrontAxle": 2.9,
        "length": "1362",
        "width": "255"
      },
      "weight": {
        "emptyWeight": 18,
        "loadWeight": 40
      }
    },
    "currency": "EUR"
  },
  "coordinateFormat": "EPSG:4326",
  "waypoints": [
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 10.881190312,
          "y": 56.413471194
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 12.857498132,
          "y": 56.672267934
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 12.249170269,
          "y": 57.107879628
        }
      }
    }
  ]
}
If we remove the requestProfile.currency field, it works, but that feature is really important to us. Could you help us?

Thanks,
John
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Unrecognized field "currency" on xRoute2

Post by Bernd Welter »

Hello John,

I assume that this behaviour is related to the following status:
  • v2.19 : the "currency property" is an expeimental located in RequestBase.RequestProfile.currency with a default of "xxx"
  • v2.20 : the "currency" is no longer part of "RequestBase" but has been moved to RouteRequest.RouteOptions.currency and furthermore it has been set from "experimental" to "release"
  • 09.11.2020 = yesterday we installed the v2.20 on the production cloud.
:!: So please be careful with using the experimental API in a production scope!

I will get back to you 1:1 so we can check the individual solution...

Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Dobos Ionut
Posts: 25
Joined: Tue Dec 03, 2019 11:27 am

Re: Unrecognized field "currency" on xRoute2

Post by Dobos Ionut »

Hello,

I moved the currency field to the path you mentioned and it's working now. Thanks!

Best regards,
John
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Unrecognized field "currency" on xRoute2

Post by Bernd Welter »

Thanks for the quick feedback!

One more advice:
the documentation you refered to was not the same system as you tried to connect to.

:idea: Ensure to use equal systems both for gathering docu and for processing requests.

Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply