Menu

help for newbie!

Help
Anonymous
2003-04-08
2003-04-08
  • Anonymous

    Anonymous - 2003-04-08

    Hi all,

    I have problems calling 2.0 getUserInfo.  Here's the specs:

      API 2.0:
         blogger2.getUserInfo([["appkey" => "BIGHONKINGAPPKEY"]
                          ["username" => "stevej"]
                                  ["password" => "myfakepassword"]])

    The following code always fails:

      XmlRpcValue login, user;
      login[0]["username"] = "uuu";
      login[0]["password"] = "ppp";
      login[0]["appkey"] = "aaa";
      if (c.execute("GetUserInfo", login, user))
        std::cout << "NoSuchMethod call: fault: " << c.isFault() << ", result = " << user << std::endl;
      else
        std::cout << "Error calling 'GetUserInfo'\n";

    Any ideas?

    Thanks,
    J

     
    • Chris Morley

      Chris Morley - 2003-04-08

      I can't help without more info. What fails?
      What message do you get?

      It may be useful to dump more messages from XmlRpc++ using XmlRpc::setVerbosity(5);

       
    • Anonymous

      Anonymous - 2003-04-08

      I tried using a different method, but I think it's a socket connection problem.  I asked the server developer, and he said the server is up.

      XmlRpcClient new client: host http://someServer, port 9000.
      XmlRpcClient::execute: method getBlogs (_connectionState 0).
      XmlRpcClient::doConnect: fd 100.
      XmlRpcClient::close: fd 100.
      XmlRpcSource::close: closing socket 100.
      XmlRpcSocket::close: fd 100.
      XmlRpcSource::close: done closing socket 100.
      Error in XmlRpcClient::doConnect: Could not connect to server (error 11004).
      Error calling 'getBlogs'
      Press any key to continue

      The following is my code (modified from HelloClient.cpp):
      #include "XmlRpc.h"
      #include <iostream>
      using namespace XmlRpc;

      int main(int argc, char* argv[])
      {
        if (argc != 3) {
          std::cerr << "Usage: HelloClient serverHost serverPort\n";
          return -1;
        }
        int port = atoi(argv[2]);
        XmlRpc::setVerbosity(5);

        // Use introspection API to look up the supported methods
        XmlRpcClient c(argv[1], port);
        XmlRpcValue login, blogs;
        login[0]["username"] = "uuu";
        login[0]["password"] = "pppd";
        login[0]["appkey"] = "aaa";
        if (c.execute("getBlogs", login, blogs))
          std::cout << "NoSuchMethod call: fault: " << c.isFault() << ", result = " << blogs << std::endl;
        else
          std::cout << "Error calling 'getBlogs'\n";

        return 0;
      }

      The following is the method signatures:
      blogger2.getBlogs(Struct login) => Array of Struct blogs

      The following is the data structure:
      Struct 'login':
        username -> String
        password -> String
        appkey -> String
        clientID -> String
        token -> String (not implemented yet. will be addressed with the blogger2.secure.* module)

      Struct 'blog':
        blogID -> String
        url -> String
        blogName -> String

       
    • Anonymous

      Anonymous - 2003-04-08

      Let me add that the first time I ran after re-compile, I got error code 11001.  After that, it was 11004.

      What seems to be the problem here?

       
    • Chris Morley

      Chris Morley - 2003-04-08

      The errors are from gethostbyname, called from XmlRpcSocket::connect. It attempts to resolve a hostname to an IP address.

      11001  is WSAHOST_NOT_FOUND, 11004 is WSANO_DATA (assuming you are on win32 and using winsock2).

      Try taking the http:// stuff off your hostname, it is supposed to be a real hostname, not a url.

       
    • Anonymous

      Anonymous - 2003-04-08

      Thanks for the speedy reply!  Getting rid of "http://" does make it work! 

      Keep up the good work.  I am looking forward to new features in future releases.

       

Log in to post a comment.