I have implemented a test method with Jersey to run on my Google AppEngine local development server. The method signature is:
@GET
public String sayHello(@QueryParam ("name") String id)
I input the following url into my web browser to test it:
http://127.0.0.1:8888/sayhello?name=bill
, whereupon the browser receives the intended “Hello, bill” response.
However, when I deploy this appengine app to the cloud, I do not get the intended response. The name echoes back null as “Hello, “. I logged the received QueryParam value, and the logs confirm that the query parameter is not getting passed into the method.
code.rest.impl.Test sayHello: name QueryParam received is:null
If I also assign a @DefaultParam, the declared default parameter replaces the null value, as expected.
Why is the deployed cloud app not receiving URL query parameters, while the local development server receives them correctly? Is there a security configuration I need to modify?
I determined why this isn’t working. Two reasons, actually, but the main reason is that I was forwarding the requests from a domain that was not a registered Google AppEngine domain. Both requests were received intact, but looking at the logs, they are handled differently.
forwarded from a Google Apps domain I don’t control, or any regular domain:
from a Google Apps domain I control and is associated with this AppEngine instance (note the difference in how the request is reported/handled):
The other (embarrassing) overlaying reason this wasn’t working was that I was making port 443 requests from my browser to test the web service, because I use a Firefox plugin that adds https: automatically, and this is just an http web service.