Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] POST ECF Rest call

Hi Atanas,

On 8/9/2011 10:36 AM, Атанас Тодоров wrote:
Hi Scott,

Please not that  i have the  same code snippet working for GET request.Or what i mean is that instead of HttpPostRequestType  i use HttpGetRequestType on client side .
On server side i have
public class MyResource extends ServerResource {
@GET
public Object getResource() {
    return "Some data"
           }
} or restlet implemented like that tutorial

I do not provide the server code as it is product specific and do not have anything we can look at.
The working workflow is like that:
1. client: make ECF Rest call  with HttpGetRequstType
2.server: getResource() is invoked and return some data(the code above)
3: client: ecf deserialize() is invoked with parameter responseBody  containing "Some data" string.

So i am able to make a GET ECF Rest request successfully and return response.The problem is i do not know how to make a POST request with ECF Rest API or better say how to invoke the ECF Rest call  on client so that be able to take the sent object from getResource() on server.

I see that the URL you provide above has a misspelling of myResouce (should be myResource?).  Is that just a problem in the email, or could that be the source of your general problem?

Also...what happens when you run the code?  Is an exception thrown?  It would be useful to also know what http response code comes back (or if one comes back at all).



Yes.  As I said, I have a Restlet-based ECF remote services provider now...that allows remote Restlet resources to be both discovered (via OSGi EndpointDescriptions), and a functioning proxy to be automatically created at remote service discover time.  This makes the implementation of the Restlet client completely unnecessary (i.e. it's done automatically by the OSGi remote services implementation).

This is the next thing i wanna try.Can i download  the Restlet-based ECF provider from somewhere?

No, not yet.  I'm trying to work out with Jerome Louvell and Bryan Hunt how to build and deploy the whole thing (i.e. Restlet, the Restlet/OSGi integration code, and this provider...which is dependent upon those other two components) so that it's relatively easy to install, etc. 


I somehow wanted to make the above approach work beforehand.

Yeah, I think that's a good idea...and would like to do this also...so lets please keep working on that.  I have other commitments so I may be less available over the next few days and am away the end of this week, but I will keep helping with this until we get things figured out for you.

Thanks,

Scott



Back to the top