Results 1 to 8 of 8

Thread: How to use javascript to call Zimbra SOAP

  1. #1
    thutrung is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    2

    Default How to use javascript to call Zimbra SOAP

    Hi,

    I'm trying to learn how to use javascript to call Zimbra SOAP request as well as parse the content of the SOAP response message.Could you give me a clue about how to accomplish that,of course it would be better if you post the code here.

    Any help would be appreciated,thanks.

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,499
    Rep Power
    56

    Default

    Have you read any of the documentation that's supplied with your ZCS server? site:zimbra.com +soap +consume - Yahoo! Search Results
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    thutrung is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    2

    Default

    Hi Bill,thanks for your help.It really helped me.

    Currently,I got a problem when trying to send a SOAP request via Java Script to Zimbra Server.I am using the jquery ajax to send SOAP request,and below is my code to check the error returned from the server:

    error: function(jqXHR, exception) {
    if (jqXHR.status === 0) {
    alert('Not connect.\n Verify Network.');
    }
    //something else...
    }
    Anytime I try to send a SOAP message to the server,i got a notification message "Not connect.Verify Network".
    I just wonder if is related to SSL problems or something else that constrains the use of web services from client-side javascript.(The Zimbra server is hosted on another machine than mine,and here is the URL I used: https://server-IP:7071/zimbraAdmin/service/soap,and obviously,I can use this URL to access the server on my browser)

    Please help me,thanks.
    Last edited by thutrung; 11-04-2012 at 09:37 AM.

  4. #4
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,499
    Rep Power
    56

    Default

    Unfortunately I can't help you with any coding, I'm not a developer - you'll have to wait for someone more experienced that can give you some advice.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  5. #5
    thutrung is offline New Member
    Join Date
    Aug 2012
    Posts
    5
    Rep Power
    2

    Default

    I have read the soap.txt document in /opt/zimbra/docs, it mentioned many functions on message and conversation,but the thing is I cannot find any instruction on how to attain messageId,conversationId..Could anyone show me how can I achieve that,thanks.

  6. #6
    Jignesh is offline Senior Member
    Join Date
    Oct 2011
    Location
    jignesh_22_1990@yahoo.com
    Posts
    68
    Rep Power
    3

    Default

    var jsonObj = {CreateFolderRequest:{_jsns:"urn:zimbraMail"}};
    var request = jsonObj.CreateFolderRequest;
    if(isBlank(color)){
    request.folder = { name:name,view:"appointment",url:""};
    }else if(custom){
    request.folder = { name:name,view:"appointment",url:"",rgb:color};
    }else{
    request.folder = { name:name,view:"appointment",url:"",color:color};
    }
    var searchParams = {
    jsonObj:jsonObj,
    asyncMode:false
    };
    appCtxt.getAppController().sendRequest(searchParam s);

    I don't know what you want exactly but this is the example of SOAP request. Let me know your exact requirement.

  7. #7
    roby.tea is offline Active Member
    Join Date
    Aug 2013
    Posts
    31
    Rep Power
    1

    Default

    Hello Jignesh

    yours is an example about calling Zimbra API "inside" Zimbra... for example with a Zimlet.

    What if I would like to invoke Zimbra SOAP services from outside, for example from my Intranet site...? I searched a lot over the net and read the docs, but I'm facing with a big error about CORS (Cross-origin resource sharing)...

    Are there any examples on how to call such Zimbra SOAP API from "outside" Zimbra server?

    Thanks
    Roberto

  8. #8
    Jignesh is offline Senior Member
    Join Date
    Oct 2011
    Location
    jignesh_22_1990@yahoo.com
    Posts
    68
    Rep Power
    3

    Default

    I am sure but you may need to write a java code to access Zimbra services from outside Zimbra. You can't achieve it from javascript only.
    OTOH, Are you sure you want to do it without any authentication? You may want to use Zimbra-Preauth or something...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [Javascript API] How to call webservices ?
    By ychaouche in forum Zimlets
    Replies: 1
    Last Post: 09-10-2012, 07:39 AM
  2. SOAP GetSignaturesRequest Call
    By martyn in forum Developers
    Replies: 1
    Last Post: 07-21-2011, 07:03 AM
  3. Zimlet call via SOAP
    By uxbod in forum Developers
    Replies: 4
    Last Post: 05-04-2010, 09:48 AM
  4. How to call a normal javascript in the zimlet?
    By anuradha_mihsra in forum Zimlets
    Replies: 1
    Last Post: 01-19-2009, 07:43 AM
  5. Replies: 13
    Last Post: 10-31-2005, 04:22 PM

Posting Permissions

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