Skip to Content
0
Nov 25, 2008 at 09:03 AM

Returning a complex HashMap via web service does not work

331 Views

Hi,

I try to return

public class HardwareQueryResponse {

	HashMap<Feature, ArrayList<String>> featureToDeviceMap;
	// ... some more fields

	public HashMap<Feature, ArrayList<String>> getFeatureToDeviceMap() {
		return featureToDeviceMap;
	}

	public void setFeatureToDeviceMap(
			HashMap<Feature, ArrayList<String>> featureToDeviceMap) {
		this.featureToDeviceMap = featureToDeviceMap;
	}
	// ... some more getters and setters
}

via a web service. I add a correct entry (a feature object as key and a string array with one entry as value) to the object and return it. However, the result seen in WSNavigator only contains the key and an empty value tag.

    <ns2:queryAllHardwareInformationResponse xmlns:ns2="http://sap.com/sii/deviceRepository/">
      <return>
        <featureToDeviceMap>
          <entry>
            <key>
              <description>electronically operated</description>
              <name>panoramic window</name>
            </key>
            <value/>
          </entry>
        </featureToDeviceMap>
        // ... some more stuff
      </return>
    </ns2:queryAllHardwareInformationResponse>

I would expect the reply to contain the array in the "value" tag. Any clue?