A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: XML sendAndLoad not supported in Netscape?

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    2
    This is a question, but unfortunately I think it's rhetorical. I have posted about this before on Macromedia's forum, twice in fact, and had some offers to dissect the HTTP conversation my browser/flash plug-in is having with the server, but no word from Macromedia.

    I have made my example even simpler and it blows my mind that even the simplest call, to XML.send() doesn't work from either NS4 w/ Flash 6 Plug-in, or NS6 w/ Flash 5 Plug-in.

    My ActionScript is very simple:

    ========================= ActionScript ================================
    var compra = new XML();
    compra.contentType = "application/xml\n\n";

    var texto = "";
    newCompra = compra.createElement("compra");
    compra.appendChild(newCompra);
    newCliente = compra.createElement("cliente");
    compra.firstChild.appendChild(newCliente);

    clienteNombre = compra.createElement("nombre");
    texto = compra.createTextNode("Bob");
    clienteNombre.appendChild(texto);

    clienteApellido = compra.createElement("apellido");
    texto = compra.createTextNode("Bowen");
    clienteApellido.appendChild(texto);

    compra.firstChild.childNodes[0].appendChild(clienteNombre);
    compra.firstChild.childNodes[0].appendChild(clienteApellido);

    compra.send("http://bowenr:90/cgi-bin/compraXMLPrueba.pl","_self");

    ====================== End ActionScript =================================

    My perl also couldn't be simpler. It simply grabs the XML from the HTTP headers and prints it to a file. It also prints to the screen the length of the content-length header, that which contains the XML tree. I use the following command (which I got from Moock's ActionScript book):

    read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});

    In IExplorer, the following is my output:
    screen - content length is >>>82<<<
    file -<compra><cliente><nombre>Bob</nombre><apellido>Bowen</apellido></cliente></compra>
    log - POST /cgi-bin/compraXMLPrueba.pl HTTP/1.1" 200 64

    In NS4:
    screen - content length is >>><<<
    file - a blank line is printed
    log - POST /cgi-bin/compraXMLPrueba.pl HTTP/1.0" 200 50

    In NS6:
    screen - no output, request fails. see "log" below
    file - blank line is printed
    log - Content-length: 82 400

    So the issue is that the Flash plug in for Netscape sends NO data in the HTTP headers, thus the XML tree never arrives. It's curious that NS4 uses HTTP/1.0. I thought that may be the problem. But it doesn't work in NS6 either, and NS6 uses HTTP/1.1. Another curiosity is that in NS6 I get a 400 error, the request fails. Not sure if this is a malformed header issue or something but the XML is perfect, just take a look at the "file" output for IExplorer above ...

    So I ask the questions --
    ARE the XML.send() and XML.sendAndLoad() methods supported in the Flash plug-in for Netscape?
    Can this be fixed? ... PLEASE?

    I personally would never even load Netscape if it weren't for the fact that my boss makes me do tests with it. But for the 5% of users left out there who haven't become totally frustrated with NS' glacier-like slowness and half-*ssed DHTML implementation, I implore you ...

    Thanks for any assistance,
    syg

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Couple of things to try:

    Does this work when you run the server on a standard port (other than 90).

    Have you checked you proxy preferences in Netscape?

    Also the XML data is posted to the server I can't remember how that is read in by Perl, but you might want to check.

    Thanks

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Posts
    2
    Hello there. Thanks for the reply.

    >Does this work when you run the server on a standard port
    >(other than 90).

    Nope. Same deal.

    >Have you checked you proxy preferences in Netscape?

    Direct connection to the internet. We have no proxy.

    >Also the XML data is posted to the server I can't remember
    >how that is read in by Perl, but you might want to check.

    I am using XML::Twig to read the XML tree. But the point is that even before involving Twig, the HTTP content-length header is empty. Twig therefore receives an empty string and does nothing.

    It really burns my butt that Macromedia has released such a shoddy product. I understand that it's probably much more Netscape's shortcoming than Flash but still, XML in Flash seems nowhere near ready for prime-time.

    Any other ideas? I've tried changing the contentType, application/xml, text/xml ... No go.

    Thanks again
    syg

  4. #4
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    I am very surprised that this is happening. The only thing I can think of is some bizaar Netscape/Web Server incompatibility but that seems odd to me.

    One thing, which version of the authoring environment are you using? Also can you check which version of the plugins you are using (by right clicking --> about).

    If I get some time I will have a look into the problem further.

    Thanks

    Luke

  5. #5
    I also had many problems with XML.send().
    My solution: I don't use XML.send() at all. I send the data this way:

    Code:
    myXML = new XML
    ... // things to build the xml
    formData = new LoadVars();
    	formData.xml = myXML;
    Now I send the LoadVars object to the server, and the XML File is inside the post variable xml.
    I think you have to strip the backslashes out of your XML Files, cause the " are escaped (\", but I never ran into any browser problems (And anyway, my provider doesn't seem to let me use the $HTTP_POST_DATA variable or what it is called, and so i don't get the raw post data from the request anyway)

    Hope this helps

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Posts
    309
    a couple of things.

    try dropping the newline characters enclosed within the content type string.

    try running the xml.send in a "_blank" window. what is the server response then?

    also, could be a sandbox issue - ie. flash security domain issue. is the swf within the same domain as http://bowenr:90/?

    finally, if you still have problems, try sendAndLoad and test for something coming back. no harm in having sendAndLoad even if there's nothing coming back.

    cya
    Henry


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center