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 Display Modes
  #1 (permalink)  
Old 02-18-2009, 10:57 PM
Active Member
 
Posts: 30
Default Performing zimbraAdmin SOAP calls with a zimlet

Quick question: I'm working on a zimlet to let resource admins modify certain properties of their resource (name, desc, etc). Can I do urn:zimbraAdmin SOAP calls directly within JavaScript using AjxSoapDoc, etc., or do I need to do it externally with a JSP (or Perl, or...)?
__________________
Graham Ballantyne
Zimleter in Chief
Simon Fraser University
Reply With Quote
  #2 (permalink)  
Old 02-26-2009, 12:54 AM
Active Member
 
Posts: 30
Default

Bump. Anyone?
__________________
Graham Ballantyne
Zimleter in Chief
Simon Fraser University
Reply With Quote
  #3 (permalink)  
Old 03-03-2009, 02:43 PM
Active Member
 
Posts: 30
Default

Pretty slow around here lately...

I think I've determined that you can't include a perl .cgi in the zimlet .zip file and try to call it through an Ajax call -- it returned the full text of the script and didn't execute it. So, I'm guessing that I have two options:
  1. Host the script somewhere else and access it through the proxy
  2. Use a JSP

I'd like to avoid an external script, so: can I make admin SOAP calls (getting and setting account properties), and if so, does anyone have an example?
__________________
Graham Ballantyne
Zimleter in Chief
Simon Fraser University
Reply With Quote
  #4 (permalink)  
Old 03-13-2009, 06:30 PM
Project Contributor
 
Posts: 65
Default

Sure, this should get you going do a SOAP ADMIN call via JSP in a Zimlet on the server side:

Code:
String adminuser = "adminuser@zimbra.my.org";
String adminpassword = "mypassword";

// Standard SOAP URL on the local host
String soapurl = "https://127.0.0.1/service/soap/";
// Admin SOAP URL on the local host
String adminsoapurl = "https://127.0.0.1:7071/service/admin/soap/";

// Authenticate as the admin user
SoapProvisioning sp = new SoapProvisioning();
sp.soapSetURI(adminsoapurl);                      
sp.soapAdminAuthenticate(adminuser,adminpassword);       
SoapHttpTransport soapHttpTransport = new SoapHttpTransport(sp.soapGetURI());
soapHttpTransport.setAuthToken(sp.getAuthToken());
BTW: there are many examples of how to do the proxy call to an external service in the Zimlet code provided w/ Zimbra.

Last edited by ab5602 : 03-13-2009 at 06:39 PM.
Reply With Quote
Reply


Thread Tools
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.

Zimbrablog.com