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 04-20-2007, 12:53 AM
Intermediate Member
 
Posts: 20
Default responseText and responseXML

I made a zimlet searching GAL like below. I can get a response.
But there is one thing I don't know the reason for.
Return value is set to "obj.text", but isn't to "obj.xml".
Why?

Code:
XXXXXXXXXXXXXXXX.prototype._searchGal =
function() {

    var url = "/service/soap";

    var reqHeader = {};

    var data = '<?xml version="1.0" encoding="utf-8"?>' +
               '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">' +
               '<soap:Header>' +
               '<context xmlns="urn:zimbra">' +
               '<nosession/>' +
               '<authToken>xxxxxxxxxxxxxxxx</authToken>' +
               '</context>' +
               '</soap:Header>' +
               '<soap:Body>' +
               '<SearchGalRequest xmlns="urn:zimbraAccount">' +
               '<name>xxxxxxxx</name>' +
               '</SearchGalRequest>' +
               '</soap:Body>' +
               '</soap:Envelope>';

    AjxRpc.invoke(data,
                  url,
                  reqHeader,
                  new AjxCallback(this, this._callbackSearch));

};

XXXXXXXXXXXXXXXX.prototype._callbackSearch =
function(obj, result) {
    alert("obj.text = " + obj.text);
    alert("obj.xml = " + obj.xml);
};
Reply With Quote
  #2 (permalink)  
Old 04-20-2007, 02:24 PM
Zimbra Employee
 
Posts: 269
Default

My guess would be b/c you're getting JSON back not XML?

What is the value of obj.text?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 04-22-2007, 06:02 PM
Intermediate Member
 
Posts: 20
Default

The value of obj.text is like this below

obj.text = <soap:Envelope xml:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><SearchGalResponse more="0" xmlns="urn:zimbraAccount"><cn id="uid=xxxxxxxx,ou=xxxxxx,dc=xxx,dc=xxx,dc=xxxxx" ><a n="workPhone">xx-xxxx-xxxx</a><a n="objectClass">organizationPerson</a><a n="objectClass">zimbraAccount</a>.........</cn></SearchGalResponse></soap:Body></soap:Envelope>

And how can I get the value of <a n="workPhone"> tag.
Please teach me.

Last edited by Yokomie; 04-22-2007 at 06:57 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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.