Map<String, Object> props = (Endpoint)getProperty(ENDPOINT);
if (props == null) {
props = new HashMap<String, Object>();
}
Context context = new Context(props);
// I'm not sure that this is the right type mapping
context.setTypeMapping(type.getTypeMapping());
context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
context.setAttachments(attachments);
Object val = databinding.getService().get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
if ("true".equals(val) || Boolean.TRUE.equals(val)) {
context.setWriteXsiTypes(true);
}
type = TypeUtil.getWriteType(context, obj, type);
try {