Use of ClientResource inside a server resource

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Use of ClientResource inside a server resource

Xavier Mehaut
Hello,
I would like to know if we can use a ClientResource call inside a server resource, and if not, how to do this properly?
regards
Xavier
Reply | Threaded
Open this post in threaded view
|

Re: Use of ClientResource inside a server resource

Fabian Mandelbaum
Hello Xavier,

yes, you can, there shouldn't be any problems with this, at least AFAIK.

On Tue, Aug 24, 2010 at 6:09 AM, Xavier M. <[hidden email]> wrote:
> Hello,
> I would like to know if we can use a ClientResource call inside a server
> resource, and if not, how to do this properly?
> regards
> Xavier
>



--
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067
Reply | Threaded
Open this post in threaded view
|

Re: Use of ClientResource inside a server resource

Xavier Méhaut
Hi Fabian,
We succeeded actually  ; we've only forgottent to write "getClients().addProtocol(Protocol.HTTP)" on the server side ...
thanks
regards
Xavier

2010/8/25 Fabian Mandelbaum <[hidden email]>
Hello Xavier,

yes, you can, there shouldn't be any problems with this, at least AFAIK.

On Tue, Aug 24, 2010 at 6:09 AM, Xavier M. <[hidden email]> wrote:
> Hello,
> I would like to know if we can use a ClientResource call inside a server
> resource, and if not, how to do this properly?
> regards
> Xavier
>



--
Fabián Mandelbaum
IS Engineer

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


Reply | Threaded
Open this post in threaded view
|

Re: Use of ClientResource inside a server resource

Fabian Mandelbaum
Ah, indeed you have to add all protocols you intend to support (FILE,
HTTP, HTTPS...) as clients on the server.

You are welcomed.
Kind regards.

On Wed, Aug 25, 2010 at 8:13 AM, Xavier Méhaut <[hidden email]> wrote:

> Hi Fabian,
> We succeeded actually  ; we've only forgottent to write
> "getClients().addProtocol(Protocol.HTTP)" on the server side ...
> thanks
> regards
> Xavier
>
> 2010/8/25 Fabian Mandelbaum <[hidden email]>
>>
>> Hello Xavier,
>>
>> yes, you can, there shouldn't be any problems with this, at least AFAIK.
>>
>> On Tue, Aug 24, 2010 at 6:09 AM, Xavier M. <[hidden email]>
>> wrote:
>> > Hello,
>> > I would like to know if we can use a ClientResource call inside a server
>> > resource, and if not, how to do this properly?
>> > regards
>> > Xavier
>> >
>>
>>
>>
>> --
>> Fabián Mandelbaum
>> IS Engineer
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067
>>
>
>



--
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651121
Reply | Threaded
Open this post in threaded view
|

Re: Use of ClientResource inside a server resource

Bruno Harbulot
In reply to this post by Xavier Méhaut
Hi Xavier,

In addition, if you're running the application within a servlet
environment, you can configure the clients by adding this in the web.xml
file:

  <context-param>
                <param-name>org.restlet.clients</param-name>
                <param-value>HTTP HTTPS CLAP FILE</param-value>
        </context-param>

(Adapt the param-value as you need, it's a space-separated list of
protocols.)


Best wishes,

Bruno.

On 25/08/10 12:13, Xavier Méhaut wrote:

> Hi Fabian,
> We succeeded actually  ; we've only forgottent to write
> "getClients().addProtocol(Protocol.HTTP)" on the server side ...
> thanks
> regards
> Xavier
>
> 2010/8/25 Fabian Mandelbaum <[hidden email]
> <mailto:[hidden email]>>
>
>     Hello Xavier,
>
>     yes, you can, there shouldn't be any problems with this, at least AFAIK.
>
>     On Tue, Aug 24, 2010 at 6:09 AM, Xavier M. <[hidden email]
>     <mailto:[hidden email]>> wrote:
>      > Hello,
>      > I would like to know if we can use a ClientResource call inside a
>     server
>      > resource, and if not, how to do this properly?
>      > regards
>      > Xavier
>      >
>
>
>
>     --
>     Fabián Mandelbaum
>     IS Engineer
>
>     ------------------------------------------------------
>     http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067
>     <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067>
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651196
Reply | Threaded
Open this post in threaded view
|

