Hello Daniele,

actually the Application declares its need of an HTTP client connector by
using the connectorService. I wonder if the javadocs clairly explains this
point.
Here is the documentation of the ConnectorService#getClientProtocols:
Returns the modifiable list of required client protocols. You need to update
this list if you need the parent component to provide additional client
connectors.

The ConnectorService allows the applicaion to describe its need in terms of
client connectors. These client connectors must be provided by the parent
component:
Component#getClients#add(Protocol);

I hope this will help you.

Best regards,
Thierry Boileau


Hi.
>
> I instantiate a new ClientResource in the context of a Restlet
> Application to communicate to a third web service (in restlet itself).
> This just created client resource is set a ChildContext as the
> context. This resource does not seem to have any protocols cause it
> refers to the application protocols, that's an empty list.
>
> Here's what happens (restlet 2.0.8)
>
> 1. the server receives the request and answer correctly (200, right entity
> set)
> 2. the client logs a Warning about the missing protocol
> (ChildClientDispatcher, line 105)
> 3. the client see a 404 response
> 4. a ResourceException on the client side is raised.
>
> It took a lot to find this cause the server was answering a 200 and
> the correct entity, while the client was receiving a 404. This is very
> subtle, despite the warning.
>
> How can I add HTTP protocol to my application connector service?
> I've tried
>
> getConnectorService().getClientProtocols().add(Protocol.HTTP);
>
> in the application constructor but does not work, a sever exception is
> raised.
>
> Thanks.
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2790389
>

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

Reply via email to