camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sriraman Gopalan <>
Subject Camel CXF component - Adding custom context classes via the uri options
Date Sat, 26 Jan 2013 07:37:47 GMT
Dear All,

We use the camel - cxf component to invoke external web services. We use the
uri format with options to set various attributes as shown below:


This works well for most cases without any issues. However, the issue is
with one of the web services wherein for one operation's response , one of
the element's type is marked as xsd:any which resulted in the generated
classes having Object as the attribute type.

wsdl snippet:

<s:element name="GetWTDataResponse">
            <s:element minOccurs="0" maxOccurs="1" name="GetWTDataResult">
                  <s:any />

Generated Java Code Snippet:

public static class GetWTDataResult {

        @XmlAnyElement(lax = true)
        protected Object any;

        public Object getAny() {
            return any;

        public void setAny(Object value) {
            this.any = value;


While invoking the actual service ( a .NET web service), the response comes
with the xsd and the data.

Actual web service response snippet:

<GetWTDataResponse xmlns="">
        <xs:schema xmlns="" xmlns:xs=""
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet">
          <xs:element name="NewDataSet" msdata:IsDataSet="true"
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="Table">
                      <xs:element name="InsType" type="xs:string"
                      <xs:element name="MarketVal" type="xs:double"
                      <xs:element name="InvestAmount" type="xs:double"
                      <xs:element name="TransDate" type="xs:dateTime"
        <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
          <NewDataSet xmlns="">



To make jaxb aware of this element "NewDataSet", we generated the jaxb
classes from the xsd in the web service response as shown above using

Now, the issue is how do we make this custom jaxb classes available to cxf
so that it correctly deserializes the response?

After searching the net, we found that this can be accomplished via code as
shown in the following link:

progress documentation

Since, we are using camel cxf component, is there any other way to indicate
to cxfendpoint to use these extra jaxb classes?

I did notice that the camel cxf component allows setting of custom cxf
properties via the properties.XXX format.

However, I am not too sure how to set this for the
jaxb.additionalContextClasses property which is a property in the
jaxwsproxyfactory bean.

Any help would be highly appreciated.

best regards

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message