Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Kumar</p> <p>Your question is very unprecise (what kind of is the server providing the emails/calendars? Is there a LDAP Domain? And so on). I suppose you are talking about an old Exchange Server because of some Domain and WebDAV and problems while searching? But I maybe can give you at least a bit of help, that may lead you to already trodden paths of other coders, so that you may find a simple and fast solution. </p> <p>Today I finished a M$ Exchange 2003 Connector as a proof-of-concept. And I tell you, that it was <em>really</em> hard for me as a student while an Internship. Nonetheless, I researched and searched and queried and annoyed other to get hints for a useful API, but none fulfilled my purposes.</p> <p>One small framework I found which is nice to use is called <a href="https://code.google.com/p/sardine/" rel="nofollow noreferrer">Sardine WebDAV Client for Java</a>. The project is very light-weighted, though it was helpful to get an idea how WebDAV works, even due to sources you can always look at. </p> <p>All other solutions aimed at a lot of different MAPI CC++ Libs for Linux. That was no option for me.</p> <p>So, what options did I have? No direct access to the customers Exchange 2k3 Server, but one email account. So you all may forgive me, but I found it much easier to make a POST request to the E2k3 Server via OWA, because it was activated than trying some heavy lib supported ways of accessing.</p> <p>Maybe this comes to your avail- Get the form-field information from the OWA form and build a connection string you Post to the server. Perhaps this is a string that might give you an idea. So you need to call a DLL like this:</p> <pre><code>HttpPost httpPost = new HttpPost("https://" + getUrl() + "/exchweb/bin/auth/owaauth.dll"); httpPost.setEntity(new StringEntity("destination=https%3A%2F%2F" + getUrl() + "%2Fexchange%2F&amp;flags=0&amp;username=" + getUser() + "&amp;password=" + getPassword() + "&amp;SubmitCreds=Log+On&amp;trusted=4&amp;flags=4", "UTF-8")); </code></pre> <p>The information how to make a form based authentication came from here: <a href="http://developer.gnome.org/evolution-exchange/stable/ximian-connector-fba.html" rel="nofollow noreferrer">Exchange 2003 Forms-Based Authentication</a>. As you can see I grabbed from the browser the Link, which is used to communicate with the E2k. The next step is simple - send the request and wait for...</p> <pre><code>HttpResponse response = httpclient.execute(httpPost); </code></pre> <p>If you get a good response in return, then you can filter out the Session ID. The next step after a successful login is to search for appointments. Therefore you should find a appropriate method to work with on an established WebDAV connection by asking M$ for some Information: <a href="http://msdn.microsoft.com/en-us/library/exchange/aa143053%28v=exchg.65%29.aspx" rel="nofollow noreferrer">SEARCH Method</a></p> <p>Then, you read what it can do. I went on with a well-known Find-Machine and queried for <a href="http://msdn.microsoft.com/en-us/library/aa123570.aspx" rel="nofollow noreferrer">Searching Calendar Folders with WebDAV</a>. </p> <p>After that you can create a POST request like this:</p> <pre><code>HttpPost hp = new HttpPost( "https://owa.SERVER.de/exchange/USER/Calendar") { @Override public String getMethod() { return "SEARCH"; } }; </code></pre> <p>Now you can make use of the SEARCH method. That is good, because your program is ready to send the request. </p> <pre><code>hp.setEntity(new StringEntity(QUERY, ContentType.TEXT_XML)); HttpResponse response = httpclient2.execute(hp); </code></pre> <p>I know it is no perfect solution. Because there were two circumstances which made me wonder. Firstly: I retrieved a Session ID, but I wasn't in need to re-use it anywhere, as long as I kept it in a field. And secondly: I needed to call for another HttpClient. I cannot explain right now. If I used the same HttpClient I used for logon, then all request were in vain. That is why I had to call another HttpClient.</p> <p>The last and most difficult step was to get behind the query, because the only debugging help I had were HTTP Error Numbers and the bad descriptions in the MSDN. Sorry for that. Well, this is what really worked fine. I got behind it with Trial and Error.</p> <pre><code>private final static String QUERY = "&lt;?xml version=\"1.0\"?&gt;&lt;g:searchrequest xmlns:g=\"DAV:\"&gt;&lt;g:sql&gt; Select \"DAV:href\", \"urn:schemas:calendar:dtstart\", \"urn:schemas:calendar:dtend\", \"urn:schemas:mailheader:subject\", \"urn:schemas:calendar:duration\" FROM Scope('SHALLOW TRAVERSAL OF \"/exchange/USER/Calendar\"')&lt;/g:sql&gt;&lt;/g:searchrequest&gt;"; </code></pre> <p>This is no particular query. I just alternated it from another Document and removed all stuff I didnt't need. </p> <p>I hope this helps you a bit. About providing Thunderbird Appointment/Calendar dates I can't tell anything because this is yet beyond my knowledge.</p> <p>Best regards and good night,</p> <p>Semo</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload