Friends,

It seems there is some kind of restriction when the web server and the REST
server have different addresses.

I did another test, this time with my page being served by Apache (instead
of simply opening the .html file with the browser) and the REST server
running as a Drupal 6 module over the same Apache server. The REST server
module code came from here http://www.blakesenftner.com/Services-3-examples).

And I've made a small change on the pyjamas test code to put the URL on a
variable:

        HTTPRequest().asyncGet(url=url, handler=self, returnxml=False)

It don't works when       url = "
http://192.168.0.123/drupal6/api_shell/dev/note";   # 192.168.0.123 is the
server IP

It don't works when        url = "
http://127.0.0.1/drupal6/api_shell/dev/note";

It WORKS when        url = "http://localhost/drupal6/api_shell/dev/note";

Considering that the pyjamas created page is being served by Apache2 on the
address http://localhost/teste/rest.html

Only the last test worked, it seems, because both shares exactly the same
address ( localhost ). By the way, the answer came in XML because the
Drupal module uses XML and I didn't changed it yet.

The error, when it happens, is the following:

Unknown exception: TypeError: Cannot convert 'localHandler' to object

Traceback:
rest.py, line 63:
    RootPanel().add(RESTClient())
rest.py, line 39:
    HTTPRequest().asyncGet(url=url, handler=self, returnxml=False)
pyjamas.HTTPRequest.py, line 29:
    return self.asyncImpl('GET', user, pwd, url, postData, handler,
pyjamas.HTTPRequest.py, line 72:
    localHandler.onCompletion(responseText)


Lukasz, the request was: "GET /drupal6/api_shell/dev/note HTTP/1.1" 200 671
"http://localhost/teste/rest.mozilla.cache.html";

Really would be very nice to have an REST example in Pyjamas (with JSON
format if possible).


Thank you friends.

Marcio

Reply via email to