on 05-01-2016 1:25 PM
Hello,
We have to post multiple address records from SAP to a 3rd party REST service.We are on PO 7.5.
We are using ABAP PROXY to PI to REST interface.
I have created data type with Address element with has 0-n occurrence. This has been assigned to message type MT_ADDRESS.
XML to JSON conversion on REST adapter has been used to convert input XML to JSON.
With this setting, below JSON is being sent to REST service.
{"Address":[
{"code":"POST1","name":"Test POS Address 1","erpId":"POST1","line1":"Address 1 Line 1","line2":"Address 1 Line 2","city":"City1","state":"MA","zip":19501,"country":"US","shipTo":true,"billTo":true,"invoiceTo":true},
{"code":"POST2","name":"Test POS Address 2","erpId":"POST2","line1":"Address 2 Line 1","line2":"Address 2 Line 2","city":"City2","state":"MA","zip":19502,"country":"US","shipTo":true,"billTo":true,"invoiceTo":true}
]}
Expected format :
[
{"code":"POST1","name":"Test POS Address 1","erpId":"POST1","line1":"Address 1 Line 1","line2":"Address 1 Line 2","city":"City1","state":"MA","zip":19501,"country":"US","shipTo":true,"billTo":true,"invoiceTo":true},
{"code":"POST2","name":"Test POS Address 2","erpId":"POST2","line1":"Address 2 Line 1","line2":"Address 2 Line 2","city":"City2","state":"MA","zip":19502,"country":"US","shipTo":true,"billTo":true,"invoiceTo":true}
]
My message type is MT_ADDRESS which has been stripped already due to setting "strip the outer element".
But I am not able find a way to strip the "Address" tag?
Please help?
Hi,
Please add following parameter in for below RestAdapterBean module tab at module key level.
1 sap.com/com.sap.aii.adapter.rest.app/RESTAdapterBean Local Enterprise Bean restModuleKey ParameterName ParameterValue
rest setIgnoredElements PersonalInfo( Whatever tag that you want to skip from Json)
Regards,
Bhupal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhupal,
Am working on ignore string in json file by using the same adapter module but didnt get the expected output.
Could you please check once.
Thanks,
Ravi M
Hi Soumya,
AFAIK, "Strip Outer Element" just removes the operation of the message. Additionally as you want to remove the header tag, you can go for XML Anoymizer bean before converting it into JSON -
Remove Namespace in PI by XMLAnonymizer Bean in... | SCN
Regards,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.