BeanType type = new BeanType(info);
type.setTypeClass(SimpleBean.class);
type.setTypeMapping(mapping);
type.setSchemaType(new QName("urn:Bean", "bean"));
ElementReader reader = new ElementReader(getResourceAsStream("/org/codehaus/xfire/aegis/type/basic/bean4.xml"));
SimpleBean bean = (SimpleBean) type.readObject(reader, new MessageContext());
assertEquals("bleh", bean.getBleh());
assertEquals("howdy", bean.getHowdy());
reader.getXMLStreamReader().close();
// Test writing
Element element = new Element("root", "b", "urn:Bean");
Document doc = new Document(element);
type.writeObject(bean, new JDOMWriter(element), new MessageContext());