Url Encoding in SAP / PTV Developer

This space is dedicated to SAP users - administrators and programmers who want to integrate PTV Developer (native), the PTV xServers or the SAP Hana Spatial Services (HSS). Topics which require specific SAP based knowhow or which deal with SAP based mechanisms will be collected here.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 3014
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Url Encoding in SAP / PTV Developer

Post by Bernd Welter »

Hi there,

maybe someone from our SAP players can assist with this question which came through some SAP driven partner. He tries to use our PTV Developer Routing API but struggles with some SAP side effect I can't support by myself:
I have encountered a problem with specifying waypoints, for example:
waypoints=49.12345,8.6789

The issue is the comma used to separate the coordinates. Since these are passed in the URL, they should, in my opinion, be encoded, see also https://www.w3schools.com/tags/ref_urlencode.ASP.

When encoded, it becomes:
waypoints=49.12345%2C8.6789

However, this is not understood by your server and results in an error. If the comma is not encoded, the request works without any issues.

Unfortunately, the SAP system always performs this encoding, and so far, I have not found a way to prevent it.

Is there a possible workaround on your side, or do you have any other tips?
The only thing I can contribute from outside SAP is: both of the following URLs work fine in the browser
  • api.myptv.com/routing/v1/routes?waypoints=49.0133618,8.427&waypoints=48.8923597,8.6718553&apiKey=
  • api.myptv.com/routing/v1/routes?waypoints=49.0133618%2C8.427&waypoints=48.8923597%2C8.6718553&apiKey=
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:
User avatar
MISTERX
Posts: 59
Joined: Mon Jun 02, 2014 11:50 am

Re: Url Encoding in SAP / PTV Developer

Post by MISTERX »

There is no prove from my side but have a look to this SAP-Note
3355849 - How to avoid URL encoding of query strings in Rest adapter https://userapps.support.sap.com/sap/su ... en/3355849
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
Post Reply