Re: problem with proxy connection
"Gaetano Giunta" <[email protected]> Fri, 6 Jul 2007 14:51:38 +0200
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
--===============0275957238== Content-Type: multipart/alternative; boundary="----=_Part_3143_11028457.1183726298877" ------=_Part_3143_11028457.1183726298877 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 <[email protected]> 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 = $content = $comp_release_note_file = ""; > > $info = $files = array(); > > $pNameObj = $message->getParam(0); > $pName = $pNameObj->getVal(); > > $pVersionObj = $message->getParam(1); > $pVersion = $pVersionObj->getval(); > > $pPlatformObj = $message->getParam(2); > $pPlatform = $pPlatformObj->getval(); > > $localeObj = $message->getParam(3); > $locale = $localeObj->getval(); > > $dir = $REPOSITORY_BASE . $pName . "/" . $pVersion . "/" . $pPlatform; > > if(is_dir($dir . "/locale/" . $locale)) { > $files = scan_dir($dir); > > foreach ($files as $file) { > if(substr($file, -5) === '.yaml') { > $info = syck_load(file_get_contents($dir . "/" . $file)); > if($info['rollup']['rollup_type'] === 'rollup') { > > // Release note of the rollup > $rollups[$info['rollup']['id']] = $info; > if(strtotime($info['rollup']['timestamp']) > > $recent_timestamp) { > $recent_timestamp = > strtotime($info['rollup']['timestamp']); > $rollup_id = intval($info['rollup']['id']); > } else { > continue; > } > } else { > continue; > } > } > $info = array(); > } > > $rollup_release_note_file = > $rollups[$rollup_id]['rollup']['description']; > $content .= 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 = $component['description']; > $content .= file_get_contents($dir . "/locale/" . > $locale . "/" . $comp_release_note_file) . "\n\n"; > > $comp_release_note_file = ""; > } > } > > return new xmlrpcresp(new xmlrpcval($content, 'base64')); > } else { > $msg = "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 = array(); > > if ($dh = opendir($dir)) { > while (($file = readdir($dh)) !== false) { > if($file != '.' && $file != '..') { > $files[] = $file; > } > } > closedir($dh); > } > return $files; > } > > // Declare our signature and provide some documentation. > // (The PHP server supports remote introspection. Nifty!) > $activate_sig = array(array('struct', 'string', 'string', 'string'), > array('string', 'string', 'string', 'string')); > $activate_doc = 'Activates a product'; > $checkForUpdates_sig = array(array('base64', 'string', 'string', > 'string'), > array('string', 'string', 'string', > 'string')); > $checkForUpdates_doc = 'Checks for Updates'; > > $getReleaseNotes_sig = array(array('base64', 'string', 'string', > 'string', 'string'), > array('string', 'string', 'string', > 'string', 'string')); > $getReleaseNotes_doc = 'Get Release Note Contents'; > > > $s = new xmlrpc_server(array('activate' => > array('function' => 'activate', > 'signature' => $activate_sig, > 'docstring' => $activate_doc), > 'checkForUpdates' => > array('function' => 'checkForUpdates', > 'signature' => $checkForUpdates_sig, > 'docstring' => $checkForUpdates_doc), > 'getReleaseNotes' => > array('function' => 'getReleaseNotes', > 'signature' => $getReleaseNotes_sig, > 'docstring' => $getReleaseNotes_doc) > ) > ); > $s->setDebug(3); > ?> > _______________________________________________ > phpxmlrpc mailing list > [email protected] > http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc > ------=_Part_3143_11028457.1183726298877 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry, but the client side of the transaction is more interesting, if there is a proxy problem involved.<br>Could you:<br>- use setDebug(2) on the client to see a complete dump of the http request and response payloads<br> - post the results to the mailing list?<br><br>Bye<br>Gaetano<br><br><div><span class="gmail_quote">On 7/5/07, <b class="gmail_sendername">Manish Marathe</b> <<a href="mailto:[email protected]">[email protected] </a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I am having problem when I am trying to make client calls via proxy <br>although without proxy it works fine but with proxy it gives me:<br><br>xmlrpclib.Fault: <Fault 105: 'XML error: Invalid document end at line 1,<br>column 1'><br><br>Any help would be greatly appreciated. <br><br>Here is my server code:<br>------------------------------------------------------------------------------------------------------------<br><br><?php<br>require_once dirname(__FILE__) . '/../lib/xmlrpc/xmlrpc.inc'; <br>require_once dirname(__FILE__) . '/../lib/xmlrpc/xmlrpcs.inc';<br>require_once dirname(__FILE__) . '/../site-setup.php';<br><br>function getReleaseNotes ($message) {<br> global $REPOSITORY_BASE;<br> $rollup_release_note_file = $content = $comp_release_note_file = "";<br><br> $info = $files = array();<br><br> $pNameObj = $message->getParam(0);<br> $pName = $pNameObj->getVal();<br><br> $pVersionObj = $message->getParam(1); <br> $pVersion = $pVersionObj->getval();<br><br> $pPlatformObj = $message->getParam(2);<br> $pPlatform = $pPlatformObj->getval();<br><br> $localeObj = $message->getParam(3);<br> $locale = $localeObj->getval(); <br><br> $dir = $REPOSITORY_BASE . $pName . "/" . $pVersion . "/" . $pPlatform;<br><br> if(is_dir($dir . "/locale/" . $locale)) {<br> $files = scan_dir($dir);<br><br> foreach ($files as $file) { <br> if(substr($file, -5) === '.yaml') {<br> $info = syck_load(file_get_contents($dir . "/" . $file));<br> if($info['rollup']['rollup_type'] === 'rollup') { <br><br> // Release note of the rollup<br> $rollups[$info['rollup']['id']] = $info;<br> if(strtotime($info['rollup']['timestamp']) > <br>$recent_timestamp) {<br> $recent_timestamp =<br>strtotime($info['rollup']['timestamp']);<br> $rollup_id = intval($info['rollup']['id']);<br> } else {<br> continue;<br> }<br> } else {<br> continue;<br> }<br> }<br> & nbsp;$info = array(); <br> }<br><br> $rollup_release_note_file =<br>$rollups[$rollup_id]['rollup']['description'];<br> $content .= file_get_contents($dir . "/locale/" . $locale . "/"<br> . $rollup_release_note_file) . "\n\n";<br><br> // End release notes of rollup<br> // Release notes of dependent components in the rollup yaml<br> if(!empty($rollups[$rollup_id]['components'])) { <br> foreach($rollups[$rollup_id]['components'] as $component) {<br> $comp_release_note_file = $component['description'];<br> $content .= file_get_contents($dir . "/locale/" . <br>$locale . "/" . $comp_release_note_file) . "\n\n";<br><br> $comp_release_note_file = "";<br> }<br> }<br><br> return new xmlrpcresp(new xmlrpcval($content, 'base64')); <br> } else {<br> $msg = "Error! Check Product Name: \"" . $pName . "\", Version:<br>\"" . $pVersion<br> . "\", Platform: \"" . $pPlatform . "\", and Locale: \"" . <br>$locale . "\"\n";<br> return new xmlrpcresp(new xmlrpcval($msg, 'string'));<br> }<br>}<br><br>function scan_dir($dir) {<br> $files = array();<br><br> if ($dh = opendir($dir)) {<br> while (($file = readdir($dh)) !== false) {<br> if($file != '.' && $file != '..') {<br> $files[] = $file;<br> }<br> }<br> closedir($dh);<br> }<br> return $files;<br>}<br><br>// Declare our signature and provide some documentation.<br>// (The PHP server supports remote introspection. Nifty!)<br>$activate_sig = array(array('struct', 'string', 'string', 'string'), <br> array('string', 'string', 'string', 'string'));<br>$activate_doc = 'Activates a product';<br>$checkForUpdates_sig = array(array('base64', 'string', 'string', 'string'), <br> array('string', 'string', 'string', 'string'));<br>$checkForUpdates_doc = 'Checks for Updates';<br><br>$getReleaseNotes_sig = array(array('base64', 'string', 'string', <br>'string', 'string'),<br> array('string', 'string', 'string',<br>'string', 'string'));<br>$getReleaseNotes_doc = 'Get Release Note Contents'; <br><br><br>$s = new xmlrpc_server(array('activate' =><br> array('function' => 'activate',<br> 'signature' => $activate_sig, <br> 'docstring' => $activate_doc),<br> 'checkForUpdates' =><br> array('function' => 'checkForUpdates', <br> 'signature' => $checkForUpdates_sig,<br> 'docstring' => $checkForUpdates_doc),<br> 'getReleaseNotes' => <br> array('function' => 'getReleaseNotes',<br> 'signature' => $getReleaseNotes_sig,<br> 'docstring' => $getReleaseNotes_doc) <br> )<br> );<br>$s->setDebug(3);<br>?><br>_______________________________________________<br>phpxmlrpc mailing list<br><a href="mailto:[email protected]">[email protected] </a><br><a href="http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc">http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc</a><br></blockquote></div><br> ------=_Part_3143_11028457.1183726298877-- --===============0275957238== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ phpxmlrpc mailing list [email protected] http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc --===============0275957238==--