Thanks for your comment, it helped me a lot. Indeed that's the "problem".
I guess the next step is to create a good response so the RPC works. Or is
there any better solution? (I can't avoid the cross-site situation)
I've overriden the doOptions method in the servlet with the following code:
@Override
protected void doOptions(HttpServletRequest req, HttpServletResponse
res){
res.addHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
res.addHeader("Connection", "Keep-Alive");
res.addHeader("Keep-Alive", "115");
res.addHeader("Access-Control-Allow-Origin",
req.getHeader("Origin"));
res.addHeader("x-gwt-permutation", GWT.getPermutationStrongName());
res.addHeader("x-gwt-module-base", "
http://localhost:8084/AnalisiHeuristic/cat.udl.griho.AnalisiHeuristic.Main/
");
}
But it's not working yet, what am I doing wrong? isn't this the good
approach? :(
GWT: 2.0.3
Tomcat: 6.0.26
OS: Ubuntu 10.04
*Request:*
OPTIONS
/AnalisiHeuristic/cat.udl.griho.AnalisiHeuristic.Main/analisiheuristicservice
HTTP/1.1
Host: localhost:8084
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv:1.9.2.3)
Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Origin: http://www.arandomwebsite.is
Access-Control-Request-Method: POST
Access-Control-Request-Headers: x-gwt-module-base,x-gwt-permutation
2010/6/22 Sripathi Krishnan <[email protected]>
> Probably because you are trying to make cross-domain requests (a different
> port, domain or protocol)
>
> See this post -
> http://groups.google.com/group/google-web-toolkit/browse_thread/thread/a080757856163097
> <http://groups.google.com/group/google-web-toolkit/browse_thread/thread/a080757856163097>
> --Sri
>
>
> On 22 June 2010 16:19, enTropy Fragment <[email protected]> wrote:
>
>> Hello
>>
>> Here is my problem:
>> When I call my rpc from inside the war everything works well, but when I
>> call the same rpc calls from the same GWT javascript client stuff but
>> injected into an external web site the rpc makes the call with HTTP OPTIONS
>> instead of HTTP POST method.
>> I'm very interested in calling the rpc this way...
>>
>> How can I make this work?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-web-toolkit%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.