Randomly the response is coming as null although the required DB save/Update
is successful
Scenario:
I am using Rest web services(Restlet) for client-server communication
1>URLFetchService as client (as HTTPClient is not supported)
URL url = new URL("http://localhost:8080" + path);
URLFetchService urlFetchService =
URLFetchServiceFactory.getURLFetchService();
HTTPRequest httpRequest = new HTTPRequest(url, HTTPMethod.POST);
httpRequest.setPayload(payload.getBytes());
resp = urlFetchService.fetch(httpRequest);
2>Sending the data as an XML and on the server side unmarshalling it using
JAXB.
3>After saving/updating the JDO , i am returning an appropriate status
message as a Representation in response.
e.g - new StringRepresentation("User already exists.",
MediaType.TEXT_PLAIN);
The problem is that many times the response is coming as null even though an
status with a proper Representation is returned.
I came to many assumptions to justify the above issue
1>May be the URLFetchService times out (as i read somewhere that it times
out in 5sec)
2>The web layer calling REST services & the app layer responding are on the
same GAE server.
Also tried using urlFetchService.fetchAsync()..
Struggling with this issue for past one week
Any insights...Please update
Thanks
Sri
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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-appengine-java?hl=en.