Results 1 to 3 of 3

Thread: responseText and responseXML

  1. #1
    Yokomie is offline Intermediate Member
    Join Date
    Feb 2007
    Posts
    20
    Rep Power
    8

    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);
    };

  2. #2
    pshah is offline Zimbra Employee
    Join Date
    Sep 2005
    Location
    Sunnyvale, CA
    Posts
    269
    Rep Power
    9

    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!

  3. #3
    Yokomie is offline Intermediate Member
    Join Date
    Feb 2007
    Posts
    20
    Rep Power
    8

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •