[phpxmlrpc] problem with proxy connection
Gaetano Giunta
giunta.gaetano at gmail.com
Fri Jul 6 13:51:38 BST 2007
Sorry, but the client side of the transaction is more interesting, if there
is a proxy problem involved.
Could you:
- use setDebug(2) on the client to see a complete dump of the http request
and response payloads
- post the results to the mailing list?
Bye
Gaetano
On 7/5/07, Manish Marathe <mmarathe at spikesource.com> wrote:
>
> Hello,
>
> I am having problem when I am trying to make client calls via proxy
> although without proxy it works fine but with proxy it gives me:
>
> xmlrpclib.Fault: <Fault 105: 'XML error: Invalid document end at line 1,
> column 1'>
>
> Any help would be greatly appreciated.
>
> Here is my server code:
>
> -------------------------------------------------------------------------=
-----------------------------------
>
> <?php
> require_once dirname(__FILE__) . '/../lib/xmlrpc/xmlrpc.inc';
> require_once dirname(__FILE__) . '/../lib/xmlrpc/xmlrpcs.inc';
> require_once dirname(__FILE__) . '/../site-setup.php';
>
> function getReleaseNotes ($message) {
> global $REPOSITORY_BASE;
> $rollup_release_note_file =3D $content =3D $comp_release_note_file =
=3D "";
>
> $info =3D $files =3D array();
>
> $pNameObj =3D $message->getParam(0);
> $pName =3D $pNameObj->getVal();
>
> $pVersionObj =3D $message->getParam(1);
> $pVersion =3D $pVersionObj->getval();
>
> $pPlatformObj =3D $message->getParam(2);
> $pPlatform =3D $pPlatformObj->getval();
>
> $localeObj =3D $message->getParam(3);
> $locale =3D $localeObj->getval();
>
> $dir =3D $REPOSITORY_BASE . $pName . "/" . $pVersion . "/" . $pPlatfo=
rm;
>
> if(is_dir($dir . "/locale/" . $locale)) {
> $files =3D scan_dir($dir);
>
> foreach ($files as $file) {
> if(substr($file, -5) =3D=3D=3D '.yaml') {
> $info =3D syck_load(file_get_contents($dir . "/" . $file)=
);
> if($info['rollup']['rollup_type'] =3D=3D=3D 'rollup') {
>
> // Release note of the rollup
> $rollups[$info['rollup']['id']] =3D $info;
> if(strtotime($info['rollup']['timestamp']) >
> $recent_timestamp) {
> $recent_timestamp =3D
> strtotime($info['rollup']['timestamp']);
> $rollup_id =3D intval($info['rollup']['id']);
> } else {
> continue;
> }
> } else {
> continue;
> }
> }
> $info =3D array();
> }
>
> $rollup_release_note_file =3D
> $rollups[$rollup_id]['rollup']['description'];
> $content .=3D file_get_contents($dir . "/locale/" . $locale . "/"
> . $rollup_release_note_file) . "\n\n";
>
> // End release notes of rollup
> // Release notes of dependent components in the rollup yaml
> if(!empty($rollups[$rollup_id]['components'])) {
> foreach($rollups[$rollup_id]['components'] as $component) {
> $comp_release_note_file =3D $component['description'];
> $content .=3D file_get_contents($dir . "/locale/" .
> $locale . "/" . $comp_release_note_file) . "\n\n";
>
> $comp_release_note_file =3D "";
> }
> }
>
> return new xmlrpcresp(new xmlrpcval($content, 'base64'));
> } else {
> $msg =3D "Error! Check Product Name: \"" . $pName . "\", Version:
> \"" . $pVersion
> . "\", Platform: \"" . $pPlatform . "\", and Locale: \"" .
> $locale . "\"\n";
> return new xmlrpcresp(new xmlrpcval($msg, 'string'));
> }
> }
>
> function scan_dir($dir) {
> $files =3D array();
>
> if ($dh =3D opendir($dir)) {
> while (($file =3D readdir($dh)) !=3D=3D false) {
> if($file !=3D '.' && $file !=3D '..') {
> $files[] =3D $file;
> }
> }
> closedir($dh);
> }
> return $files;
> }
>
> // Declare our signature and provide some documentation.
> // (The PHP server supports remote introspection. Nifty!)
> $activate_sig =3D array(array('struct', 'string', 'string', 'string'),
> array('string', 'string', 'string', 'string'));
> $activate_doc =3D 'Activates a product';
> $checkForUpdates_sig =3D array(array('base64', 'string', 'string',
> 'string'),
> array('string', 'string', 'string',
> 'string'));
> $checkForUpdates_doc =3D 'Checks for Updates';
>
> $getReleaseNotes_sig =3D array(array('base64', 'string', 'string',
> 'string', 'string'),
> array('string', 'string', 'string',
> 'string', 'string'));
> $getReleaseNotes_doc =3D 'Get Release Note Contents';
>
>
> $s =3D new xmlrpc_server(array('activate' =3D>
> array('function' =3D> 'activate',
> 'signature' =3D> $activate_sig,
> 'docstring' =3D> $activate_doc),
> 'checkForUpdates' =3D>
> array('function' =3D> 'checkForUpdates',
> 'signature' =3D> $checkForUpdates_sig,
> 'docstring' =3D> $checkForUpdates_doc),
> 'getReleaseNotes' =3D>
> array('function' =3D> 'getReleaseNotes',
> 'signature' =3D> $getReleaseNotes_sig,
> 'docstring' =3D> $getReleaseNotes_doc)
> )
> );
> $s->setDebug(3);
> ?>
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc at lists.usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20070706/46=
bc2362/attachment.htm
More information about the phpxmlrpc
mailing list