Is it possible that a jax-ws
soap-webservice
can output json
format instead of xml
?
@Component
@WebServic
Apparently it's possible by following the instructions indicated at https://jax-ws-commons.java.net/json/
Summing up:
@BindingType(JSONBindingID.JSON_BINDING)
public class MyService {
public Book get(@WebParam(name="id") int id) {
Book b = new Book();
b.id = id;
return b;
}
public static final class Book {
public int id = 1;
public String title = "Java";
}
}
You just need jaxws-json.jar
in your WEB-INF/lib
for this to work.
I hope it helps!