Tim:
Was trying to use your LocalJacksonConverter in a Restlet application that I
have. But I wasn't sure how to go about doing that. I figured that I should
start in my createInboundRoot with something like...
ObjectMapper objectMapper = new ObjectMapper();
LocalJacksonConverter
Tim:
After some additional searching, I think I can get by with a simple singleton
OBJECT_MAPPER for each of my ServerResources. It's probably not as good as one
for all the ServerResources, but it is much simpler - and has already provided
a fairly dramatic performance improvement. So
I am pretty sure the answer to this question is No. Looking at code in
org.restlet.ext.oauth.Flow anything related to the userAgent flow has been
commented out.
Maybe it will be revived one day... wish I had the ability to do it :)
RB
--
I have used the OAuth2 extension to build a Restlet-based and plain Java
clients for my API (Restlet/GAE). These both use OAuth's authorization
flow which is supported by the OAuth2 extension. Now I wanted to build a
JavaScript client. JavaScript clients seem to require a different flow
Thank you for the response. I was able to use setTemplateLoader to get my
own code to point at a particular directory - but I didn't see how to
change what AuthPageServerResource was doing (without of course changing
that code and having my own version of it - which I didn't want to do).
Did
you can do is to explicitly manage the error entity, as
in the workaround in the snippet. It's not pretty, but it works.
--tim
On Tue, Jul 10, 2012 at 8:36 PM, Richard Berger [hidden
email]http://user/SendEmail.jtp?type=nodenode=7578202i=0
wrote:
And one further note, wrapping the client
Excellent points - I didn't quite realize that the Status was restlet
specific and now it makes more sense to me that (as you put it) the illusion
isn't extended all the way to Exceptions.
Thanks for your ongoing assistance and information!
RB
--
View this message in context:
My question is similar to that raised at:
http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
,
sure I DON'T have this problem. Is this a bug
in the client that it can't access the http status message? That is what
I'm gathering from the thread you linked as well.
bjorn
On Jul 10, 2012, at 1:18 PM, Richard Berger wrote:
My question is similar to that raised at:
http://restlet
(commitsRef);
CommitmentsResource commitsResource =
clientResource.wrap(CommitmentsResource.class);
Representation commitsRep = null;
commitsRep = commitsResource.represent();
Changes nothing
RB
On Tue, Jul 10, 2012 at 4:22 PM, Richard Berger rich...@landisfamily.orgwrote:
Yes, I
On my resource:
public class UserActsServerResource extends ServerResource implements
UserActsResource {...
I am able to use:
public final Representation represent() {
...
User user = UserHelpers.getCurrentUser(this.getRequest(), this.getResponse());
and this.getRequest() returns a useful
Took a week, but I did get it to work. For anyone else who runs into this
1. I was following the Ericsson documentation at:
https://labs.ericsson.com/apis/oauth2-framework/documentation#Web_Client_Flow
that got me as far as getting things to work on my local Google-app-engine dev
server.
One more note... there is a more complete code sample at:
http://fni.googlecode.com/svn/!svn/bc/622/trunk/fniCloud/src/fi/foyt/fni/cloud/
(it's much better than my code - although most of the Restlet relevant classes
seem to no longer be available in the owner's current version - they may have
I thought I was close - I had things working on my dev server, but when I
upload to appspot, I can no longer access my resources. If anyone has made
this work please post back and I will provide additional details.
Thanks!!
RB
--
View this message in context:
Using the instructions at
http://wiki.restlet.org/docs_2.1/13-restlet/28-restlet/404-restlet.html I am
able to use OpenId4Java to provide Google based authentication. In
particular, the line:
OpenIdVerifier verifier = new
OpenIdVerifier(OpenIdVerifier.PROVIDER_GOOGLE);
Does much of the magic.
Thanks so much! The /classes directory wasn't visible in Eclipse so I didn't
think to try there. So I just copied the files using Windows and that worked
perfectly!
Thanks again,
RB
--
I am working through the oAuth2 sample code and have hit a Restlet issue that
has stymied me for a while. Following the sample code, I have:
HttpOAuthHelper.setAuthPageTemplate(authorize.html, getContext());
However, when AuthPageServerResource.getPage() is called the following code
is unable to
Some success - at least when accessing a local GAE server.
#1. Replaced use of the Android Account Manager with at HttpClient call to
http://10.0.2.2:/_ah/login to obtain the authentication information
(dev_appserver_login=l:True:145185941422614610318; Path=/;)
This was followed by
Following Nick's excellent blog article at:
http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app
and with the changes I had made previously, I am now able to use the Android
AccountManager and Restlet's GaeAuthenticator to require authentication to
access the API
I had a problem like this and resolved it by adding:
Engine.getInstance().getRegisteredConverters().add(0, new
JacksonConverter());
to my Android code before I constructed my client resource
My code is just a little tweak on the documented version at:
Do you get the same 415 error when you go to /connection in your browser? (If
so, then the problem is in your ServiceConnection class, rather then in your
Android code).
Also, in my Android code, I don't wrap the resource, but do the call directly
on the ClientResource class, as in:
From the code that you have posted, I am not able to see the problem Perhaps
the type of your connect variable doesn't match the type defined in your
Server file. But that is just a guess.
Good luck!
RB
--
View this message in context:
Thanks again for the update - I will continue to work on this, although right
now I am in the midst of trying to get oAuth2 to work, so it may be a while
before I have a real response.
RB
--
View this message in context:
Thanks - that works perfectly for me.
I had been returning the guard to fix an earlier problem - but obviously I
fixed it in the wrong way.
Thanks again for the detailed solution!
RB
--
View this message in context:
Thank you for the response...
My simplified test code is now:
public final Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach(/v1/, RootServerResource.class);
router.attach(/v2/, RootServerResource.class);
GaeAuthenticator guard = new
As I am working on implementing authentication, I was wondering if I could
configure createInboundRoute to attach the GAEAuthenticator guard only to
uris of the form /v1/ (to implement authentication) and allow uris of
the form /v0/... to pass through without authentication.
My code
Engine.getInstance().getRegisteredConverters().add(0, new JacksonConverter());
Worked for me - putting the JacksonConverter first seemed to restore the
automagic :)
RB
--
Thanks so much - that was exactly what I needed! RB
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Is-there-a-way-to-get-the-response-code-from-the-annotated-ClientResource-tp7397618p7398735.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
Designing some Junit tests and in one of those tests, a create a Commitment,
then delete, then get it to make sure I get a 404.
On the server side, the following code executes:
public Representation get() {
...
setStatus(Status.CLIENT_ERROR_NOT_FOUND, There is no record with id +
[Solved]
public Representation get(MediaType mediaType) throws ResourceException
So I need to catch the ResourceException and examine the status (and that
works just fine).
--
View this message in context:
Felipe:
I have used the Restlet-Javascript edition, although only in a test
environment - and my use is probably pretty basic. Thierry has been very
responsive in answering questions that I had (mostly my issues were about
how representations were being negotiated).
Good luck,
RB
--
View
Given code like the following...
ClientResource commentClient = new ClientResource(...);
CommentsResource commentsResource =
commentClient.wrap(CommentsResource.class);
commentsResource.postCommentForm(form);
is there a way to get the response code from the commentsResource?
Currently I am
Thank you for the clarification. I made the changes you suggested (totally
dropping the postJava() method). I tested this with the Java client (it
worked, no surprise). I then tested it using the Apigee console - and it
still worked (a little surprise). Then tested it with a Javascript (using
I downloaded the 3/14 snapshot of 2.2 and I don't see a change. Two
points...
1. This may not be a bug - this may only be a conflict with my expectations
2. If this is a bug, is it possible that it is a Jackson problem and not a
Restlet problem?
Please let me know if I can provide additional
Thank you for the suggestions (I especially liked having the annotations only
in the interface). But no difference...
After removing the annotations from the implementation, the output was:
Mar 14, 2012 8:13:44 PM com.fourspires.api.server.CommentsServerResource
postJson
INFO: In postJson
Mar
I am now only using the @Post(java) method to be able to use:
ClientResource client4 = new ClientResource(someURL);
CommentsResource commentsResource = client4.wrap(CommentsResource.class);
Representation representation4 = commentsResource.postJava(comment);
rather than the more generic:
First, the good news. My code is working. But I don't understand WHY it
works.
Using Restlet and the Annotated Interface approach, described at
http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/328-restlet/285-restlet.html.
I am also running Restlet GAE (if that matters).
I am using
I am trying to follow the example in 6.3 of the latest version of Restlet in
Action to add WADL generation to my Restlet (GAE edition) app.
My application extends WadlApplication
/public class CommitmentServerApplication extends WadlApplication {/
All my resources extend /WadlServerResource/
Quick update - I put in explicit media types for the @Post() annotations on
my implementing classes, e.g.:
@Post(json)
public Representation acceptJson(String jsonString) {
And that has fixed the problem both when going through tcpmon and without
tcpmon involved. I wasn't able to figure out if
Thierry:
Thanks so much for your help. The short version is that the latest Restlet
JS code (plus one change in my code) fixes my problem with post(). There
is one strangeness that I will describe below, but it isn't a big problem
for me at this point, but I will describe it below in case you
First - thank you for your message and the work that you are doing.
I downloaded the latest .js files and the previously reported error is
indeed fixed. But my post() is still not being received on the server side
when called from Javascript. From Javascript, I am able to succesfully call
get
Thanks again for your help. I downloaded tcpmon and made the suggested
changes to my Java client. I then did a post through Java and below are
the Request and the Response.
Request
POST /commitments/ HTTP/1.1
Date: Wed, 15 Feb 2012 22:19:58 GMT
Content-Length: 109
Content-Type:
Haven't been able to find much documentation - all the posts here are quite
old - and just wondering if I should use something else for playing around
with a javascript REST client (e.g. JQuery).
On the other hand, if folks are hard at work on the Javascript edition - my
apologies!
Thanks in
Working on a small project to learn REST/Restlet and ran into a problem where
I can successfully post from a Java client to my server or from an HTML form
to my server, but when I try to post from Javascript it fails. I am
following the sample code that is now on github
Tutorial works fine for me in dev mode, but fails when I upload to appspot. I
only have a single servlet in my web.xml
web-app
context-param
param-nameorg.restlet.clients/param-name
param-valueCLAP FILE/param-value
/context-param
servlet
servlet-nameadapter/servlet-name
45 matches
Mail list logo