Spring Boot SOAP Response to JSON - Any plugin or any logic

Viewed 24

Need to convert SOAP Response in SpringBoot (WebServivetemplate) to REST JSON. Currently SOAP Response is working fine...need to convert this as JSON input /output. Any logic in spring framework other than looping through XML document node by node.

1 Answers

follwoing is good example how can you directly convert it using jaxb

 import org.springframework.oxm.jaxb.Jaxb2Marshaller;

@Bean
public Jaxb2Marshaller marshaller(){
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    // this package must match the package in the <generatePackage> specified in
    // pom.xml
    marshaller.setContextPath("phoneverify.wsdl");
    return marshaller;
}
Related