Discussion:
access webservice with hostname versus localhost
Juan
2013-01-07 20:11:59 UTC
Permalink
I have been playing with the Restlet examples, seems that the URI defined in the router.attach call (http://localhost:8111/hello) needs to called exactly like it from the clients, including the host name. If my local machine is named galaxy18 and i run the webservice and local client, I can only access it via localhost:8111/hello. If I change the router.attach to http://galaxy18:8111/hello then the client can access it with galaxy18 but not with localhost.

I don't like hardcording, especially machine names, if you can imagine this will be a pain if my webservice is running on different machines.

Is this an instance where I need to use read the hostname into a variable then use that in the router.attach or am i missing something basic here?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=3041554
Dejan Lozanovic
2013-01-07 21:29:44 UTC
Permalink
attach it with "/hello"

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=3041611
Jerome Louvel
2013-01-15 18:32:37 UTC
Permalink
Hi Juan,

Are you using virtual hosts with a Restlet component? What is your runtime
environment?

Thanks,
Jerome
--
http://restlet.com
http://twitter.com/#!/jlouvel
Post by Dejan Lozanovic
attach it with "/hello"
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=3041611
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=3043673
Loading...