camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sriram C <sriram_chav...@yahoo.com>
Subject Re: Camel type converter question
Date Wed, 04 Mar 2009 17:51:42 GMT

Hi Willem,
Thanks for your reply. The issue in Kohsuke's blog is not the cause of my
problem. Let me explain my wsdl in a little more detail. My top level
element is defined as following:

<element name="notifications">
                <complexType> 
                    <sequence> 
                    	<element name="OrganizationId" type="ent:ID"/>
                    	<element name="ActionId" type="ent:ID"/>
                    	<element name="SessionId" type="xsd:string"
nillable="true"/>
                    	<element name="EnterpriseUrl" type="xsd:string"/>
                    	<element name="PartnerUrl" type="xsd:string"/>
                        <element name="Notification" maxOccurs="100"
type="tns:Notification"/>
                    </sequence> 
                </complexType> 
</element>

jaxb using the simple binding generates the correct bean object
(Notifications) with the @XmlRootElement for the top level element. However
since the contained element is defined as of type Notification defined
below:

<complexType name="Notification">
                <sequence>
                    <element name="Id" type="ent:ID"/>
                    <element name="sObject" type="ens:sObject"/>
                </sequence>
</complexType>

The bean for the above complexType (Notification) is generated without the
@XmlRootElement. I wish to persist the Notification objects to the disk
using the FileEndPoint generated using the following routing snippet:
.convertBodyTo(Notification.class).setHeader(FileComponent.HEADER_FILE_NAME).constant("sriram.txt").to("file:/to/my/path")
      

However since the Notification bean is missing the @XmlRootElement, the
FallbackTypeConverter is failing to marshall this to XML. This is the
problem I am trying to solve. JAXB has the notion of DataTypeAdapters which
can be used to specify marshalling rules for jaxb elements and types.  I
wonder if anybody on this forum has tried using these Adapters in
conjunction with the FallbackTypeConverter.

Sriram


willem.jiang wrote:
> 
> Hi Sriram,
> 
> I just used google to do a quick search, the error may relate to the
> anonymous complexTypes in your wsdl.
> Here is the link[1] which talks about it.
> 
> [1]
> http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
> 
> Willem
> 
> 
> Sriram C wrote:
>> 
>> I have defined a CXF jaxws endpoint. The incoming message to this end
>> point has an element which is defined as a ComplexType in the wsdl.  The
>> CXF wsdl2java utility generates this complextype with an @XmlType
>> annotation. Since it is missing the @XmlRootElement annotation, the
>> FallbackTypeConverter is unable to marshall this object. What is a good
>> solution for resolving this issue?
>> 
>> Thanks in advance,
>> Sriram
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Camel-type-converter-question-tp22322333p22335454.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message