Litos
07-21-2004, 12:20 PM
Hello folks,
I'm trying to send XML variables from Flash MX (Professional) to a Servlet (Tomcat 5.0)... but when I send the text the doGet function is called. And I can not get anything from the message.
__________Actionscripting code__________
var loginXML = new XML();
loginXML.contentType = "text/xml";
loginXML.ignoreWhite = true;
var loginElement = loginXML.CreateElement("LOGIN");
loginElement.attributes.username = "username";
loginElement.attributes.password = "verySecret";
loginXML.appendChild(loginElement);
var loginReplyXML = new XML();
loginReplyXML.onLoad = onLoginReply;
loginXML.sendAndLoad("http://localhost:8081/Connect/sms", loginReplyXML);
___________Servlet code_______________
public void doPost (HttpServletRequest request, HttpServletResponse response) {
System.out.println("doPOST!!");
.....
}
public void doGet (HttpServletRequest request, HttpServletResponse response){
System.out.println("doGET!!");
System.out.println("---GetHeaders---");
enum = request.getHeaderNames();
while (enum.hasMoreElements()){
String key = (String)enum.nextElement();
System.out.println(" "+key+" -> "+request.getHeader(key) );
}
System.out.println("---GetParameterNames---");
enum = request.getParameterNames();
while (enum.hasMoreElements()){
String key = (String)enum.nextElement();
System.out.println(" "+key+" -> "+request.getParameter(key) );
}
System.out.println("---Reader---");
BufferedReader br = request.getReader();
String reqBody=br.readLine();
System.out.println("reqBody: "+reqBody);
......
____________My Server Output______________
doGET!! :eek:
---GetHeaders---
referer -> http://localhost:8081/Connect/sms
x-flash-version -> 7,0,14,0
content-type -> text/xml
content-length -> 0
user-agent -> Shockwave Flash
host -> localhost:8081
cache-control -> no-cache
---GetParameterNames---
---Reader---
reqBody: null
________ HELP!! :confused: ________
Ok, how can I get the XML text??
I have been looking for a response on the Internet but with no luck.
Is the Flash MX 2004 Professional a problem maybe?
I had headhaches before mixing old code with ActionScripting 2 and Flash Player version 7...
Do you know if I could send XML variables to the server (not receiving) using the XMLConnector component?
I apreciate any help you give me. Thank you.
I'm trying to send XML variables from Flash MX (Professional) to a Servlet (Tomcat 5.0)... but when I send the text the doGet function is called. And I can not get anything from the message.
__________Actionscripting code__________
var loginXML = new XML();
loginXML.contentType = "text/xml";
loginXML.ignoreWhite = true;
var loginElement = loginXML.CreateElement("LOGIN");
loginElement.attributes.username = "username";
loginElement.attributes.password = "verySecret";
loginXML.appendChild(loginElement);
var loginReplyXML = new XML();
loginReplyXML.onLoad = onLoginReply;
loginXML.sendAndLoad("http://localhost:8081/Connect/sms", loginReplyXML);
___________Servlet code_______________
public void doPost (HttpServletRequest request, HttpServletResponse response) {
System.out.println("doPOST!!");
.....
}
public void doGet (HttpServletRequest request, HttpServletResponse response){
System.out.println("doGET!!");
System.out.println("---GetHeaders---");
enum = request.getHeaderNames();
while (enum.hasMoreElements()){
String key = (String)enum.nextElement();
System.out.println(" "+key+" -> "+request.getHeader(key) );
}
System.out.println("---GetParameterNames---");
enum = request.getParameterNames();
while (enum.hasMoreElements()){
String key = (String)enum.nextElement();
System.out.println(" "+key+" -> "+request.getParameter(key) );
}
System.out.println("---Reader---");
BufferedReader br = request.getReader();
String reqBody=br.readLine();
System.out.println("reqBody: "+reqBody);
......
____________My Server Output______________
doGET!! :eek:
---GetHeaders---
referer -> http://localhost:8081/Connect/sms
x-flash-version -> 7,0,14,0
content-type -> text/xml
content-length -> 0
user-agent -> Shockwave Flash
host -> localhost:8081
cache-control -> no-cache
---GetParameterNames---
---Reader---
reqBody: null
________ HELP!! :confused: ________
Ok, how can I get the XML text??
I have been looking for a response on the Internet but with no luck.
Is the Flash MX 2004 Professional a problem maybe?
I had headhaches before mixing old code with ActionScripting 2 and Flash Player version 7...
Do you know if I could send XML variables to the server (not receiving) using the XMLConnector component?
I apreciate any help you give me. Thank you.