Hello there,
I created a servlet in java that will give me a xml response when called
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/xml; charset=utf-8"); // Set the servlet's response type to XML.
PrintWriter out = null;
try {
out = response.getWriter();
XMLOutputFactory of = XMLOutputFactory.newInstance();
XMLStreamWriter writer = of.createXMLStreamWriter(out);
writer.writeStartDocument();
writer.writeStartElement("Test");
for(int i = 1; i <= 100; i++) {
writer.writeStartElement("TheNumber");
writer.writeAttribute("number", "" + i);
writer.writeAttribute("value", "" + Math.pow(2, i));
writer.writeEndElement();
}
writer.writeEndElement();
writer.close();
out.close();
} catch (Exception ex) {
}
}
Now I want to get this xml in flex, can someone give me a hint? I tried mx:WebService and mx:HttpService but both of them did not work.
Thanks in advance
Sebastian