Re: [PHP] XML-RPC problem with long running times

2005-12-30 Thread Richard Lynch
If you can't get at the PHP internal time-out...

First, file a bug report Feature Request and ask for it to be
exposed.  You won't be the only one who needs it.

Second, for the short term, you may be stuck with rolling your own
XMLRPC interface, or using one of the others out there as raw PHP
that will perhaps give you more control of stream time limits.

You MIGHT be able to dig through PHP source and alter the time-out and
re-compile...  But remembering to do that on an upgrade would be a
PITA.

On Thu, December 29, 2005 8:58 am, Andreas Schlicker wrote:
 Of course, fflusch($log); should be fflush($log);

 I just found out that $xmlResponse really is empty.
 However, connection_status() returns 0, so I assume that the script is
 not interrupted by a timeout.

 Why does xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL)
 return
 nothing if the call takes longer than 5 minutes and there is no
 interrupt? Is there some special XMLRPC timeout?

 Any idea?

 Andreas


 Andreas Schlicker schrieb:
 Hi all,

 I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22,
 OpenSSL/0.9.6a.

 I wrote a dummy script that is called by a Java program via XML-RPC,
 waits for some time and replies the start and end times.

 ?php
 set_time_limit(500);
 $xmlServer = xmlrpc_server_create();

 function process() {
 $result = ini_get('max_execution_time') . \n;
 $result = $result . date(H:i:s) . \n;
 sleep(0);
 $result = $result . date(H:i:s) . \n;
 return $result;
 }

 xmlrpc_server_register_method($xmlServer, 'process', 'process');
 $xmlRequest = $HTTP_RAW_POST_DATA;
 $xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest,
 NULL);

 #$log = fopen($filename, 'a');
 #fwrite($log, $xmlResponse);
 #fflusch($log);
 #fclose($log);

 echo $xmlResponse;
 xmlrpc_server_destroy($xmlServer);
 ?

 If the script sleeps for up to 5 minutes, it works perfectly fine.
 However, I my real application will run probably an hour or so. If
 the
 script takes more than 5 minutes to execute, the client receives an
 empty response, even the header is missing. If I try to write the
 $xmlResponse to a file, the client receives a null message.

 I wrote a small script without XMLRPC that acted the same way when
 called by a browser. This worked perfectly (I tested it up to 20
 minutes
 waiting time) even if I used set_time_limit(5) and sleep(500).

 Does anybody have an idea how to solve this problem? Thanks in
 advance.

 Andreas


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] XML-RPC problem with long running times

2005-12-29 Thread Andreas Schlicker

Hi all,

I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22, OpenSSL/0.9.6a.

I wrote a dummy script that is called by a Java program via XML-RPC, 
waits for some time and replies the start and end times.


?php
set_time_limit(500);
$xmlServer = xmlrpc_server_create();

function process() {
$result = ini_get('max_execution_time') . \n;
$result = $result . date(H:i:s) . \n;
sleep(0);
$result = $result . date(H:i:s) . \n;
return $result;
}

xmlrpc_server_register_method($xmlServer, 'process', 'process');
$xmlRequest = $HTTP_RAW_POST_DATA;
$xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL);

#$log = fopen($filename, 'a');
#fwrite($log, $xmlResponse);
#fflusch($log);
#fclose($log);

echo $xmlResponse;
xmlrpc_server_destroy($xmlServer);
?

If the script sleeps for up to 5 minutes, it works perfectly fine. 
However, I my real application will run probably an hour or so. If the 
script takes more than 5 minutes to execute, the client receives an 
empty response, even the header is missing. If I try to write the 
$xmlResponse to a file, the client receives a null message.


I wrote a small script without XMLRPC that acted the same way when 
called by a browser. This worked perfectly (I tested it up to 20 minutes 
waiting time) even if I used set_time_limit(5) and sleep(500).


Does anybody have an idea how to solve this problem? Thanks in advance.

Andreas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML-RPC problem with long running times

2005-12-29 Thread Andreas Schlicker

Of course, fflusch($log); should be fflush($log);

I just found out that $xmlResponse really is empty.
However, connection_status() returns 0, so I assume that the script is 
not interrupted by a timeout.


Why does xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL) return 
nothing if the call takes longer than 5 minutes and there is no 
interrupt? Is there some special XMLRPC timeout?


Any idea?

Andreas


Andreas Schlicker schrieb:

Hi all,

I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22, OpenSSL/0.9.6a.

I wrote a dummy script that is called by a Java program via XML-RPC, 
waits for some time and replies the start and end times.


?php
set_time_limit(500);
$xmlServer = xmlrpc_server_create();

