* @return
*/
public static HashMap<String,Object> getJSONAsMap(Map<String,WSDLPart> parts, JAXBContextImpl context){
HashMap<String,Object> parameterMap = new LinkedHashMap<String, Object>();
try{
BeanAware beanAware = new BeanAware(){};
TreeSet<Entry<String, WSDLPart>> indexOrderedSet = new TreeSet<Map.Entry<String,WSDLPart>>(new Comparator<Entry<String, WSDLPart>>(){
public int compare(Entry<String, WSDLPart> o1, Entry<String, WSDLPart> o2) {
return new Integer(o1.getValue().getIndex()).compareTo(o2.getValue().getIndex()) ;
}
});
indexOrderedSet.addAll(parts.entrySet());
for(Entry<String, WSDLPart> part : indexOrderedSet){
if(part.getValue().getBinding() == ParameterBinding.BODY){
JaxBeanInfo<?> globalType = context.getGlobalType(part.getValue().getDescriptor().name());
Class<?> clazz = null;
if(globalType != null){
clazz = globalType.jaxbType;
if(BeanAware.isJSONPrimitive(clazz)){
parameterMap.put(part.getKey(), beanAware.getNewInstance(clazz));
} else if(clazz.isEnum()){
parameterMap.put(part.getKey(), clazz.getEnumConstants()[0]);
}else{
parameterMap.put(part.getKey(), beanAware.getNewInstance(clazz));
}
} else {
/*
* This case handled using SEI method parameter in body builder.
*/