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