function process() {
$result = ini_get('max_execution_time') . \n;
$result = $result . date(H:i:s) . \n;
sleep(0);
$result = $result . date(H:i:s) . \n;
return $result;
}

xmlrpc_server_register_method($xmlServer, 'process', 'process');
$xmlRequest = $HTTP_RAW_POST_DATA;
$xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL);

#$log = fopen($filename, 'a');
#fwrite($log, $xmlResponse);
#fflusch($log);
#fclose($log);

echo $xmlResponse;
xmlrpc_server_destroy($xmlServer);
?

If the script sleeps for up to 5 minutes, it works perfectly fine. 
However, I my real application will run probably an hour or so. If the 
script takes more than 5 minutes to execute, the client receives an 
empty response, even the header is missing. If I try to write the 
$xmlResponse to a file, the client receives a null message.


I wrote a small script without XMLRPC that acted the same way when 
called by a browser. This worked perfectly (I tested it up to 20 minutes 
waiting time) even if I used set_time_limit(5) and sleep(500).


Does anybody have an idea how to solve this problem? Thanks in advance.

Andreas



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] XML-RPC problem with array

2005-02-01 Thread Bambero
Hello
I have compiled my php with --with-xmlrpc option to use xmlrpc server.
Everything works fine, but there is one problem.
Array (indexed from 0):
$array[0]
$array[1]
$array[2]
is changed to xmlrpc 'array' type - thats ok.
Array (with string indexes):
$array['ad']
$array['sd']
$array['rd']
is changed to xmlrpc 'struct' type - thats ok too.
But array (indexed from 1):
$array[1]
$array[2]
$array[3]
is changed to xmlrpc 'array' type.
Is it possible to change this type to xmlrpc 'struct' type ?
Sorry, my english is not well.
Thanks,
Bambero
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] XML-RPC problem with array

2005-02-01 Thread Richard Lynch




Bambero wrote:
 Hello

 I have compiled my php with --with-xmlrpc option to use xmlrpc server.
 Everything works fine, but there is one problem.

 Array (indexed from 0):
 $array[0]
 $array[1]
 $array[2]
 is changed to xmlrpc 'array' type - thats ok.

 Array (with string indexes):
 $array['ad']
 $array['sd']
 $array['rd']
 is changed to xmlrpc 'struct' type - thats ok too.

 But array (indexed from 1):
 $array[1]
 $array[2]
 $array[3]
 is changed to xmlrpc 'array' type.

 Is it possible to change this type to xmlrpc 'struct' type ?

I'll bet that if you did:
$array['1'] = 'whatever';

it would turn into a struct.

The crucial difference being that your KEYS are strings in the ones that
get turned into struct.

I bet that you only need to set *ONE* array element key to a string if you
can't change all of them:

?php
  //Force string key so XML uses struct, not array:
  $array['1'] = $array[1];
  unset($array[1]);
?

No promise on what ORDER the key/values will come out if you do that -- If
you care about order, you're gonna have to re-do the whole array, almost
for sure.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] XML-RPC problem

2003-06-10 Thread Evandro Sestrem

Hi,

I'm using the XML-RPC implementation from Useful
(http://phpxmlrpc.sourceforge.net) to do my client in PHP. When this client
receives a response from my server and this response is a array of struct
with more than 1 item, occurs a problem. When the response array of struct
has just 1 item it works fine.

Look what my server is sending like response (array of  struct with 2
items), this response raises a error in my client. The struct has 3 members
(codigo, cidade, estado):

?xml version=1.0 encoding=ISO-8859-1?
methodResponse
  params
param
  value
struct
  member
namecidades/name
value
  array
data
  value
struct
  member
namecodigo/name
valueint2/int/value
  /member
  member
namecidade/name
valuestringBlumenau/string/value
  /member
  member
nameestado/name
valuestringSC/string/value
  /member
/struct
  /value
  value
struct
 member
namecodigo/name
valueint3/int/value
  /member
  member
namecidade/name
valuestringTimbó/string/value
  /member
  member
nameestado/name
valuestringSC/string/value
  /member
/struct
  /value
/data
  /array
/value
  /member
/struct
  /value
/param
  /params
/methodResponse


This response works fine (just 1 item in the array):

?xml version=1.0 encoding=ISO-8859-1?
params
  param
value
  struct
member
  namecidades/name
  value
array
  data
value
  struct
member
  namecodigo/name
  valueint2/int/value
/member
member
  namecidade/name
  valuestringBlumenau/string/value
/member
member
  nameestado/name
  valuestringSC/string/value
/member
  /struct
/value
  /data
/array
  /value
/member
  /struct
/value
  /param
/params


Thanks for any help.


Evandro Sestrem
evandro at blueone dot com dot br



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php