Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] Consumer REST Update problem

Hi,  A couple of things:

1.  You might want to check out the OslcClient in the org.eclipse.lyo.client Git repo - it provides some additional wrapping for the base OSLC4J OslcRestClient.

2. In any case - when you get the 405 are there any messages displayed on the OSLC4JStockQuote console?  Wink will often output informative messages when it cannot  match a REST call to a JAX-RS annotated method.  

Can you share your full sample code?

Regards,
Mike


On Tue, Apr 23, 2013 at 6:04 AM, Heng Cao <cao_heng@xxxxxxx> wrote:
Hi all,
I have started with implementation of a Dummy Consumer, and the Provider is the Lyo example StockQuote.
So far I can retrieve the Information like this :
     OslcRestClient oslcRestClient = new OslcRestClient(providers, queryBase, MEDIA_TYPE, timeout);
     StockQuote[] stocks = oslcRestClient.getOslcResources(StockQuote[].class);
And in main Method I can output them in my Console.

Now I want to change some values and update them, so I used the Method like this :

 OslcRestClient oslcRestClient = new OslcRestClient(providers, resourceBase, MEDIA_TYPE, timeout);
 ClientResponse clientResponse = oslcRestClient.updateOslcResourceReturnClientResponse(updatedResource);

resourceBase is "http://localhost:8080/OSLC4JStockQuote/stockQuotes/nasdaq_nflx" which I target to.

And then the System responses with Status 405- Method Not Allowed. I really dont know , what I did wrong,
Could someone help me with this issue ? Thanks a lot

Best Regards
Heng Cao

_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/lyo-dev


Back to the top