Why are the cards returned by the JAX-WS call always empty?

My web service method returns an object Pagethat includes the following methods:

public Map<String,String[]> getParameters() { ... }
public setParameters(Map<String,String[]> parameters) { ... }

On the client side, the created JAX-WS method getParameters()returns an object Parametersthat provides the method getEntry()that returns List<Entry>. However, this list is always empty. What is the reason?

+3
source share
1 answer

You should use specific types instead of interfaces in setters and getters:

public HashMap<String,String[]> getParameters() { ... }
public setParameters(HashMap<String,String[]> parameters) { ... }

Then everything works as expected.

+6
source

Source: https://habr.com/ru/post/1699156/


All Articles