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 05-04-2010, 04:51 AM
Moderator
 
Posts: 7,928
Question Zimlet call via SOAP

If you have performed a pre-auth is it possible to then call a Zimlet they SOAP ? I have ran the ZWC in debug mode and clicked on the Zimlet I wish to perform a action but no request appears to be sent.
__________________
Reply With Quote
  #2 (permalink)  
Old 05-04-2010, 06:51 AM
Moderator
 
Posts: 7,928
Default

Capturing with tcpdump I see that a HTTP GET request is sent to /service/zimlet/<zimlet_name>/procedure.js?somedatatosend and if dump the account using zmmailbox it would appear to expose the objects via JSON
Code:
"zimlet": [{
                "description": "Zimlet Test",
                "name": "zimlet_name",
                "version": "0.1",
                "includeCSS": [{
                    "_content": "zimlet.css"
                  }],"zimlet": [{
                "description": "Zimlet Test",
                "name": "zimlet_name",
                "version": "0.1",
                "includeCSS": [{
                    "_content": "zimlet.css"
                  }],
                "include": [{
                    "_content": "procedure.js"
                  }],
                "handlerObject": [{
                    "_content": "zimlet_name"
                  }],
How would one construct the JSON request or is that even possible to a zimlet ?
__________________
Reply With Quote
  #3 (permalink)  
Old 05-04-2010, 07:54 AM
Moderator
 
Posts: 7,928
Default

By setting ZM_AUTH_TOKEN I am able to connect to the zimlet using the full /service URL though wondering whether that is the only way or if JSON can be used ?
__________________
Reply With Quote
  #4 (permalink)  
Old 05-04-2010, 09:01 AM
Zimbra Employee
 
Posts: 105
Default

So I understand your question: are you looking to call the /service/***/zimlet URL directly and are asking how auth is handled to be able to hit that URI?
Reply With Quote
  #5 (permalink)  
Old 05-04-2010, 09:48 AM
Moderator
 
Posts: 7,928
Default

Please excuse my ignorance for a start I have a working PHP script that uses JSON for querying a contact
Code:
$request = array(
                "Header" => array(
                        "context" => array(
                                "_jsns" => "urn:zimbra",
                                "authToken" => array(
                                        "_content" => $authToken,
                                ),
                        ),
                ),
                "Body" => array(
                        "SearchRequest" => array(
                                "_jsns" => "urn:zimbraMail",
                                "types" => array(
                                        "_content" => "contact",
                                ),
                                "query" => array(
                                        "_content" => "12345",
                                ),
                        ),
                ),
        );
And I was wondering whether JSON could be used to post, via the SOAP interface, to a backend Zimlet as-well. I have made it work by calling http://<zimbra_fqdn>/service/zimlet/<zimlet_name>/<zimlet_name>.js using CURL. For this to work I had to set the ZM_AUTH_TOKEN cookie which I can get quite happily using JSON. I think my issue is that Zimlets are not exposed for operating on like other methods eg. zimbraMail as I could not see anything apart from Get/Modify in soap.txt. Will PM my code if that is okay ?
__________________
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.