Help - Search - Members - Calendar
Full Version: Trouble getting Blogger API to work
Movable Type Community Forum > Additional Resources > Tips and Tricks
MikeK
A little more info from the log file:
The Toolbar post generated a status 502.
w.bloggar was status 200.

So, now I have 2 questions, the one in the post above on how to get it to work with w.bloggar and does anyone have any pointers on why the 502 error would be generated? I think the toolbar sends all required headers, and it works fine with Radio and Blogger. -- Mike
MikeK
I ran the above script and it gave me a similar error message:
QUOTE
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Unexpected Content-Type '' returned


Status in the log file was 502.

Any idea what this means?
btrott
MikeK: are there any entries in your webserver error log?
MikeK
A little more information: I was looking through the SOAP module scripts and I came across a contstant called "DO_NOT_CHECK_CONTENT_TYPE" that defaults to 0, I changed it to 1 and now the test script above returns the XML-RPC fault construct as a script error on the rpc->call line. The error it contains is: Invalid blog ID '3'. 3 is the correct blogID, and my username/password are correct. Changing the method call to editPost and passing an existing postID gives the error: Invalid entry ID '5'. The log files entries are identical to what they were previously.

Removing the path to perl on the top line did not seem make any difference.

Does this ring any bells?
MikeK
Hey--
I'm trying to install MT so I can test out and write docs on how to use the Adminimizer Toolbar with MT via the Blogger API. MT in general seems to be working great, but the XML-RPC interface is behaving strangely. Here are the facts:

Win2k server
perl 5.6.0
mt-check says all is OK
perl -c mt-xmlrpc.cgi says all is OK

When I try to connect using w.bloggar I get a "type mismatch" error. When I try to post using the toolbar it returns this HTML (i've left the tags un-bracketed b/c I'm too lazy to write out the entities. Please use your imagination) :
head title Error in CGI Application /title /head
body h1 CGI Error /h1 The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: p p pre /pre

It is possible that the Toolbar error is due to a defect in the toolbar, so that HTML may be a red herring, but I know w.bloggar should work. I'd like to get it working with w.bloggar so I know my MT installation is working correctly. Does anyone have any tips?
Thanks!
Mike
btrott
You could try it out with this script:

CODE
#!/usr/bin/perl -w
use strict;

use XMLRPC::Lite;

my $rpc = XMLRPC::Lite->new;

## Might need to change this URL.
$rpc->proxy('http://localhost/mt/mt-xmlrpc.cgi');

use Data::Dumper;

## Might need to change username and password.
my $som =
   $rpc->call('blogger.newPost' => '', 1, 'Melody', 'Nelson', 'test', 0);

if ($som->fault) {
   print "[", $som->faultcode, "] ", $som->faultstring, "\n";
} else {
   print Dumper $som->result;
}
Tschepsit
I had to delete the #/usr/bin/perl line at the top of the file to get stuff to run on a WinXP machine.  Before that, I was getting errors similar to what you are describing.
MikeK
The Log file lists status 502 for the Adminimizer POST and a status 200 POST for the w.bloggar connect attempt.

The test script above shows a status 200 post to mt-xmlrpc.cgi and a GET 502 to test.cgi (the page that contains the script).

That's all that is in the log...
btrott
Yes, it indicates that mt-xmlrpc.cgi is not looking in the correct location for the 'db' directory. That's probably because it doesn't look for the full path to the config file like it should smile.gif. You can fix this by changing each line like this:

CODE
   my $mt = MT->new;


to

CODE
   my $mt = MT->new( Config => '/path/to/mt.cfg' );


where /path/to/mt.cfg is the full path to mt.cfg.
MikeK
That did the trick! To summarize, I needed change the path from
CODE
my $mt = MT->new;

to  
CODE
my $mt = MT->new( Config => '/path/to/mt.cfg' );

In these 3 files:

mt-xmlrpc.cgi
object.pm
mt.pm

And I needed to change DO_NOT_CHECK_CONTENT_TYPE to equal 1 in extlib\SOAP\Lite.pm

Thank you!
Now, where was I.... Oh yeah, the toolbar. I'll get to work on that now.

Mike
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.