xml per http
Posted: Wed Jun 04, 2008 3:45 pm
Hello @all,
i have to send an xml-string to a server.
we have an ibm system i with i5/os and php5 running.
the i5 is connected to the web by a 16Mbit dsl connection.
the following i tried at all
the response from the server comes after 14 seconds (by 1 position in xml file)
if i send a file with 5 positions the response comes after 30 seconds.
this part
lasts 10 seconds.
i tried also curl, but it was also slow.
if i test the script on a webserver (in the web by a provider 1und1)then the response comes after 3-5 seconds !!!!!!!!!!!!!!1
Are there any settings i can make, to make the connection faster ?
are there alternatives to fsockopen and curl to send my xml file ?
please help me
by jo
i have to send an xml-string to a server.
we have an ibm system i with i5/os and php5 running.
the i5 is connected to the web by a 16Mbit dsl connection.
the following i tried at all
Code: Select all
$fp1 = fopen("./anfrage.xml","r");
$kennung = base64_encode("user:pass");
while(!feof($fp1))
{
$file1 = fgets($fp1, 100);
$file = $file.$file1;
}
$data = "";
$fp = fsockopen("ssl://server.com",443,$errstr,$errno);
if(!$fp)
{
die();
}
else
{
$file = addslashes($file);
$data = $file;
fputs($fp, "POST /webservice/XMLServlet HTTP/1.0\r\n");
fputs($fp, "Host: server.com\r\n");
fputs($fp, "Authorization: Basic ".$kennung." \r\n");
fputs($fp, "Content-length: ". strlen($data) ."\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
}
while(!feof($fp))
{
$fget = fgets($fp, 128);
$data .= $fget;
}
fclose($fp);
$xml_arr = explode("\r\n\r\n",$data);
echo $xml_arr[1];
if i send a file with 5 positions the response comes after 30 seconds.
this part
Code: Select all
while(!feof($fp))
{
$fget = fgets($fp, 128);
$data .= $fget;
}
i tried also curl, but it was also slow.
if i test the script on a webserver (in the web by a provider 1und1)then the response comes after 3-5 seconds !!!!!!!!!!!!!!1
Are there any settings i can make, to make the connection faster ?
are there alternatives to fsockopen and curl to send my xml file ?
please help me
by jo