xml.send not working suddenly
by VmFuZXNzYQ » Fri, 26 Aug 2005 04:40:03 GMT
My script is on ASP with XML is working fine with no problem. But when I
reload the pages couple times (certainly with difference input), it stops
working, and my broswer just keep on showing "loading" at the status bar. I
found out my script is got stucked at this line: xml.send. But it started
working again after like 30mins or 40mins without changing anything at the
script. So I wonder what's happened? I can't figure it out! Please help me
on this. I don't think it is my script's problem cause it is working
properly, not until after reload couple times or so. Here is portion of my
script:
PostURL = xmllink & "xml/mac_sstatus_customer.asp"
Response.Buffer = True
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST", PostURL, False,"",""
xml.Send --> got hold off at here
getcustomXML = xml.responseText
Set xml = Nothing
RE: xml.send not working suddenly
by VmFuZXNzYQ » Wed, 31 Aug 2005 07:36:05 GMT
hi everyone, I still have the same problem today! Please help me on this.
I searched around the Internet and find out there's any way of calling XML
object, so I gave it a try by
changing from:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
to:
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
and it's works! But Microsoft.XMLHTTP is working properly before. So my
question is-- is that any connection limitation on Microsoft.XMLHTTP? Cause
it seems like after couple connection, it stops working and have to wait half
hour or so in order to work again. Please help!
Similar Threads:
1.XMLSocket.send does not work first time but works second time
I have an xmlsocket.send method attached to a FButton instance on my stage.
XMLSocket.send does not seem to work the first time it is invoked. When invoked
the second time, it works fine afterwards. Is this some sort of a bug or
something? Can someone show me a workaround?
2.XML suddenly stopped working
3.Sending parameters to XSL-files does not work...
4.xml.send() works but not sendAndLoad()
5.XMLSocket.send not working
i have a simple flash movie that i'm using to test my PHP socket server. the
XMLSocket.send command is getting no results.
my onData handler for my socket, defined in frame 1, seems to work. mySocket
is a global var defined and initialized successfully in frame 1.
when the connection is made in the first place, the PHP socket code sends a
welcome message which is easily handled by the message handler and displayed in
my flash movie.
i've also got a button that is supposed to send a message. i've included the
button code. this message never gets through. the PHP script doesn't echo any
response, and my flash movie never gets anything back...i realize it could be
the PHP code. i've posted a different forum for that but if anybody wants to
see it....code below...
behavior? the first response (roll up rollup!) works and is displayed by
flash. the subsequent message causes my socket serving php script to say
'entering' loop but then nothing ever happens. again, this works fine when you
use telnet to access the socket.
// on data handler
function handleIncoming (messageObj) {
// display the received xml data in the output window
strDebug+="data received:";
strDebug+=messageObj.toString()+newline;
strMesg = messageObj.toString();
}
// button code
btnBeginTest.onRelease = function() {
strDebug+=('button clicked sending a message'); // this runs
strDebug+=('mySocket: ' + mySocket.connected); // this returns TRUE
var myXML = new XML();
var myLogin = myXML.createElement("login");
myLogin.attributes.username = 'usernamefoo';
myLogin.attributes.password = 'nopass';
myXML.appendChild(myLogin);
mySocket.send(myXML); // does this work??
}
//PHP CODE...note that this works just fine when i TELNET to the open port.
<?
// don't timeout
set_time_limit (0);
// set some variables
$host = "myserver.com";
$port = 1234;
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create
socket\n" . socket_strerror(socket_last_error()));
// bind socket to port
$result = socket_bind($socket, $host, $port) or die("Could not bind to
socket\n");
// start listening for connections
$result = socket_listen($socket, 3) or die("Could not set up socket
listener\n");
echo "Waiting for connections...\n";
// accept incoming connections
// spawn another socket to handle communication
$spawn = socket_accept($socket) or die("Could not accept incoming
connection\n");
echo "Received connection request\n";
// write a welcome message to the client
$welcome = "Roll up, roll up, to the greatest show on earth!\n? \0";
socket_write($spawn, $welcome, strlen ($welcome)) or die("Could not send
connect string\n");
echo "entering loop";
// keep looping and looking for client input
do
{
// read client input
$input = socket_read($spawn, 1024, 1) or die("Could not read input\n");
echo "input is $input\n";
if (trim($input) != "")
{
echo "Received input: $input\n";
// if client requests session end
if (trim($input) == "END")
{
// close the child socket
// break out of loop
socket_close($spawn);
break;
}
// otherwise...
else
{
// reverse client input and send back
$output = strrev($input) . "\n\0";
socket_write($spawn, $output . "? ", strlen (($output)+2)) or die("Could
not write output\n");
echo "Sent output: " . trim($output) . "\n";
}
}
} while (true);
// close primary socket
socket_close($socket);
echo "Socket terminated\n";
?>
6. XMLSocket.onXML not working i send xml from java and terminate with '\0'
7. Send object is not sending transformed XML doc
8. xmlhttp.send() not sending the request body