Re: Post command

2004-05-01 Thread Pierre Sahores
Hi Alain,
Le 1 mai 04, à 02:41, Alain Farmer a écrit :
Hello,
I need help, folks.
I have been creating a MetaCard stack that submits to
a server-side PHP program. The payload of the post cmd
is of type text/xml and, specifically, it is the XML
that an XML-RPC program expects.
The above submit works fine, and the server-side
program returns what it is supposed to, b-u-t ... and
here's the problem ... when the content is lengthy, my
client-side stack does NOT wait long enough for the
whole reply, and breaks-off the HTTP connection too
soon.
What do I need to do to make my MC client WAIT for the
server-side program to complete the transmission of
its reply? Should I be using the urlStatus function?
I use this kind of POST method handler without problem all the time 
to access server-sided Rev or MC apps trough Apache and a PHP sockets 
listener/port translator. The first below line is important :

set httpheaders to Content-type: application/x-www-form-urlencoded 
 return
Try to see if you can pick somthing usable from the example code 
below...

on adddatas
  if (fld citation of card 1 of stack ccitalis is not * \
  and fld citation of card 1 of stack ccitalis is not  \
  and fld citation of card 1 of stack ccitalis is not Saisir 
ici la nouvelle citation... \
  and fld citation of card 1 of stack ccitalis is not Saisir 
ici les extraits de citation (mots-clés et/ou expressions littérales 
- utiliser  quote  +  quote  comme item de concaténation) 
entrant dans la sélection de recherche...) \
  and (fld auteur__ of card 1 of stack ccitalis is not * \
  and fld auteur__ of card 1 of stack ccitalis is not  \
  and fld auteur__ is not Saisir ici le nom de l'auteur... \
  and fld auteur__ of card 1 of stack ccitalis is not Saisir 
ici les noms d'auteurs (utiliser  quote  +  quote  comme 
item de concaténation) entrant dans la sélection de recherche...) \
  and (fld concept_ of card 1 of stack ccitalis is not * \
  and fld concept_ of card 1 of stack ccitalis is not  \
  and fld concept_ of card 1 of stack ccitalis is not Saisir 
ici le concept de référence... \
  and fld concept_ of card 1 of stack ccitalis is not Saisir 
ici le concept entrant dans la sélection de recherche...) then
put ci001=FE8END= into retour
set httpheaders to Content-type: 
application/x-www-form-urlencoded  return
post retour to url (fld csrecents of cd 2 of stack ccitalis)
if it is  then
  answer La connexion avec le serveur distant est rompue.  
return  return  \
  Vérifiez votre configuration d'accès à l'internet
  exit adddatas
end if
if lineoffset(word 1 to -1 of fld slogin of cd 2 of stack 
ccitalis  ¶  word 1 to -1 of fld smdp of cd 2 of stack 
ccitalis  ¶,macoscharset(it)) is not 0 then
  put |TI1=  fld citation  \
  |TI2=  fld auteur__  \
  |TI3=  fld titre___  \
  |TI4=  fld date  \
  |TI5=  fld concept_  \
  |TI6=  fld comment_  \
  |IDC=  encef(word 1 to -1 of fld slogin of cd 2 of 
stack ccitalis)  \
  |VAL=  encef(word 1 to -1 of fld smdp of cd 2 of stack 
ccitalis) into larequete
  put isocharset(larequete) into larequete
  replace  with ¶ in larequete
  replace | with  in larequete
  put ci001=FN1  urlencode(larequete)  END= into retour
  set httpheaders to Content-type: 
application/x-www-form-urlencoded  return
  post retour to url (fld csrecents of cd 2 of stack ccitalis)
  if it is  then
answer La connexion avec le serveur distant est rompue.  
return  return  \
Vérifiez votre configuration d'accès à l'internet  
return  avant de poursuivre.  return  return  \
(succès des tests de 0% en 0 secondes)
exit adddatas
  else answer it
else answer Vous devez vous authentifier comme utilisateur  
return  habilité à la saisie avant de pouvoir proposer de nouvelles 
citations !
  else answer Saisissez, au minimum, une citation un auteur et un 
concept, SVP !
end adddatas
If the server side of your app is a MC/Rev Stack or Script, it's 
important to add the below line of code to the on preopenstack or on 
startup handlers :

 set the socketTimeoutInterval to 10
Such kind of requests runs without troubble. In about testing the 
limits of the method (MC/Rev client app, Apache + PHP + MC app server + 
PostgreSQL back-end), it's able to let the client receive up to 16 Mo 
of datas peer query trough a 10 Mbits LAN...

Hope this will help,
Kind Regards, Pierre

