Have attached the sources and debugging into cxf, and found that it was missing the aegistype. (I did initially give it null so thats only fair :-) )
Still having a bit of struggle figuring out how it's all connected so yes - a write test would be great. Thanks 2008/12/7 Benson Margulies <[EMAIL PROTECTED]> > I might have forgotten to write one. I'll put some attention into this > in the next few days. > > On Sun, Dec 7, 2008 at 4:33 AM, Magnus Kvalheim <[EMAIL PROTECTED]> > wrote: > > Thanks for your reply Benson, > > > > I must admittedly say that I haden't... > > > > I took a quick look, and can find a read test, but no write :-| > > > > I'll look more into it later tonight. > > > > Thanks, > > Magnus > > > > 2008/12/7 Benson Margulies <[EMAIL PROTECTED]> > > > >> Magnus, have you looked at the unit tests that test standalone Aegis? > >> > >> On Sat, Dec 6, 2008 at 5:15 PM, Magnus Kvalheim <[EMAIL PROTECTED]> > >> wrote: > >> > Hi all, > >> > > >> > I'm interested in trying Aegis over JAXB as a xml<->java mapping > >> solution. > >> > > >> > The user guide, http://cwiki.apache.org/CXF20DOC/aegis-21.html, > >> indicates > >> > this is possible, but I haven't been able to find any examples of > such. > >> > > >> > I've tried with a simple example: > >> > > >> > public class MappingTest implements Serializable{ > >> > > >> > private static final long serialVersionUID = 1L; > >> > private String text1; > >> > private Integer number1; > >> > private Boolean bool1; > >> > private int[] intArr1; > >> > public MappingTest() { > >> > text1 = "A testing string"; > >> > number1 = 42; > >> > bool1 = true; > >> > intArr1 = new int[]{2,5,7,9,23,54}; > >> > } > >> > public String getText1() {return text1; } > >> > public Integer getNumber1() {return number1;} > >> > public Boolean getBool1() {return bool1;}i > >> > public int[] getIntArr1() {return intArr1;} > >> > > >> > public static void main(String[] args) throws Exception { > >> > > >> > MappingTest test = new MappingTest(); > >> > AegisContext ctx = new AegisContext(); > >> > XMLOutputFactory factory = XMLOutputFactory.newInstance(); > >> > OutputStream out = new FileOutputStream("data.xml"); > >> > > >> > XMLStreamWriter xmlWriter = factory.createXMLStreamWriter(out); > >> > AegisWriter<XMLStreamWriter> aegisWriter = > >> > ctx.createXMLStreamWriter(); > >> > aegisWriter.write(test, new QName("test"), true, xmlWriter, > >> > null); > >> > } > >> > } > >> > But get a nullpointerexception here: > >> > Exception in thread "main" java.lang.NullPointerException > >> > at > >> > > >> > org.apache.cxf.aegis.AegisXMLStreamDataWriter.write(AegisXMLStreamDataWriter.java:80) > >> > at > >> > > >> > org.apache.cxf.aegis.AegisXMLStreamDataWriter.write(AegisXMLStreamDataWriter.java:33) > >> > at MappingTest.main(MappingTest.java:38) > >> > > >> > > >> > What is required in order to serialize a bean with simple types? > >> > > >> > Can anyone on the list tell me if I'm on the right track? > >> > > >> > Thanks, > >> > Magnus > >> > > >> > > >
