I created WSDL file and in the WS Client class am trying to send HashMap as the parameter as follows :
HashMap<String, ArrayList<User>> map = new HashMap<String, ArrayList<User>>();
VerifyStub stub = new VerifyStub();
Verify vu = new Verify();
vu.setHmap(map);
And am experiencing the above error message “java.util.HashMap cannot be cast to org.apache.axiom.om.OMElement”.
May I know, whether I can convert HashMap to OMElement.
You can’t pass Collections like HashMap through a wsdl interface.
There is no mapping of collection types in wsdl.
Your best bet for passing things like that is to pass Arrays. This may mean an extra layer of wrapper code to bring your data out to the webservice layer though.
This link, whilst not exactly your case throws some light on using collections in a wsdl,
http://www.ibm.com/developerworks/webservices/library/ws-tip-coding/index.html