Shalabh | 1 Feb 2011 07:21
Picon

Unable to get the 'First Application' running

I created the REST service,deployed it on GAE with URL http://rest4androidshalabh.appspot.com/. I
tried the JavaSE client but got the Contact object as NULL.My Application class code is:

 <at> Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach("/contacts/123",ContactServerResource.class);
return router;
}

I did not find any exceptions in the appspot log.However, I get the console output as:

Feb 1, 2011 11:36:45 AM org.restlet.engine.http.connector.HttpClientHelper start
INFO: Starting the default HTTP client
false true

My JavaSE client code is:

ClientResource cr = new ClientResource("http://rest4androidshalabh.appspot.com/contacts/123");
        	// Get the Contact object
        	ContactResource resource = cr.wrap(ContactResource.class);
        	Contact contact = resource.retrieve();

        	if (contact != null) {
        	    System.out.println("firstname: " + contact.getFirstName());
        	    System.out.println(" lastname: " + contact.getLastName());
        	    System.out.println("      age: " + contact.getAge());
        	}
        	else
        	{
(Continue reading)

Fabian Mandelbaum | 1 Feb 2011 14:08
Picon

Re: Re: Re: Re: Need help understanding the correct FLOW

Hello Randy. Even with HTTP Basic auth the provided credentials
(user+pass) are encoded. They are not transmitted like this on the
wire:

user=the_user
password=the_password

but, rather, like this, in a standard HTTP header:

Authorization	Basic YWRtaW5AY2FsZW5jby5jb206MTExMTEx

That YW...MTEx 'thing' is not encrypted, but encoded. However, you
don't have to even care about this, because Restlet takes care of all
these details.

As I said before, I don't know about Cookie authentication, but I've
successfully setup an authenticator that verifies credentials stored
on JCR. The code is Open Source, you can take a look at the relevant
sources here to 'find inspiration':

http://trac.calenco.com/browser/branches/stable/src/com/calenco/security/JcrVerifier.java
(this is the analog to what your DBVerifier should be)

http://trac.calenco.com/browser/branches/stable/src/com/calenco/CalencoV2App.java
(look around line 221)

Hope this helps. Good luck!

On Mon, Jan 31, 2011 at 1:39 PM, Randy Paries <rtparies <at> gmail.com> wrote:
> Fabián,
(Continue reading)

weltermann17 | 1 Feb 2011 16:21
Picon
Favicon

Suggestion: modify (B|N)ioUtils.getChannel|Stream|Reader

Hi,
the methods mentioned above in 2.1snapshot-jse all use a similar approach:
An extra thread is started that writes a representation to a pipe's sink and
the pipe's source is returned.

In a server environment where representations are not only served
statically, but processed in one way or another (cached to disk,
reformatted, analysed, accumulated etc.) while being sent to the client
these methods are used heavily.

BTW, we try to avoid the BioUtils methods as the NioUtils is using the >10x
faster PipeChannel.

My suggestion is to modify the extra thread's run() method to

SomeWriter writer = null
try {
  writer = pipesink
  representation.write(writer)
} catch(IOException e) {
  log e
} finally {
  try { representiaton.exhaust } catch (Exception e) {}
  try { representiaton.release} catch (Exception e) {}
  try { if (null != writer) writer.close } catch (Exception e) {}
}

I think this could reduce the risk of resource leaks (threads, sockets).

Guido Schmidt.
(Continue reading)

Killian | 2 Feb 2011 13:00
Picon
Picon

RE: Unsupported Media Type (415)

Hi Lads,

Could anyone give us some advice on this issue? It'd be really nice to get it working.

Thanks :-)

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701930

Joe Dec | 2 Feb 2011 15:28
Favicon

RE: Google AppEngine and Android problems

The correct link to the issue : http://restlet.tigris.org/issues/show_bug.cgi?id=1219

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701948

Joe Dec | 2 Feb 2011 15:20
Favicon

RE: Google AppEngine and Android problems

There is an open issue on that: http://restlet.tigri​s.org/ds/viewMessage​.do?dsForumId=4447​&dsMessageId=26794​69

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701947

Killian | 2 Feb 2011 16:38
Picon
Picon

RE: Unsupported Media Type (415)

I'm just after finding another thread which appears to have a similar problem

http://restlet.tigris.org/issues/show_bug.cgi?id=1219

There's no answer for it yet though.
Is anyone looking at this thread? It's been more than a week now since this issue was posted?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701961

Jerome Louvel | 2 Feb 2011 17:29
Gravatar

RE: Unsupported Media Type (415)

Hi Killian,

Thierry is looking at this right now. Thanks for your patience!

Best regards,
Jerome
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.o​rg
Noelios Technologies ~ http://www.noelios.com

-----Message d'origine-----
De : Killian [mailto:killian.levacher <at> cs.tcd.ie] 
Envoyé : mercredi 2 février 2011 16:38
À : discuss <at> restlet.tigris.org
Objet : RE: Unsupported Media Type (415)

I'm just after finding another thread which appears to have a similar problem

http://restlet.tigris.org/issues/show_bug.cgi?id=1219

There's no answer for it yet though.
Is anyone looking at this thread? It's been more than a week now since this issue was posted?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701961

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701968

(Continue reading)

Danny Leshem | 2 Feb 2011 18:06
Picon

Default representation again

I have a resource that returns representations in either “text/html” or “application/json”.

 

Everything works as expected when clients specify the “Accept” HTTP header. Otherwise, the server returns JSON by default, whereas I want it to return HTML. The question is how to do that.

 

A previous thread by Kevin Daly (http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2646542) says that the default representation is determined according to the order of plugins in the classpath. Is there a programmatic way to specify the default representation, e.g. using Restlet annotations?

 

Randy Paries | 2 Feb 2011 19:30
Picon

RE: Re: Re: Re: Re: Need help understanding the correct FLOW

Fabian 
thanks alot for all your help
I now have that working.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2701983


Gmane