I see that Google App Engine can host web applications that will return html, etc. But what about web services that communicate over http and accept / return xml?
Does anyone know how this is being done in Goggle App Engine with Python or for that matter in Java (JAS-WX is not supported)? Any links o samples or articles is greatly appreciated.
Thanks // :)
Google App Engine allows you to write web services that return any type of HTTP response content. This includes xml, json, text, etc.
For instance, take a look at the guestbook sample project offered by Google which shows the HTTP response coming back as text/plain:
public class GuestbookServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
if (user != null) {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, " + user.getNickname());
} else {
resp.sendRedirect(userService.createLoginURL(req.getRequestURI()));
}
}
}
Additionally, the app engine google group is a great place to learn more, ask questions, and see sample code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With