Re: Use of ClientResource inside a server resource

Xavier Méhaut
Thanks Bruno

2010/8/25 Bruno Harbulot <[hidden email]>
Hi Xavier,

In addition, if you're running the application within a servlet
environment, you can configure the clients by adding this in the web.xml
file:

       <context-param>
               <param-name>org.restlet.clients</param-name>
               <param-value>HTTP HTTPS CLAP FILE</param-value>
       </context-param>

(Adapt the param-value as you need, it's a space-separated list of
protocols.)


Best wishes,

Bruno.

On 25/08/10 12:13, Xavier Méhaut wrote:
> Hi Fabian,
> We succeeded actually  ; we've only forgottent to write
> "getClients().addProtocol(Protocol.HTTP)" on the server side ...
> thanks
> regards
> Xavier
>
> 2010/8/25 Fabian Mandelbaum <[hidden email]
> <mailto:[hidden email]>>
>
>     Hello Xavier,
>
>     yes, you can, there shouldn't be any problems with this, at least AFAIK.
>
>     On Tue, Aug 24, 2010 at 6:09 AM, Xavier M. <[hidden email]
>     <mailto:[hidden email]>> wrote:
>      > Hello,
>      > I would like to know if we can use a ClientResource call inside a
>     server
>      > resource, and if not, how to do this properly?
>      > regards
>      > Xavier
>      >
>
>
>
>     --
>     Fabián Mandelbaum
>     IS Engineer
>
>     ------------------------------------------------------
>     http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067
>     <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067>
>
>

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


Reply | Threaded
Open this post in threaded view
|

Re: Use of ClientResource inside a server resource

Alexander Kampmann-2
In reply to this post by Bruno Harbulot
hi,

does that configuration in web.xml even work, if FrameworkServlet is
used instead of RestletServlet? I am using tomcat+spring on the Server-
side and got problems which, in my eyes, are related to a missing
protocol on server side.

Btw: 1) Why isn't HTTP/1.1 added by default when using a Servlet to
deploy Restlets in a servlet container? I think most users will need it,
otherwise they wouldn't use a servlet container.
2) And why is it possible to call the Restlet from a Servlet in the same
container, but not from outside (a ServerResource in a standalone
Restlet Application on the same machine)? I've even added a "Hello-
World"- Restlet and was able to reach it with my browser?

Thanks,
Alex

On 25.08.2010 14:46, Bruno Harbulot wrote:

> Hi Xavier,
>
> In addition, if you're running the application within a servlet
> environment, you can configure the clients by adding this in the web.xml
> file:
>
>     <context-param>
> <param-name>org.restlet.clients</param-name>
> <param-value>HTTP HTTPS CLAP FILE</param-value>
> </context-param>
>
> (Adapt the param-value as you need, it's a space-separated list of
> protocols.)
>
>
> Best wishes,
>
> Bruno.
>
> On 25/08/10 12:13, Xavier Méhaut wrote:
>    
>> Hi Fabian,
>> We succeeded actually  ; we've only forgottent to write
>> "getClients().addProtocol(Protocol.HTTP)" on the server side ...
>> thanks
>> regards
>> Xavier
>>
>> 2010/8/25 Fabian Mandelbaum<[hidden email]
>> <mailto:[hidden email]>>
>>
>>      Hello Xavier,
>>
>>      yes, you can, there shouldn't be any problems with this, at least AFAIK.
>>
>>      On Tue, Aug 24, 2010 at 6:09 AM, Xavier M.<[hidden email]
>>      <mailto:[hidden email]>>  wrote:
>>       >  Hello,
>>       >  I would like to know if we can use a ClientResource call inside a
>>      server
>>       >  resource, and if not, how to do this properly?
>>       >  regards
>>       >  Xavier
>>       >
>>
>>
>>
>>      --
>>      Fabián Mandelbaum
>>      IS Engineer
>>
>>      ------------------------------------------------------
>>      http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067
>>      <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067>
>>
>>
>>      
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651196
>
>

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