converting Object -HashMap to XMLObject
I have created a webservice which takes a HashMap as parameter. I generated the stubs/skeletion using XMLBeans and I am trying to set the values in the parameter and pass it to the webservice.
The issue is: I have the HashMap or List and API is开发者_开发问答 expecting it to be XMLObject is there any conversion utility which can be useful to convert my value to XMLObject?
not sure about conversion, but I have successfully sent HashMap via webservice by wrapping the HashMap in an object like so:
class MapObject {
HashMap<String, String> myMap;
public MapObject(){}
public HashMap<String, String> getMap() {
return myMap;
}
public void setMyMap(HashMap<String, String> myMap) {
this.myMap = myMap;
}
}
Then just make your web service parameter type MapObject.
精彩评论