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 03-17-2009, 03:35 AM
Junior Member
 
Posts: 7
Default retrieve contacts in SOAP/XML not JSON

Hi,
I want to use the zimbra contacts for my application.
To parse the contacts I need them in SOAP/XML format.
I looked at ZMailboxUtil.java but I can't figure out how to
get a SOAP/XML response.

Code:
Options opt = new Options();
opt.setAccount("foo@bar.com");
opt.setPassword("strongpassword");
opt.setUri("https://bar.com/service/soap");
opt.setResponseProtocol(SoapProtocol.Soap12);			opt.setRequestProtocol(SoapProtocol.Soap12);

ZMailbox mailbox = new ZMailbox(mboxopt);
ZSearchParams search = new ZSearchParams("Expression");
search.setTypes("contact");
ZSearchResult result = mailbox.search(search);
			
System.out.println(result);
The output of result.toString() is in JSON format.

Can someone please explain what the setResponseProtocol/setRequestProtocol methods are are good for ?
And how can I I get a response in SOAP/XML format?

The code above should basically do the same like the following command:
Code:
zmmailbox -a  foo@bar.com -p 'strongpassword'  -m foo@bar.com -r soap12 -d s -t contact "Expression"
Regards,
Ruben
Reply With Quote
  #2 (permalink)  
Old 03-21-2009, 01:44 AM
Junior Member
 
Posts: 7
Default

*bump* - anyone?
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.