About Question enthuware.ocejws.v6.2.83 :

Moderators: Site Manager, fjwalraven

Post Reply
jaderss
Posts: 5
Joined: Fri Oct 03, 2014 2:58 pm
Contact:

About Question enthuware.ocejws.v6.2.83 :

Post by jaderss »

I would like some more explanation about the error in the last option, with JAXBContext. Thanks

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.83 :

Post by fjwalraven »

Hi,

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");
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:

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 ) 
Regards,
Frits

blacksnow666
Posts: 13
Joined: Thu Apr 24, 2014 9:23 pm
Contact:

Re: About Question enthuware.ocejws.v6.2.83 :

Post by blacksnow666 »

is there a sample full method with JAXBContext?

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.83 :

Post by fjwalraven »

This thread viewtopic.php?f=40&t=2500&hilit=jaxbcontext describes the example with the jaxbcontext.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests