我想使用REST請求獲取所有zimbra日曆的名稱。 如何做到這一點? 日Thnx如何使用REST API獲取Zimbra的日曆名稱
0
A
回答
1
這不是休息,但即使是Zimbra的SOAP API,但它是一個解決方案:
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
String postContent = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\">"+
"<soap:Header>" +
"<context xmlns=\"urn:zimbra\">" +
"<format type=\"js\"/>" +
"<authToken>" + authToken + "</authToken>" +
"</context>" +
"</soap:Header>" +
"<soap:Body>" +
"<GetFolderRequest xmlns=\"urn:zimbraMail\" />" +
"</soap:Body>" +
"</soap:Envelope>";
// insert your SOAP XML!!!
byte[] b = postContent.getBytes();
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty("Content-Length", String.valueOf(b.length));
httpConn.setRequestProperty("Content-Type","application/soap+xml; charset=utf-8");
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
// Everything's set up; send the XML that was read in to b.
OutputStream out = httpConn.getOutputStream();
out.write(b);
out.close();
// Read the response and write it to standard out.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
BufferedReader in = new BufferedReader(isr);
// read & do something with input stream...
String s = null;
String soapResponse = "";
while((s=in.readLine()) != null){
soapResponse += s;
}
System.out.println(soapResponse);
當你解析結果,採取符合你想要什麼(任命文件夾... )
0
我不認爲你可以用REST做到這一點。但是你可以使用SOAP來完成。檢查以下網址。
http://mmrblogger.blogspot.in/2013/04/how-to-get-all-calendar-names-for.html
相關問題
- 1. 如何使用Outlook REST API獲取日曆鏈接?
- 2. 如何從系統日曆獲取月份名稱?使用mvc
- 3. Google API REST獲取FilesInFolder名稱
- 4. 如何從Outlook REST API獲取日曆設置
- 5. Outlook日曆REST API
- 6. Outlook Rest Api - 在特定時區獲取日曆視圖(REST)
- 7. 如何使用JavaScript從Google日曆(API)獲取今日事件?
- 8. 如何使用日曆API獲取ISO日期
- 9. 如何獲取iOS 6中默認日曆的名稱/標識
- 10. 基於組名稱獲取SharePoint組權限級別名稱使用SharePoint Rest API
- 11. 如何在REST API中獲取域名
- 12. 如何使用REST API獲取?
- 13. 谷歌日曆API - 按名稱
- 14. 如何使用Google日曆API在Android中獲取Google日曆事件?
- 15. 如何通過Google日曆API獲取日曆ID
- 16. 如何使用日曆api v3獲取活動詳細信息
- 17. 如何獲取使用Android版Gmail API的用戶名稱?
- 18. 使用Office 365 REST API讀取輔助日曆
- 19. 如何使用Google Earth API獲取地標的名稱?
- 20. 如何從Android使用android API獲取wifi網絡的名稱?
- 21. 如何使用Steam API從名稱獲取遊戲的Steam ID?
- 22. 使用日曆服務(基於REST)訪問與會者日曆時獲取StoreException
- 23. TeamCity REST API如何獲取並非歷史版本的構建
- 24. 通過Google日曆API獲取Google日曆的時區
- 25. 從zimbra服務器獲取別名列表通過soap admin api
- 26. 如何獲取UI日曆?
- 27. 使用Teamcity REST API,如何使用teamcity rest API獲取nuget包列表?
- 28. 如何獲取日曆中的日期?
- 29. Vb.net獲取週日名稱
- 30. 如何按名稱選擇Outlook日曆?
嗨,我還需要獲得日曆名稱...什麼是「的authToken」變量? – startupsmith