About Question enthuware.ocejws.v6.2.83 :
Moderators: Site Manager, fjwalraven
-
- Posts: 5
- Joined: Fri Oct 03, 2014 2:58 pm
- Contact:
About Question enthuware.ocejws.v6.2.83 :
I would like some more explanation about the error in the last option, with JAXBContext. Thanks
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.83 :
Hi,
Thank you for your question. Although the last option seems logical to create a JAXB context out of a SOAPMessage: it doesn't work out of the box.
The problem here is that the SOAPMessage class doesn't have the JAXB annotation @XmlRootElement. Apart from that the JAXBContext.newInstance() method should be used like this:
Regards,
Frits
Thank you for your question. Although the last option seems logical to create a JAXB context out of a SOAPMessage:
Code: Select all
JAXBContext jaxbcontext = JAXBContext.newInstance("SOAPMessage");
The problem here is that the SOAPMessage class doesn't have the JAXB annotation @XmlRootElement. Apart from that the JAXBContext.newInstance() method should be used like this:
Code: Select all
// The JAXBContext instance is initialized from a list of colon separated Java package names.
// Each java package contains JAXB mapped classes, schema-derived classes and/or user annotated classes.
JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )
// The JAXBContext instance is intialized with class(es) passed as parameter(s) and classes
// that are statically reachable from these class(es)
JAXBContext.newInstance( com.acme.foo.Foo.class )
Frits
-
- Posts: 13
- Joined: Thu Apr 24, 2014 9:23 pm
- Contact:
Re: About Question enthuware.ocejws.v6.2.83 :
is there a sample full method with JAXBContext?
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.83 :
This thread viewtopic.php?f=40&t=2500&hilit=jaxbcontext describes the example with the jaxbcontext.
Who is online
Users browsing this forum: No registered users and 7 guests