cancel
Showing results for 
Search instead for 
Did you mean: 

XML transform to JSON

Former Member
0 Kudos

Dear All,

I have a scenario where the direction is from  SAP ECC to third-party. The sender adapter is IDOC_AAE and the receiver adapter is SOAP. The data format for receiver system is json string with a field.  How to transform the IDOC data to a json string?  Because the receiver adapter is not REST. It seems to write some java code in message mapping.

Thank you for your enthusiasm in advance.

Best regards,

Hubery

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Hubery,

You can use java mapping which provided in below thread.

Or use can use below custom module.

Regards,

Praveen.

Former Member
0 Kudos

Thank you Praveen for your  quick response. I will test and feedback.

Best regards,

Hubery

Former Member
0 Kudos

Dear Praveen,

I test your java mapping code. The error is displayed.

Error desc.:content is not allowed in prolog

OM:

IA:

former_member182412
Active Contributor
0 Kudos

Hi Hubery,

  • I think java mapping is working, did you test the mapping in repository in test tab??
  • SOAP adapter expect the payload in XML format
  • Your payload already converted to JSON format when it reach to SOAP adapter.
  • You need to use HTTP_AAE adapter for this purpose.

Regards,

Praveen.

Former Member
0 Kudos

Yes, Praveen, HTTP POST is OK.

But there are two questions.

Number one, I mean the receiver adapter must use the HTTP_AAE? Because third-party system base on the WebService, I choose the SOAP receiver. Number two, There are two pop-up box when I test , one is OK, another is error.Please look at in details.

former_member182412
Active Contributor
0 Kudos

Hi Hubery,

  • Yes you must use HTTP_AAE adapter because you have to send the JSON payload.
  • You can ignore that error because message mapping expecting XML but your output is JSON, you can verify in view source it will be JSON.

Regards,

Praveen.

Answers (0)