Btw, this XMLRPC stack will be shared with the
community and will, therefore, help a *LOT* of people;
notably the Rev and Pan wikis, not to mention a school
commission, a  network of consultants, the lab I work
for, etc.
So please help me if you can,
Alain F


__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

Re: POST Command (It worked!!!)

2003-02-03 Thread Gregory Lypny
Thanks Dave Cragg and Tariel Gogoberidze,

Setting the socketTimeOutInterval to 3 allowed me to download all 
of the records from my FM database in one shot.  Why it is required for 
this particular database and not other, bigger ones I'm running, I 
don't know.  But it works, by golly!

	Thanks again,

		Greg



On Saturday, February 1, 2003, at 01:07  AM, 
[EMAIL PROTECTED] wrote:

Message: 2
Date: Fri, 31 Jan 2003 17:11:51 +
To: [EMAIL PROTECTED]
From: Dave Cragg [EMAIL PROTECTED]
Subject: Re: POST Command
Reply-To: [EMAIL PROTECTED]

At 11:42 am -0500 31/1/03, Gregory Lypny wrote:

Hi Dave,

	Thanks for responding.  Yes, I have checked the result
function after the post, and it is always empty.  If I omit the CDML
tag -Max=All from my post, I immediately get the default 25 records
returned.  And curiously, when I transfer the database to my local
Mac and post to localhost, as I mentioned, all records are, in fact,
returned.


To check if it's just a timeout, try increasing the
socketTimeoutInterval. The default is 1 (milliseconds). Try
setting it to 3.


___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard



Re: POST Command

2003-01-31 Thread Gregory Lypny
Hi Dave,

	Thanks for responding.  Yes, I have checked the result function after 
the post, and it is always empty.  If I omit the CDML tag -Max=All from 
my post, I immediately get the default 25 records returned.  And 
curiously, when I transfer the database to my local Mac and post to 
localhost, as I mentioned, all records are, in fact, returned.

	Regards,

		Greg

	


On Friday, January 31, 2003, at 09:11  AM, 
[EMAIL PROTECTED] wrote:

Message: 12
Date: Fri, 31 Jan 2003 14:05:29 +
To: [EMAIL PROTECTED]
From: Dave Cragg [EMAIL PROTECTED]
Subject: Re: POST Command
Reply-To: [EMAIL PROTECTED]

At 8:28 am -0500 31/1/03, Gregory Lypny wrote:

Hello Everyone,

	I'm using the POST command to download records from an online
FileMaker database.  The problem I'm having is that no data is
returned in the variable *it* when I specify *all* (for finding all
records) in my url expression.  This doesn't happen with all my FM
databases, and I'm usually able to download all records, often in
the hundreds, without a glitch.  For the problem databases, I can
specify a specific number, say, ten, and it works; after that, 20
will work, then 30.  But won't return any data when I specify more
than 40 (and there are, in fact, about 150 records).  I'm guessing
that FileMaker delays returning any data if it has to do some
indexing first, MC then pulls down nothing, and the handler runs
through much more quickly then when there is data returned.

	Is there a command or setting I can use that will cause MC to
wait longer for FileMaker to respond?  I've tried to use
libUrlSetLogField to get more information but I'm not sure what I
should be looking for.


Did you check the result function after the post command? This should
give you a hint if the problem is on the server end.

e.g

post whatever to url whatever
if the result is not empty then answer the result

If the result is empty, then it looks like the problem is at the 
client end.

Before speculating on possible causes, can you confirm that the
result is in fact empty?

Cheers
Dave

___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard



Re: POST Command

2003-01-31 Thread Dave Cragg
At 11:42 am -0500 31/1/03, Gregory Lypny wrote:

Hi Dave,

	Thanks for responding.  Yes, I have checked the result
function after the post, and it is always empty.  If I omit the CDML
tag -Max=All from my post, I immediately get the default 25 records
returned.  And curiously, when I transfer the database to my local
Mac and post to localhost, as I mentioned, all records are, in fact,
returned.


To check if it's just a timeout, try increasing the 
socketTimeoutInterval. The default is 1 (milliseconds). Try 
setting it to 3.

What is logged when you use libUrlSetLogField? It should show the 
http headers returned by the server. I've only used Filemaker's xml 
features (different from CDML I think), but I guess the format should 
be similar. Here, the headers look something like this:

HTTP/1.1 200 OK
Date: Fri, 31 Jan 2003 16:19:28 GMT
Server: FileMakerPro/5.5v2 WebCompanion/5.5v3
MIME-Version: 1.0
Transfer-Encoding: chunked
Content-Type: text/xml; charset=utf-8
Expires: Tue, 12 Nov 1963 00:36:00 GMT

Anything significantly different in your case? In particular, is 
there a Content-Length or Transfer-Encoding field?

Cheers
Dave
___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard