Hi

you need to enable a "linkJsonToXmlSchema" WADLGenerator property

Cheers, Sergey
On 09/05/14 21:24, giomes wrote:
Hello to all.
I'm using CXF version 2.7.6.

This is my resource configuration:
        <cxf:rsServer id="exchangeCoinServer"
                address="http://localhost:8080/exchangecoins";
        
serviceClass="it.quigroup.titan.exchange.restfulep.service.CoinFacadeService"
                loggingFeatureEnabled="true">
                <cxf:providers>
                        <ref bean="jsonProvider" />
                        <ref bean="cxfExceptionMapper" />
                        <ref bean="wadlGenerator" />
                </cxf:providers>
        </cxf:rsServer>

This is my resource class:

public class CoinFacadeService {

        @POST
        @Path("/")
        @Produces(MediaType.APPLICATION_JSON)
        @Consumes(MediaType.APPLICATION_JSON)
        public DefineCurrencyForVirtualCoinResponseDTO
defineCurrencyForVirtualCoin(
                        DefineCurrencyForVirtualCoinDTO 
defineCurrencyForVirtualCoinDTO) {
                return null;
        }
}

This is DefineCurrencyForVirtualCoinDTO bean:

@XmlRootElement (name="DefineCurrencyForVirtualCoin")
public class DefineCurrencyForVirtualCoinDTO {
        @XmlElement
        @NotNull
        private String codSourcePurse;

        @XmlElement
        @NotNull
        private String codTargetCurrency;

        public String getCodSourcePurse() {
                return codSourcePurse;
        }

        public void setCodSourcePurse(String codSourcePurse) {
                this.codSourcePurse = codSourcePurse;
        }

        public String getCodTargetCurrency() {
                return codTargetCurrency;
        }

        public void setCodTargetCurrency(String codTargetCurrency) {
                this.codTargetCurrency = codTargetCurrency;
        }
}

When I try to invoke ?_wadl URL I get a wadl without grammar:
<application xmlns="http://wadl.dev.java.net/2009/02";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <grammars/>
    <resources base="http://localhost:9071/exchangecoins";>
       <resource path="/">
          <method name="POST">
             <request>
                <representation mediaType="application/json"/>
             </request>
             <response>
                <representation mediaType="application/json"/>
             </response>
          </method>
       </resource>
    </resources>
</application>

What am I doing wrong?
Thank you.




--
View this message in context: 
http://cxf.547215.n5.nabble.com/Wadl-Generator-produces-empty-grammar-tp5743829.html
Sent from the cxf-user mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to