Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-2010, 02:43 AM
Beginner Member
 
Posts: 1
Default Calling a API

Hello!
I'm starting with zimlets, and i have problems

i'm making a zimlet, this zimlet call a API, with this method,
Code:
http://randomurl.com/user_sistem?user=MYUSER&pass=MYPASS
This url return me a file XML with de ID of my account.

I'm using this example for de wiki, but i modify for direct acces, non proxy
Code:
com_zimbra_example_httpgetpost_HandlerObject.prototype._executeExternalHttpGet = 
function() {
    var url = "http://randomurl.com/user_sistem?";
    var param ="user=MYUSER&pass=MYPASS";
    var to= url+param;
    // submit the URL and asynchronous response (using callback)
    AjxRpc.invoke(null, to, null, new AjxCallback(this, this._httpExternalGetCallback), false);
   
};
     com_zimbra_example_httpgetpost_HandlerObject._executeExternalHttpGet
com_zimbra_example_httpgetpost_HandlerObject.prototype._httpExternalGetCallback =
function(response) {
    if (response.success == false) {
        // display the error response
        appCtxt.getAppController().setStatusMsg("Error: " + response.text, ZmStatusView.LEVEL_WARNING);
        return;
    }
    // display the response
    appCtxt.getAppController().setStatusMsg(response.text);        

};
When i call for this, firebug send my GETMINICALLREQUEST : Aborted X

This is de best method to do this? Another method?

Thx
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.