cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to remove Message Type, (outer node) from REST receiver adapter

harish_babu5
Participant
0 Kudos

Hi

I have a ECC - PI - Webservices synchronous interface. I am using REST receiver webservice. I am using Java Mapping to convert xml to JSON and I am not using the conversion option in the REST adapter. The reason I am using Java Mapping is because I have two force array in a particular table. The materialMaster is a table. It comes as object in the payload if there is only one set of value and as an array if there are multiple sets of values. So I am using Java mapping to force array.

In the REST Receiver communication channel, under the Data Format tab, I have clicked the check box next to "Strip Operation from Mesage (Outer Element)" but still I am getting the outer node, MT_MaterialMaster in the target payload.

I have attached a screenshot too.

Why is it that the MessageType is not taken off from the payload?

Regards

Harish Babu

former_member223432
Participant
0 Kudos

Hi HArish,

I have a similar requirement where i need to remove '\" from the payload as its getting added at the channel level. can you please share the JAVA mapping you used in your case.

for me dates are coming as 23\/04\/2020, instead of 23/04/2020.

any suggestions?

thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

gniemann
Explorer

Just in case someone is still wondering about this like I did until a few moments ago.

The note is not very specific regarding the actual doing beside the SP upgrade...

You have to set the module Parameter "setIgnoredElements" for the standard REST Module Name "sap.com/com.sap.aii.adapter.rest.app/RESTAdapterBean".

As Parameter Value you have to insert the fieldnames that should be ignored.

As far as I recall you have to comma separate them without any additional chars.

The above setting will delete the fieldname "CUSTOMDER_ID" from the JSON payload.

That's what you want to do in order to create a "anonymous" array in a JSON request.

Kind Regards

johnwei
Explorer
0 Kudos

Thank you very much!!

0 Kudos

Issue closed yet?

Could you please tell me how to fix it, thanks.

former_member278111
Participant
0 Kudos

Hi Gregory Niemann,

I have used module parameter "setIgnoredElements" to remove unwanted fields from json payload but in return i am getting , for each field which i removed.

Ex: Before applying module parameter

<Field1>12345</Field2><Field3><Field2>test</Field2><Field3>Test1</Field3>

After applying moduleparameter setIgnoredElements with ParameterValue Field2,Field3

{ "Field1": "12345",,,}

Any suggestion how to remove ,,, from the json payload?

Thanks

Anil Kumar

0 Kudos

Hello Anil,

did you get a solution for this issue with the comma left after remove the field in MODULE ?

Thanks

goutam_ibm
Member
0 Kudos

Hi Anil

Are you able to remove comma ?

Thanks

0 Kudos

you managed to remove the comma, how?

kottiyil_ramnath
Participant
0 Kudos

Hi,

You are trying to strip the operation from the XML payload, Instead, try the below screenshot to strip the outer element.

rest.png

Regards,

Ram

manoj_khavatkopp
Active Contributor
0 Kudos

Harish,

You need to add module parameter : setIgnoredElements

Br,

Manoj

harish_babu5
Participant
0 Kudos

HI Manoj,

How do I use that? What are the values required? Will it strip outer cover of REST message at receiver communication channel even if I am not using REST channel conversion from xml to JSON? Please note that I am using custom Java mapping for the same

Harish

manoj_khavatkopp
Active Contributor
0 Kudos

Harish,

Refer Note :2465948.

Br,

Manoj

harish_babu5
Participant
0 Kudos

Any suggestions?