my WS-Interface:
@WebService
public interface WS{
String decide(String word, MapWrapper parameters);
}
with WrapperClass:
public class MapWrapper {
public HashMap<String, String> map;
}
and
from("cxf:http://localhost:8080/WS?serviceClass=ws.WS&dataFormat=POJO").to("stream:out"); //Just for testing purpose
gives following exception when invoked with SOAPUI:
Error during type conversion from type: org.apache.cxf.message.MessageContentsList to the required type: byte[] with value [Test, ws.WS@1221bc6] due argument type mismatch
I think the MapWrapper class caused this exception. But how to fix this problem?
The same issue over and over….
Do NOT use
Javaspecific constructs in your interfaces you expose as Web Services. I am taking about theHashMap.Web Services are an integration technology meant to connect components in any platform (even non-OO clients). All the objects passed in web services should be value transfer objects. Not complex bussiness objects etc.
Not only this is the correct approach, it is the approach with the least problems during coding and deploying.