Json to XML conversion in mule data weave -


i have following json data , want convert xml is. there way simplest way in mule data weave

 {       "header": {         "date": "20160721145839",         "utc_time": null,         "transactiondatetime": "20160721145839",         "eventtype": "test",         "placeofevent": "aud",         "refno": "shpl123123",         "senderusername": "apinar"               },       "body": {         "number": "zzzz",          "vfgt": 2000,         "decwt": 0,         "status": "f",         "category": "e",         "additionaldata": {           "methodofweightcalculation": "sm2",           "wtdata": {             "country": "au"           },           "declarant": {             "declarantphone": "55555555"           },           "edisignature": "x"         }       }     } 

when try below giving me error in mule

%dw 1.0 %output application/xml skipnullon="everywhere" --- payload 

you require root element xml transformation. there no problem json input. following works fine.

%dw 1.0 %output application/xml --- root : payload 

hope helps.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -