You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sriram C <sr...@yahoo.com> on 2009/03/04 03:18:26 UTC
Camel type converter question
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-tp22322333p22322333.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel type converter question
Posted by Sriram C <sr...@yahoo.com>.
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.
Re: Camel type converter question
Posted by "willem.jiang" <wi...@gmail.com>.
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-tp22322333p22323311.html
Sent from the Camel - Users mailing list archive at Nabble.com.