Hello,
I'm trying to gain access to all the messages/conversations on a Zimbra server. I've got access to an admin account and I'm using a combination of SoapProvivisioning and SoapHttpTransport. Here is what I've got so far
My questions.Code:public class ZimbraTest { public static void main(String[] args) { try { SoapProvisioning sp = new SoapProvisioning(); sp.soapSetURI("https://192.168.0.165:7071" + ZimbraServlet.ADMIN_SERVICE_URI); sp.soapAdminAuthenticate("admin", "baseball"); List<Domain> domains = sp.getAllDomains(); for (Domain domain : domains) { System.out.println(domain.getName()); List<Account> accounts = sp.getAllAccounts(domain); for (Account account : accounts) { System.out.println("\t" + account.getName()); // This throws ZClientException // MailboxInfo mailboxInfo = sp.getMailbox(account); // System.out.println("\t\t" + mailboxInfo.getMailboxId()); //This works SoapHttpTransport soapHttpTransport = new SoapHttpTransport( sp.soapGetURI()); soapHttpTransport.setAuthToken(sp.getAuthToken()); XMLElement req = new XMLElement( AdminService.GET_MAILBOX_REQUEST); Element mBox = req.addElement(AdminService.E_MAILBOX); mBox .addAttribute(AdminService.A_ACCOUNTID, account .getId()); System.out.println(req.prettyPrint()); Element tagsResponse = soapHttpTransport.invoke(req); System.out.println(tagsResponse.prettyPrint()); } } } catch (SoapFaultException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
1. Is it all right to use SoapProvisioning or should I be using SoapHttpTransport only?
2. What should I do after I have the account id? Is there a request to get all messages for an account?
Also, is there a way to turn off debug messages on SoapProvisioning?
Any help would be appreciated.
Thanks in advance,
-t


LinkBack URL
About LinkBacks


