[phpxmlrpc] Re: XMLRPC - HTTP_RAW_POST_DATA is duplicated...

Miles Lott milos@groupwhere.org
23 Dec 2002 20:51:07 -0600


Seems to me that server.php is being called twice, thereby appending to
the file test.xml twice.  I have personally never used "w+" so I can't
really say.  Try "wb" and maybe also write a timestamp and even
REQUEST_URI to the file.

As for why it is being hit twice, maybe something to do with your
ServerName in httpd.conf?  Try instantiating the client using the fqdn.

On Mon, 2002-12-23 at 20:42, Scott Cropley wrote:
> Miles,
> This is what I used to prove the HTTP_RAW_POST_DATA was being duplicated.
> I'm really scratching my head on this one.
> 
> The client works fine with:
> 	$c=new xmlrpc_client("/demo/server.php", "xmlrpc.usefulinc.com", 80);
> 
> but with my version:
>   	$c=new xmlrpc_client("/XMLRPC/server.php", "slate", 80);
> 
> server.php:
> <?php
> 	$fp1 = fopen("test.xml","w+","1");
> 	fwrite($fp1,$_SERVER["HTTP_RAW_POST_DATA"]);
> 	fclose($fp1);
> 
>  include("xmlrpc.inc");
>  include("xmlrpcs.inc");
> ...
> 
> 
> text.xml:
> <?xml version="1.0"?>
> <methodCall>
> <methodName>examples.getStateName</methodName>
> <params>
> <param>
> <value><int>35</int></value>
> </param>
> </params>
> </methodCall>
> <?xml version="1.0"?>
> <methodCall>
> <methodName>examples.getStateName</methodName>
> <params>
> <param>
> <value><int>35</int></value>
> </param>
> </params>
> </methodCall>
> 
> 
> -----Original Message-----
> From: Miles Lott [mailto:milos@groupwhere.org]
> Sent: Monday, December 23, 2002 4:48 PM
> To: Scott Cropley
> Cc: XML-RPC for PHP Interest List
> Subject: Re: [phpxmlrpc] Re: XMLRPC - HTTP_RAW_POST_DATA is
> duplicated...
> 
> 
> If you place something like this at the top of parserequest() in
> xmlrpcs.inc you can prove or disprove this:
> 
>  $fp = fopen('/tmp/testing','ab+');
>  fwrite($fp,$data);
>  fclose($fp);
> 
> Place this after the var $data is set from $HTTP_RAW_POST_DATA.
> I tried and did not see it twice.
> 
> On Mon, 2002-12-23 at 05:50, Edd Dumbill wrote:
> > Please ask questions like this on the mailing list, to which I copy this
> > reply.
> >
> > On Fri, 2002-12-20 at 18:57, Scott Cropley wrote:
> > > Ed,
> > >
> > > I' playing with your php classes and have found the HTTP_RAW_POST_DATA
> dta
> > > is duplicated.
> > >
> > > My testing shows the payload only going out once,  but tat the server
> file
> > > it has the payload twice.  Then of courcr there are 2 root elements and
> I
> > > get Junk past end error.
> > >
> > > Any Ideas?????
> > >
> > >
> > > Scott Cropley
> > > Home: (360)892-7245
> > > Cell: (360)607-8984
> > > Fax:  (360)892-6816
> > > scott@andrew-scott.com
> >
> --
> 
> Miles Lott
> GroupWhere
> http://groupwhere.org
> 
> 
> 
> 
-- 

Miles Lott
GroupWhere
http://groupwhere.org