cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XML to JSON Conversion generates an empty json

2,427

Good morning.

I have a Proxy->Rest scenario with Rest Operation GET. In the Rest Receiver communication channel, I configured it this way:

However, an empty payload is being generated:

XML before the conversion:

Payload after the Conversion (empty payload):

I emphasize that I did a test, changing Rest Operation to PUT. In this case I received an http 404 as this is not the expected operation, but the json was generated correctly.

Why doesn't the XML->Json conversion work with the GET method?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert

in older releases the REST adapter does not support payloads for GET and DELETE, payload support for GET and DELETE has been shipped with 7.5 SP21, see SAP note 3025502

Alex

0 Likes

Alexander Bundschuh,

Thank's for your reply,

I asked the basis team for help and they informed me that we are in SP22:

Should I take any additional action so that the json payload is generated?

Thank you

0 Likes

I have another option, which is to put the payload content in the url. I configured it this way:

However, it did not generate the url with the variables:

Calling server: GET https://wilsonsons-test.coupahost.com/api/exchange_rates?from-currency%5Bcode%5D=&rate-date%5Bgt_or_...

This was the source XML. Notice how it has the necessary fields: CURRENCY, DATE_INI and DATE_FIM:

<?xml version="1.0" encoding="utf-8"?>

<n0:mtSapGetTaxaCambioRequest

xmlns:n0="urn:wilsonsons.com.br:coupa:gettaxacambio"

xmlns:prx="urn:sap.com:proxy:ECD:/1SAI/TASFAB8FEA4176480D97850:740">

<CURRENCY>BRL</CURRENCY>

<DATE_FIM>2024-01-10</DATE_FIM>

<DATE_INI>2024-01-09</DATE_INI>

</n0:mtSapGetTaxaCambioRequest>

Is there anything that prevents the use of dynamic url for the GET method?

Thanks,

javier_alonso63
Participant
0 Likes

If the variables are in the request XML message, you should use XPATH as Value Source, instead of Adapter-Specific.

0 Likes

Issue resolved. I was unable to create the payload for the get method, but I resolved it through Dynamic Configuration, placing the variables in the url.

Thanks