Hi Gabo

Hi Sergey,


Re: */*

If I set the annotation @Consumes to */* and the @Produces to ("text/xml"), the wadl is not generated properly. I guess it is because of the difference between the two? In this case, is it really still advisable to have a separate annotation? I mean, shouldn't the annotation be reduced to 1 if it is required to have them as same values?

I'm sorry but it's been awhile since we discussed the actual issue you're 
seeing with the generated WADL...
Can you remind me please what exactly is happening ? Can you please post a 
sample resource class and method
(with @Consumes set to */* and the @Produces set to ("text/xml")) and clarify 
what is missing from the generated WADL ?

Is it the wadl:request element which has no links to the schema types ? If yes then it is expected when @Consumes is set to */*, given that it may even be that only a non-XML format which is accepted by a method...

cheers, Sergey




Gabo

Sergey Beryozkin wrote:
Hi

Hi Sergey,

Sorry for the delayed response to this thread. I am currently checking the generated WADL using 2.2.5. A few things I did to make it work:

1. Update consumes from */* to text/xml as the prior ends up showing only as:

<request>
<representation mediaType="*/*"/>
</request>

2. have namespace in the XML-related annotation of each class. Have not tested 
yet relying on pagkage.info class yet.

One thing though, see sample below:

<representation mediaType="text/xml" element="prefix27:Route"/>

The object Route is defined above, but the 'prefix27' part is not defined anywhere else. I think the same goes for 'xs' and 'tns' prefixes, is this ok?

the corresponding namespaces must be declared at the wadl:application level, can you verify please ? Likewise "prefix27" must poin to a namespace for one of the schemas in the grammars section. If you're looking at the generated wadl from the Firefox then you need to tell it to show the actual page source...


Also, since I had to change */* to something more specifc, wouldn't this conflict with one of the major advantages of CXF, i.e. ability to automatically handle json, xml, etc without any other changes?

Sorry, not sure what you mean. If your class has say application/xml & application/json produces values then the generated WADL should have it reflected


Also, is it possible to configure somewhere to NOT apply the interceptors when viewing the wadl? I have my own implementation of http-auth digest and the password is being required whenever the wadl is being viewed. I was hoping it should be viewable without need of auth like wsdl.

Can you interceptor check that it is a _wadl query and if yes then let the 
processing continue ?

cheers, Sergey

Reply via email to