cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dponos <dpo...@cisco.com>
Subject Re: @XMLRootElement for parameters in REST method signatures
Date Tue, 05 Jul 2011 23:01:06 GMT

Sergey Beryozkin-5 wrote:
> 
> 
>>
>> FYI, I am not on version 2.4.0 yet, so I am not using the Transform
>> feature.
>> I am still using inTransformElements on the provider.  Not sure if that
>> makes a difference for being able to use wildcards or not.
> 
> Wildcards should be supported starting from CXF 2.2.7, even when
> configuring providers directly, instead of
> applying a feature, so please report a bug if you work with CXF 2.2.7+
> 
> Thanks, Sergey
> 
> 

I just verified that wildcards are working in version 2.2.7  

The project I am working on is using 2.2.6.   

To summarize, here is what I needed to do in order to successfully use
generated classes from an XSD  as parameters in REST service methods : 

1.  The Element should be defined something like : 

<xs:element name="fooType">
    <xs:complextType>
            .
            .
    </xs:complextType>
</xs:element> 

as apposed to : 

<xs:complexType name="FooType">
    .
    .
</xs:complexType> 
<xs:element name="foo" type="tns:FooType"/> 


This will result in the @XmlRootElement getting generated, which is needed
for the Class to exist
as a paramter in the REST API method signature. 


2. Add the following to the inTransformElements property for the provider
(Spring example).....

<entry key="*" value="{http://somevalue}*" />  

3.  Make sure I am using version 2.2.7+ of the cxf-bundle. 




--
View this message in context: http://cxf.547215.n5.nabble.com/XMLRootElement-for-parameters-in-REST-method-signatures-tp4537057p4555121.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message