Saurabh Prajapati
Saurabh Prajapati

Reputation: 332

How to get the XML in Java spring controller

There is a controller like

public Response doSomething(@RequestBody SomeObject someObject) {
...
}

It gets an XML and converts it to SomeObject. What I want to know how can we can get the xml as well[preferably as string]. Xml gets printed in debug logs, but how to get it as string in program.

Upvotes: 0

Views: 556

Answers (1)

martidis
martidis

Reputation: 2975

You could serialize your object again back to xml. Here is an example on how to do that.

Upvotes: 2

Related Questions