3

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?

java_enthu
  • 2,279
  • 7
  • 44
  • 74

1 Answers1

0

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.

Jim Ford
  • 1,095
  • 1
  • 13
  • 21