magja/magja — Issue #26: 26 - SoapCallFactory: create Array of Maps 
Author: ceefour
Created: 2011-11-02 11:33:27+00:00
State: open

SoapReturnParser is able to parse an Array of Maps, but SoapCallFactory is not able to create one.
We are using a custom Magento module which requires a parameter of type: Array of Maps.

Simply extend the method SoapCallFactory.typedElement(OMNamespace, String, Object):

...
} else if (value instanceof String[]) {
...
} else if (value instanceof Map[]) {
Map<?, ?>[] mapArray = (Map<?, ?>[]) value;
OMElement arrayArg = fac.createOMElement(name, elementNs);
arrayArg.addAttribute("arrayType", soapXml.getPrefix() + ":Map[" + mapArray.length + "]", soapEnc);
arrayArg.addAttribute("type", soapEnc.getPrefix() + ":Array", xsi);
for (Map<?, ?> item : mapArray) {
arrayArg.addChild(typedElement(elementNs, "item", item));
}
return arrayArg;
} else if (value instanceof Map[]) {
...

Original link: http://code.google.com/p/magja/issues/detail?id=26