Thursday, May 24, 2012

Sending request between servers

Hi,

My problem might seems strange but just to make it simpler imagine I
have a sever that runs GWT app listening on port 8080 and PHP app on
tis same server (apache listening on port 8000).

What I want to do is to make an ajax request from second server to GWT
and get an JSON answer. What I manage to do is to make a call with
exacly this same parameters, setting manually X-GWT-Module-Base in
call, but the anser I get is: Incorrect JSON string.

If I do this call from GWT server it works ok. Original headers:

Request URL:http://192.168.16.201:8080/test
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:157
Content-Type:text/x-gwt-rpc; charset=UTF-8
Host:192.168.16.201:8080
Origin:http://192.168.16.201:8080
Referer:http://192.168.16.201:8080/
User-Agent:Mozilla/5.0
(X11; Linux i686) AppleWebKit/536.5 (KHTML,
like Gecko) Chrome/19.0.1084.46 Safari/536.5
X-GWT-Module-Base:http://192.168.16.201:8080/maingui/
X-GWT-Permutation:E2298EA5C990D38B70D7942E75D62D4D

Request Payload
7|0|4|http://192.168.16.201:8080/maingui/|
B4325BEA8959861B9498186969F7C197|dk.nw.test.shared.service.TestService|
getInterruptStatusProviders|1|2|3|4|0|

Headers from my call:

Request URL:http://192.168.16.201:8000/celoxservice
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:157
Content-Type:text/x-gwt-rpc; charset=UTF-8
Host:192.168.16.201:8000
Origin:http://192.168.16.201:8000
Referer:http://192.168.16.201:8000/request=webgui
User-Agent:Mozilla/5.0
(X11; Linux i686) AppleWebKit/536.5 (KHTML,
like Gecko) Chrome/19.0.1084.46 Safari/536.5
X-GWT-Module-Base:http://192.168.16.201:8080/maingui/
X-GWT-Permutation:E2298EA5C990D38B70D7942E75D62D4D

Request Payload
7|0|4|http://192.168.16.201:8080/maingui/|
B4325BEA8959861B9498186969F7C197|dk.nw.test.shared.service.TestService|
getInterruptStatusProviders|1|2|3|4|0|

As you can see only Host, Origin and Referer are different in my call.
Any sugestions? Thanks!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment