Hi again
I have a question about returning responses to HTTP requests in the context of
a RESTful web service.
This is my method declaration in the WADL:
<method id="saveA" name="PUT">
<request>
<representation mediaType="application/xml" element="ns1:A" />
</request>
<response status="200">
<param name="header1" style="header" type="xsd:string" />
</response>
</method>
After generating the code, I get the following method signature:
public void saveA(AType atype);
If the PUT operation performed well, I would like to return an HTTP response
with status code 200 and an HTTP header containing a certain value. This is
indicated in the WADL, but I don't see anything in the code. Since the method
saveA doesn't return anything, where is the right place to customize the
response (i.e. setting the desired status code and header)?
Also, what if for a given request, different responses may be returned
according to how the operation performed? Should I add multiple responses in
the method element (in the WADL)?
Thanks,
Mickael