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

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 10-18-2010, 12:37 AM
Member
 
Posts: 14
Default How can i get return value from AjxRpc.invoke function?

Hi, every body,

I am using SOAP to check the external URL if valid, my code is:
Quote:
myMailZimlet.prototype.CheckURL =
function() {
var TxtUrl = "http://www.domain.com/server.txt";
var EncUrl = AjxStringUtil.urlComponentEncode(TxtUrl);
var pxyUrl = [ZmZimletBase.PROXY, encodedExtServerUrl].join("");
var CallBack = new AjxCallback(this, this._httpExternalGetCallback);
var myResult = AjxRpc.invoke(null, proxyServletUrl, null, CallBack, false);
if (myResult.success) {
return true;
} else {
return false;
}
}

myMailZimlet.prototype._httpExternalGetCallback =
function(response) {
if (response.success == false) {
return;
}
appCtxt.getAppController().setStatusMsg(response.t ext, ZmStatusView.LEVEL_INFO);
};

The function _httpExternalGetCallback is working, but the myResult.success in function CheckURL always return: undefine.

Could any one tell me how to get the return value in SOAP? Thanks.
Reply With Quote
  #2 (permalink)  
Old 10-18-2010, 09:29 PM
Zimlet Guru & Moderator
 
Posts: 467
Default

Firebug is your friend here. Set a breakpoint inside of your routine (you may have to run Zimbra in &debug=1 mode) and examine the data structure. As a note, you want to look at response.sucess, not myResponse.sucess since the response function will be called asynchronously.
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.