cancel
Showing results for 
Search instead for 
Did you mean: 

JSON to XML conversion fails on namespace (prefix)

Dimitri
Active Contributor
0 Kudos

Hi,

I'm facing a JSON to XML conversion problem in my receiver REST adapter, for my response message in a synchronous scenario.

My Message Mapping expects Namespaces and namespaces prefix. They come via the XSD I received from the 3rd party. When the JSON response enters the SAP PO system, it does not contain any namespace or namespace prefix. So, the message mapping fails.

How can I handle such a scenario? Is this feasible?

Thanks a lot.
Dimitri

View Entire Topic
Ryan-Crosby
Active Contributor
0 Kudos

Hi Dimitri,

Weird that I cannot comment upon your comment so I will respond here. In the ESR open the external definition and export it to a file from the WSDL tab. Use any text editor and insert the exact text elementFormDefault="unqualified" into the schema or change the value from qualified to unqualified if it already exists and save. Re-import the .wsdl file for the external definition and the system should evaluate the message without the namespace and prefix information in the root XML.

Regards,

Ryan Crosby

Dimitri
Active Contributor
0 Kudos

Hi Ryan,

I did the change and imported the WSDL again:

I did the change completely in the beginning: <wsdl:definitions name=xxx all namespaces here elementFormDefault="unqualified">

EDIT: I see a related XSD containing this element with value qualified. I will change that and test. Keep you posted.

Kind regards,
Dimitri

Ryan-Crosby
Active Contributor
0 Kudos

Hi Dimitri,

You would want to add that attribute to the schema element of the WSDL file only.

Regards,

Ryan Crosby

Dimitri
Active Contributor

Ryan, you are a HERO! Thanks a lot.

PS: now, my XSLT mapping is also working properly.

Ryan-Crosby
Active Contributor
0 Kudos

Glad to be of help 😄