
Questions: 23,729 //
Answers: 52,300 //
Contributing Members: 17,997
Hi,
I have scenario http service returns 200 status code XML success response particular input value record found. If that record not found also it is giving same 200 status code but it contains error element.(their are multiple cases scenario success code with error elements)
if it returns book details i want to do some transformations in data weave, rest of the cases directly need to convert in json format.
expected output is json in all cases.
example
Success 200 record found
<booklist>
<bookid>987645</bookid>
<bookname>who will cry</bookname>
</booklist>
Success 200 record not found(their are multiple validation scenarios like this)
<error>
<error_code>1021</error_code>
<error_msg>book not found</error_msg>
</error>
Except error node their is no other unique identification. Using dataweave 2.0 Please suggest the way to deal these kind of scenario. Tried in many ways but no clues.
Aug 28, 2018 at 12:04 AM, soumyajit22 answered with:
@sunithavyasam I think it i duplicate post.
I have provided answer in below post