Results 1 to 2 of 2

Thread: How to read attribute value in soap response

Threaded View

  1. #1
    Join Date
    Feb 2012
    Rep Power

    Default [SOLVED] How to read attribute value in soap response

    Dear All,
    I am making a zimlet that can detect whether the user using which locale.
    There is a field inside SOAP request GetInfoRequest, zimbraPrefLocale
    The request can be called, but I don't know how to read the value inside the tag.
    The response structure is:
    <attr name="{name}">{value}</a>
    <attr name="{name}">{value}</a>
    <pref name="{name}">{value}</pref>
    <pref name="{name}">{value}</pref>

    I want to get the value between <pref name="zimbraPrefLocale"> and </pref>

    And the code inside the js is:
    abc_HandlerObject.prototype.getAccountInfo =
    function(result) {
    	if (result.isException()) {
    		var exception = result.getException();		
    		var response = result.getResponse().GetInfoResponse;
    		var pre = response.prefs.pref;
    		for (var i=0;i<pre.length;i++){
    			if (pre[i].name=="zimbraPrefLocale"){
    And the result is "h is undefined"....
    I have followed the coding in

    the code from the web works in my server, but my code do not work...
    Last edited by hugo@dlshk; 04-12-2012 at 08:02 PM.

Similar Threads

  1. bayes db..
    By osiris in forum Administrators
    Replies: 9
    Last Post: 06-15-2011, 11:14 AM
  2. zmzimletctl deploy - ERROR -
    By todd_dsm in forum Administrators
    Replies: 0
    Last Post: 04-02-2009, 01:41 PM
  3. speed up the net
    By mcesari in forum Administrators
    Replies: 10
    Last Post: 04-25-2008, 11:24 AM
  4. [SOLVED] Can't receive messages from Gmail
    By agfeller in forum Administrators
    Replies: 4
    Last Post: 02-04-2008, 10:16 AM

Posting Permissions

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