Call functions on the JAXBDataBinding object. Pass that object as
setDatabinding on the SFB.
On Tue, Jun 24, 2008 at 7:40 PM, Arul Dhesiaseelan <[EMAIL PROTECTED]>
wrote:
> Thanks Dan.
>
> I am using JaxWsServerFactoryBean to create my service. Is it possible to
> set these JAXB parameters in the server factory?
>
> Basically, I need to set these info on the CXF JAXBContext.
>
> // initialize custom reader
> TransientAnnotationReader reader = new TransientAnnotationReader();
> reader.addTransientField(Throwable.class.getDeclaredField("stackTrace"));
>
> reader.addTransientMethod(Throwable.class.getDeclaredMethod("getStackTrace"));
>
> // initialize JAXB context
> Map<String, Object> jaxbConfig = new HashMap<String, Object>();
> jaxbConfig.put(JAXBRIContext.ANNOTATION_READER, reader);
> String yourPackages = "deltix.qsrv.pub:deltix.qsrv.comm.xml:";
> JAXBContext ctx = JAXBContext.newInstance (yourPackages,
> TransientAnnotationReader.class.getClassLoader(), jaxbConfig);
>
> I am more interested in setting these on JAXBDataBinding object through CXF
> API instead using spring config.
>
> Appreciate your help on this issue.
>
> -Arul
>
> Daniel Kulp wrote:
>
>>
>> I just realized this is covered in the docs:
>>
>> http://cwiki.apache.org/CXF20DOC/jaxb.html
>>
>>
>> Dan
>>
>>
>>
>> On Jun 23, 2008, at 9:22 PM, Daniel Kulp wrote:
>>
>>
>>> The JAXBDataBinding object has maps for both contextProperties and
>>> marshallerProperties that can be configured via spring configuration.
>>> Unfortunately, it doesn't look like we have an example of configuring via
>>> spring, just via the apis. :-(
>>>
>>> Dan
>>>
>>>
>>>
>>> On Jun 23, 2008, at 4:45 PM, Arul Dhesiaseelan wrote:
>>>
>>> Hi,
>>>>
>>>> One of my bean method returns IOException. When I start my web service,
>>>> I get "java.lang.StackTraceElement does not have a no-arg default
>>>> constructor".
>>>>
>>>> I see this issue could be overcome using JAXB introductions discussed in
>>>> this thread: http://forums.java.net/jive/thread.jspa?messageID=282016which
>>>> allows to add XmlTransient annotations to java.lang.Exception class.
>>>>
>>>> How would I configure CXF to invoke these custom JAXB annotation readers
>>>> during runtime? I am not sure as to how this custom JAXBContext could be
>>>> created to override CXF JAXBContext.
>>>>
>>>> Please clarify.
>>>>
>>>> Thank you,
>>>> Arul
>>>>
>>>>
>>>>
>>>>
>>>>
>>> ---
>>> Daniel Kulp
>>> [EMAIL PROTECTED]
>>> http://www.dankulp.com/blog
>>>
>>>
>>>
>>>
>>>
>> ---
>> Daniel Kulp
>> [EMAIL PROTECTED]
>> http://www.dankulp.com/blog
>>
>>
>>
>>
>>
>> ________________________________
>> Scanned by MessageLabs for Flux
>> ________________________________
>>
>
>