aspose file tools*
The moose likes Web Services and the fly likes Can wadl be used to validate rest request? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can wadl be used to validate rest request?" Watch "Can wadl be used to validate rest request?" New topic
Author

Can wadl be used to validate rest request?

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I have read and attempted several of the tutorial/postings online regarding the creation of a WADL for Jersey which I was able to create. I was wondering how would I go about setting up validation of request against a WADL the way I would with SOAP/WSDL. For example if the request URL is localhost:8080?x=1&y2 and only x is a valid parameter, could the use of a WADL allow us to throw an exception. Can this even be done the way I'm thinking? I am using Jersey 1.12 + JAXB

Thank you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42631
    
  65
I'm not sure I follow. That *is* a valid request - other parameters will simply be ignored. The way WSDL (and WADL) are generally used is to generate client-side code that uses just the requisite parameters (and so wouldn't send any other parameters); is that not how you are using it?


Ping & DNS - my free Android networking tools app
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
Currently the service can be consumed by several means thus the client might or might not use "generated client side code", thus its possible that a URL could be composed to include invalid parameters. So I was hoping there would be a way to return either a JSON/XML error like the one below in the case of a XML request
<unsupportedQueryParameter>
One of the query parameters specified in the request URI is not supported.
</unsupportedQueryParameter>

Thanks
 
Consider Paul's rocket mass heater.
 
subject: Can wadl be used to validate rest request?