> Hi,
>
[quoted text clipped - 7 lines]
>
> MyResType res = (MyResType)u.unmarshal(new FileInputStream("foo.xml"));
Use something like:
System.err.println(u.umarshal(new
FileInputStream("foo.xml")).getClass().getName());
to get the actual type that's being returned, or use a debugger to
inspect the variable.
- Oliver
marco - 13 Jun 2006 13:36 GMT
Thank you Oliver,
javax.xml.bind.JAXBElement is the actual type that is being returned.
I've read the documentation, but I wasn't able to solve this problem.
Oliver Wong ha scritto:
> > Hi,
> >
[quoted text clipped - 17 lines]
>
> - Oliver
Oliver Wong - 13 Jun 2006 15:01 GMT
[post re-ordered]
> Oliver Wong ha scritto:
>
[quoted text clipped - 19 lines]
>
> javax.xml.bind.JAXBElement is the actual type that is being returned.
You probably marshalled your data incorrectly then. Show the marshalling
code.
- Oliver
marco - 13 Jun 2006 21:54 GMT
JAXBContext jax = JAXBContext.newInstance("Resource");
Marshaller m = jax.createMarshaller();
MyResType myRes = obj.createMyResType();
myRes.setBody("body"); //simple xsd:strings here
myRes.setHeader("header");
m.marshal(myRes, new FileOutputStream("foo.xml"));
thanks a lot!
Oliver Wong ha scritto:
> [post re-ordered]
>
[quoted text clipped - 26 lines]
>
> - Oliver