Bug 87837 - Server response could not be interpreted when trying to download events.
Summary: Server response could not be interpreted when trying to download events.
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: exchangeplugin (show other bugs)
Version: 3.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Cornelius Schumacher
URL:
Keywords:
: 86601 88498 89961 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-23 13:34 UTC by Carsten Schlipf
Modified: 2004-11-24 00:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
WebDAV error output (4.50 KB, text/plain)
2004-09-13 20:48 UTC, Ben Damm
Details
A dialog with the exchange server that doesn't work. (5.11 KB, text/plain)
2004-09-21 00:30 UTC, Ben Damm
Details
A dialog with the exchange server that does work. (1.78 KB, text/plain)
2004-09-21 00:32 UTC, Ben Damm
Details
A dialog with the exchange server: mailbox probe (1.31 KB, text/plain)
2004-09-28 22:50 UTC, Ben Damm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Schlipf 2004-08-23 13:34:16 UTC
Version:           3.3 (using KDE 3.3.0, compiled sources)
Compiler:          gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
OS:                Linux (i686) release 2.4.20-30.9

When I try to download my events from an Exchange 2000 server, I get the following error:

"Server response could not be interpreted."

In the details the following is reported:
"The page that you are looking for might have been removed, had its name changed, had its content expired, or is temporarily unavailable."

However it worked with KDE 3.2.3 without any problems and the same settings. If I paste the Mailbox URL in a konqueror window, it shows me the contained files, so the URL is correct and the server is actually responding.


Full Details:

WebDAV SEARCH response:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
 <HEAD>
  <TITLE>Bad request</TITLE>
  <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252" >
   <STYLE type="text/css" >
  BODY { font: 8pt/12pt verdana }
  H1 { font: 13pt/15pt verdana }
  H2 { font: 8pt/12pt verdana }
  A:link { color: red }
  A:visited { color: maroon }
</STYLE>
  </META>
 </HEAD>
</HTML>
<error-report xmlns="DAV:">
 <offending-response xmlns="DAV:">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;>
&lt;HTML>&lt;HEAD>&lt;TITLE>Bad request&lt;/TITLE>
&lt;META HTTP-EQUIV=&quot;Content-Type&quot; Content=&quot;text/html; charset=Windows-1252&quot;>
&lt;STYLE type=&quot;text/css&quot;>
  BODY { font: 8pt/12pt verdana }
  H1 { font: 13pt/15pt verdana }
  H2 { font: 8pt/12pt verdana }
  A:link { color: red }
  A:visited { color: maroon }
&lt;/STYLE>
&lt;/HEAD>&lt;BODY>&lt;TABLE width=500 border=0 cellspacing=10>&lt;TR>&lt;TD>

&lt;h1>Bad request&lt;/h1>
The page that you are looking for might have been removed, had its name changed, had its content expired, or is temporarily unavailable.
&lt;hr>
&lt;p>Please try the following:&lt;/p>
&lt;ul>
&lt;li>Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.&lt;/li>
&lt;li>If you reached this page by clicking a link, contact
 the Web site administrator to alert them that the link is incorrectly formatted.
&lt;/li>
&lt;li>Click the &lt;a href=&quot;javascript:history.back(1)&quot;>Back&lt;/a> button or open the home page for this Web site and look for other links to the information that you want.&lt;/li>
&lt;/ul>
&lt;h2>HTTP Error 400 - Request is badly formed.&lt;br>Internet Information Services (IIS)&lt;/h2>
&lt;hr>
&lt;p>Technical Information (for support personnel)&lt;/p>
&lt;ul>
&lt;li>Go to &lt;a href=&quot;http://go.microsoft.com/fwlink/?linkid=8180&quot;>Microsoft Product Support Services&lt;/a> and perform a title search for the words &lt;b>HTTP&lt;/b> and &lt;b>400&lt;/b>.&lt;/li>
&lt;li>Open &lt;b>IIS Help&lt;/b>, which is accessible in IIS Manager (inetmgr),
 and search for topics titled &lt;b>Web Site Setup&lt;/b>, &lt;b>Web Site Administration&lt;/b>, and &lt;b>About Custom Error Messages&lt;/b>.&lt;/li>
&lt;/ul>

&lt;/TD>&lt;/TR>&lt;/TABLE>&lt;/BODY>&lt;/HTML>
</offending-response>
</error-report>
Comment 1 pard 2004-09-07 16:52:08 UTC
same response with Exchange2003 (6.0.3790.0), url is working in konqueror
(kde 3.3, gentoo, gcc version 3.3.4 20040623, Linux i686 2.6.8)
with kde 3.2.3 everything was ok
Comment 2 Ben Damm 2004-09-13 20:46:43 UTC
I get the same thing.  With kde 3.2.3 it worked great, but not this is destroying my ability to show up to meetings on time!

My source is the debian packages in sid.

I'm attaching the output from the dialog box.



Comment 3 Ben Damm 2004-09-13 20:48:04 UTC
Created attachment 7510 [details]
WebDAV error output
Comment 4 Jan-Pascal van Best 2004-09-13 21:05:01 UTC
Cornelius, I'm reassigning to you since this bug seems to get some attention and I cannot find the time to work on it. The bug report looks genuine, the HTML pasted is an IIS/Exchange error page. Probably because somehow a query is being generated with errors in it, but I can't easily set up a debugging environment right now. My apologies. 
Comment 5 Reinhold Kainhofer 2004-09-13 22:48:58 UTC
On Monday 13 September 2004 21:05, Jan-Pascal van Best wrote:
> ------- Cornelius, I'm reassigning to you since this bug seems to get some
> attention and I cannot find the time to work on it. 

Neither can Cornelius (I guess)... At least I'm now the main maintainer of 
KOrganizer, so you can as well assign bugs to me. Actually, I don't really 
care a lot about bugs being assigned, since we are one very few people 
working on korganizer, there's not much risk stepping on each other's toes 
when fixing a bug.


> The bug report looks 
> genuine, the HTML pasted is an IIS/Exchange error page. Probably because
> somehow a query is being generated with errors in it, but I can't easily
> set up a debugging environment right now. 

That's also our main problem: We don't have any exchange server to check how 
well the plugin or the resource works. Is there anybody here who is willing 
and able to give us a test account on an exchange server (or rather we'd need 
test accounts on each different version of exchange)?

Since you were the one who wrote the plugin and the resource, maybe you can 
give us a quick overview over what works. In particular, I'd like to get rid 
of the plugin and just use the resource, but people have told me that the 
plugin is more mature, and the resource isn't perfect, yet?

Also, can you give us a list of things that would need to be done to make the 
resource be a solution for korganizer to work with exchange. Currently, all 
we can say is "it might work, but we have no idea if or how it works". 

Thanks,
Reinhold
Comment 6 Ben Damm 2004-09-13 23:55:32 UTC
I'd be happy to use the "IMAP-server via KMail" resource, but it just plain doesn't work.  I'll enable it in KMail, and despite the fact that the folders already exist, KMail will ask if they should be created.  I've answered "Yes", and KMail simply delivers an error.  Well, the folders already exist.  In any case, the resource then does not present the calendar items.

Also the "Exchange2000" resource doesn't work.  It seems to correctly guess what the mailbox is and issues no errors, but then fails to affect my calendar view.

The plugin worked in KDE 3.2.3.  I do not have any control over the exchange server, but I'll help in any way that I can.  Also I've tried konstruct, but KDE being as massive as it is I've never got a useful build out of it.  It seems to need more TLC than I have time available.  Nevertheless, if I can help I will.  

Thanks,
-Ben
Comment 7 Ben Damm 2004-09-14 02:41:27 UTC
As a post-note: I've filed a bug (#89457) for the KMail groupware resource giving an error. It is here:

http://bugs.kde.org/show_bug.cgi?id=89457
Comment 8 Jan-Pascal van Best 2004-09-15 12:12:11 UTC
> Since you were the one who wrote the plugin and the resource, maybe you can
> give us a quick overview over what works. In particular, I'd like to get rid
> of the plugin and just use the resource, but people have told me that the
> plugin is more mature, and the resource isn't perfect, yet?
I think the resource is almost finished. Basic functionality is there, it just needs testing in real-world situations. It also seems the move to KDE 3.3 f*d up both the plugin and the resource. 

The reason I've been advising people to use the plugin and not yet the resource is that bugs in the resource are much more probable to wreck people's calendars. The plugin has a much more controlled interaction with the Exchange server. But the resource is definitely the way to go.

> Also, can you give us a list of things that would need to be done to make the
> resource be a solution for korganizer to work with exchange. Currently, all
> we can say is "it might work, but we have no idea if or how it works".
Most of it works. What I was working on before I ran out of time is automatic synchronisation between KOrganizer and Exchange, i.e., if someone else puts something in my Exchange calendar, I want to see that in KOrganizer. I had this almost working, the remaining problems were more with letting the KOrganizer GUI know that something had changed than with communicating with Exchange. This mechanism probably improved a lot in KOrganizer over the last year.

Apart from that, fixing the present bug, more testing, and maybe some interface polish is all that is needed as for as I know.

Jan-Pascal
Comment 9 Jan-Pascal van Best 2004-09-17 15:23:12 UTC
Mmm, the Exchange plugin in KOrganizer 3.3 from Debian-unstable (kdepim-4:3.3.0-2) works OK for me. The "determine mailbox URL automatically" works and I can download and upload events. If I can find some time somewhere I'll check what happens with compiled recent sources from HEAD.
Comment 10 Ben Damm 2004-09-17 18:56:48 UTC
I'm using the same version, kdepim-4:3.3.0-2, and it does not work.  Do you think it would be of any use for me to upload packet logs?  

-Ben
Comment 11 Ben Damm 2004-09-21 00:30:26 UTC
Created attachment 7605 [details]
A dialog with the exchange server that doesn't work.

This shows the SELECT request where the exchange server returns an error.
Comment 12 Ben Damm 2004-09-21 00:32:10 UTC
Created attachment 7606 [details]
A dialog with the exchange server that does work.

After downgrading to KDE 3.2, I captured this exchange.  It appears that the
difference between the two requests is basically the date format.
Comment 13 Ben Damm 2004-09-21 00:44:02 UTC
This may matter; my locale is english Canada, with customized short date formats.  I use yyyy-MM-DD.
Comment 14 Reinhold Kainhofer 2004-09-21 00:48:21 UTC
Hi Ben,
Thanks a lot for the two communication logs with the server. They are really 
helpful (actually we don't have any exchange account where we can test the 
resource, and the original developer of the resource doesn't have any time 
any more).

It looks like the date format in the request is incorrect. The "old" working 
dialog show that the date format used there is
2004/09/20
In KDE 3.3 it seems the date/time format in the request is
2004-09-20T00:00:00Z

Probably this format is not understood by the exchange server?

The change was done by Cornelius in revision 1.24 of 
kdepim/libkpimexchange/core/exchangedownload.cpp. The commit message was 
"Make it work with OpenGroupware." So, obviously, Exchange and opengroupware 
(which both use webdav) use different date/time formats.

Cornelius, do you see any chance we can get this to work with both exchange 
and opengroupware?


Reinhold
Comment 15 Cornelius Schumacher 2004-09-21 09:01:36 UTC
OpenGroupware could be adapted to also understand the other format.

The alternative would be to make it configurable.
Comment 16 Ben Damm 2004-09-21 17:04:42 UTC
Are there any OpenGroupware deployments out there?  If so wouldn't your change break them (or at least clients attempting to use them)?

How about this... the mailbox probe works just fine.  Could you use that response to determine if you are talking to an OpenGroupware or Exchange server?  I can attach a mailbox probe transcript if you like, but not until Friday.

-Ben
Comment 17 Reinhold Kainhofer 2004-09-26 14:11:23 UTC
*** Bug 88498 has been marked as a duplicate of this bug. ***
Comment 18 Reinhold Kainhofer 2004-09-26 14:13:50 UTC
From Bug 86601:
I've found a problem when trying to get "korganizer" to read Calendar information from
Exchange Server 2003.  I know a fair amount about Exchange Server, but I'm new to Linux so
please be aware that I might be missing something obvious. Note that lots of other things
work well.

I'm working on a version of the code that was created recently using the "konstruct"
program.  The folder name is kdepim-3.2.92.

When I try to read the Calendar I get a an error reported back (via WebDAV) which
indicates that the request is bad.  This is an example query:

korganizer: SELECT "DAV:href", "urn:schemas:calendar:instancetype",
"urn:schemas:calendar:uid"
FROM Scope('shallow traversal of ""')
WHERE "urn:schemas:calendar:dtend" > '2004-09-01T00:00:00Z'
AND "urn:schemas:calendar:dtstart" < '2004-10-01T23:59:59Z'

And the response is:

<HTML>
 <HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
 </HEAD>
</HTML>
<error-report xmlns="DAV:">
&lt;body>&lt;h2>HTTP/1.1 400 Bad
Request&lt;/h2>&lt;/body>&lt;/HTML></offending-response>>
</error-report>



I'm not a C++, Linux or KDE programmer I'm afraid. I eventually found the source and
edited it, but it then took me quite a while to figure out where the output of the make
was going and what I should do with it. I settled on doing this:

cd .../konstruct/kde/kdepim/work/kdepim-3.2.92/libkpimexchange
make
cp --reply=y .libs/libkpimexchange.* /root/kde3.3-beta2/lib/  

which seems to work as I can see my updated debug when running korganizer from the
konsole.

Enough about me and my problems. I think the solution is to change the query string in the
WHERE clause.

I've been editing
...konstruct/kde/kdepim/work/kdepim-3.2.92/libkpimexchange/core/exchangedownload.cpp

Old line 169:

  QString sql = 
        "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", "
        "\"urn:schemas:calendar:uid\"\r\n"
        "FROM Scope('shallow traversal of \"\"')\r\n"
        "WHERE \"urn:schemas:calendar:dtend\" > '" + startString + "'\r\n"
        "AND \"urn:schemas:calendar:dtstart\" < '" + endString + "'";

New line 169:

  QString sql = 
        "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", "
        "\"urn:schemas:calendar:uid\"\r\n"
        "FROM Scope('shallow traversal of \"\"')\r\n"
        "WHERE \"urn:schemas:calendar:dtend\" > CAST(\"" + startString + "\" as
'dateTime')\r\n"
        "AND \"urn:schemas:calendar:dtstart\" < CAST(\"" + endString + "\" as
'dateTime')";

Note that I had to change from a single-quote to a double-quote as well as adding the
CAST. It still failed if I tried one change without the other. I tried to make you a .diff
file, but I couldn't even get that right.

I no longer have an Exchange 2000 Server to test against so I'm afraid I can't help check
it works there.

Please let me know if you need more information, or if I should direct this information
elsewhere.

Many Thanks (for your time today, and for creating all the code in the first place)
Comment 19 Reinhold Kainhofer 2004-09-26 14:14:20 UTC
*** Bug 86601 has been marked as a duplicate of this bug. ***
Comment 20 Ben Damm 2004-09-28 22:50:24 UTC
Created attachment 7716 [details]
A dialog with the exchange server: mailbox probe

This shows a mailbox probe dialog with the exchange server.  Perhaps the plugin
can determine from the probe if the server is an exchange server or an
opengroupware server.  If this is going to take some time, then really a
configurable option will be great.

Thanks,
-Ben
Comment 21 Carsten Schlipf 2004-09-30 21:39:39 UTC
Well, this is critical for me, since in the office I have to interact with Exchange servers. Therefore I cannot upgrade to KDE 3.3 until this works again.
Comment 22 Reinhold Kainhofer 2004-09-30 21:51:59 UTC
Zitiere carsten@yeap.de:
> ------- Additional Comments From carsten yeap de  2004-09-30 21:39
> -------
> Well, this is critical for me, since in the office I have to interact
> with Exchange servers. Therefore I cannot upgrade to KDE 3.3 until this
> works again.

I understand your concern, but I can't do anything about it.

As I already mentioned (also on the kdepim mailing list), we don't have any 
exchange account on any exchange server, where we can test the resource. The 
different date format is just a guess, but from that we can't really ensure 
that it works if we change it... We need to be able to test if this is really 
the problem.

Cheers,
Reinhold

Comment 23 Ben Damm 2004-09-30 23:13:50 UTC
If the hold-up in fixing this problem is finding an exchange resource, I'm more than willing to help.  I'm a software developer by profession (not C++ although I do work with it sometimes) so if someone would like me to run tests or try builds I'll do it.  I can only spare a few hours a week but that might be enough.

-Ben
Comment 24 Aaron Williams 2004-10-01 00:37:20 UTC
I too can help test this.  I am running KDE on Solaris and have user access to an exchange server.  However, I am currently running KDE 3.2.3 and will not upgrade to 3.3 until it is more stable on Solaris.  I am already playing around with trying to fix korganizer to better handle Exchange.  The big issue I am facing is that korganizer is not properly handling the timezone offsets as required.
Comment 25 Reinhold Kainhofer 2004-10-01 10:01:05 UTC
Hi Aaron,
> I too can help test this.  I am running KDE on Solaris and have user
> access to an exchange server.

Great. I'll come back to you eventually.

> However, I am currently running KDE 3.2.3
> and will not upgrade to 3.3 until it is more stable on Solaris.  I am
> already playing around with trying to fix korganizer to better handle
> Exchange.  The big issue I am facing is that korganizer is not properly
> handling the timezone offsets as required.

Which of these tz-related bugs (on solaris) is haunting you?
http://bugs.kde.org/show_bug.cgi?id=82209 (General problem)
http://bugs.kde.org/show_bug.cgi?id=64342 (Exchange-related)
http://bugs.kde.org/show_bug.cgi?id=88636 (General issue with tz selection)
http://bugs.kde.org/show_bug.cgi?id=56679 (IRIX, but has been reported before 
for Solaris and been fixed there)

Cheers,
Reinhold

Comment 26 Carsten Schlipf 2004-10-02 13:27:35 UTC
I am also willing to help. I can't give you access to my exchange server, but if you give me a patch or something else I can run from my system to check, if it's the timezone that causes the problem, feel free to contact me.
Comment 27 Ben Damm 2004-10-05 23:01:21 UTC
Hi There,

  Any news on this?  We're dying out here!

-Ben
Comment 28 Ben Damm 2004-10-06 19:13:13 UTC
Hello, just checking in to see if anything is happening.
-Ben
Comment 29 Ben Damm 2004-10-12 20:02:36 UTC
Hello developers,

  Could someone please find a minute to estimate when we might get an ETA?  Perhaps the status can be changed from UNCONFIRMED to CONFIRMED?

Thank you,
-Ben
Comment 30 Carsten Schlipf 2004-10-14 20:31:46 UTC
I installed KDE 3.3.1 and the bug is there.

Why don't you simply change the Date format in KDE 3.3.2 even while you may not be able to test it? As of today the exchange plugin is broken and therefore useless anyway (or does it still work for some people?). It would make no difference, if you try to fix it and it still does not work. But if it works you've solved this problem.
Comment 31 Michael Denio 2004-10-19 20:31:13 UTC
I applied the date format change from bug 86601 referenced by Reinhold.  This works against Exchange 2003.
Comment 32 David Bowen 2004-10-19 20:45:34 UTC
Well I'm delighted to see the bug report / code fix I suggested in Bug 86601
has been of use to someone - thanks for letting us know Michael Denio.

David@MyForest.Com

Michael Denio (Michael.Denio@MorganStanley.com) wrote:
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=87837
>
>
>
>
> ------- Additional Comments From Michael.Denio MorganStanley com  2004-10-19 20:31
> -------
> I applied the date format change from bug 86601 referenced by Reinhold.  This works
> against Exchange 2003.
>
>
>
>

Comment 33 sorn73 2004-11-04 10:37:05 UTC
*** This bug has been confirmed by popular vote. ***
Comment 34 Reinhold Kainhofer 2004-11-17 22:44:14 UTC
CVS commit by kainhofe: 

Unbreak downloading from the Exchange server. 
Just revert Cornelius' commit with the message "Make it work with OpenGroupware." 

CCBUG: 87837


  M +3 -3      exchangedownload.cpp   1.26


--- kdepim/libkpimexchange/core/exchangedownload.cpp  #1.25:1.26
@@ -143,5 +143,4 @@ void ExchangeDownload::download( const Q
 
 // Original query TODO: make query configurable
-#if 0
 QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end )
 {
@@ -157,6 +156,7 @@ QString ExchangeDownload::dateSelectQuer
   return sql;
 }
-#endif
 
+#if 0
+// That's the "new" code that breaks with Exchange. It was meant for Opengroupware, but that got its own resource anyway
 QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end )
 {
@@ -175,5 +175,5 @@ QString ExchangeDownload::dateSelectQuer
   return sql;
 }
-
+#endif
 
 void ExchangeDownload::slotSearchResult( KIO::Job *job )


Comment 35 Reinhold Kainhofer 2004-11-17 22:44:16 UTC
CVS commit by kainhofe: 

Backport from HEAD:
Unbreak downloading from the Exchange server. 
Just revert Cornelius' commit with the message "Make it work with OpenGroupware." 

BUG: 87837


  M +3 -3      exchangedownload.cpp   1.24.2.2


--- kdepim/libkpimexchange/core/exchangedownload.cpp  #1.24.2.1:1.24.2.2
@@ -143,5 +143,4 @@ void ExchangeDownload::download( const Q
 
 // Original query TODO: make query configurable
-#if 0
 QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end )
 {
@@ -157,6 +156,7 @@ QString ExchangeDownload::dateSelectQuer
   return sql;
 }
-#endif
 
+#if 0
+// That's the "new" code that breaks with Exchange. It was meant for Opengroupware, but that got its own resource anyway
 QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end )
 {
@@ -175,5 +175,5 @@ QString ExchangeDownload::dateSelectQuer
   return sql;
 }
-
+#endif
 
 void ExchangeDownload::slotSearchResult( KIO::Job *job )


Comment 36 Ben Damm 2004-11-17 22:52:42 UTC
Thank you *VERY* much Reinhold.  I'm contacting you privately so that I can send via paypal a small token of appreciation.

Regards,
-Ben
Comment 37 Reinhold Kainhofer 2004-11-17 22:56:36 UTC
*** Bug 89961 has been marked as a duplicate of this bug. ***
Comment 38 Reinhold Kainhofer 2004-11-17 22:59:57 UTC
*** Bug 89961 has been marked as a duplicate of this bug. ***
Comment 39 Aaron Williams 2004-11-17 23:14:10 UTC
Thanks.  BTW, I can help if you need anyone to help test with an 
exchange server.  I've also had problems with the timezone info not 
being handled with Exchange.  To further complicate matters, I'm running 
KDE on Solaris running on an Ultrasparc processor :)

Reinhold Kainhofer wrote:

>------- You are receiving this mail because: -------
>You are on the CC list for the bug, or are watching someone who is.
>        
>http://bugs.kde.org/show_bug.cgi?id=87837        
>
>
>
>
>------- Additional Comments From reinhold kainhofer com  2004-11-17 22:44 -------
>CVS commit by kainhofe: 
>
>Unbreak downloading from the Exchange server. 
>Just revert Cornelius' commit with the message "Make it work with OpenGroupware." 
>
>CCBUG: 87837
>
>
>  M +3 -3      exchangedownload.cpp   1.26
>
>
>--- kdepim/libkpimexchange/core/exchangedownload.cpp  #1.25:1.26
> @ -143,5 +143,4  @ void ExchangeDownload::download( const Q
> 
> // Original query TODO: make query configurable
>-#if 0
> QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end )
> {
> @ -157,6 +156,7  @ QString ExchangeDownload::dateSelectQuer
>   return sql;
> }
>-#endif
> 
>+#if 0
>+// That's the "new" code that breaks with Exchange. It was meant for Opengroupware, but that got its own resource anyway
> QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end )
> {
> @ -175,5 +175,5  @ QString ExchangeDownload::dateSelectQuer
>   return sql;
> }
>-
>+#endif
> 
> void ExchangeDownload::slotSearchResult( KIO::Job *job )
>  
>

Comment 40 Reinhold Kainhofer 2004-11-17 23:27:33 UTC
On Wednesday, 17. November 2004 23:14, Aaron Williams wrote:
> Thanks.  BTW, I can help if you need anyone to help test with an
> exchange server.  

Thanks a lot. We just got a test server (Exchange 2003 running under vmware), 
so I could finally reproduce and test this bug.

> I've also had problems with the timezone info not 
> being handled with Exchange. 

Ah, was this bug 88005? I'm experiencing this myself...
Do you know any way to sniff the communication with the server?
I have to investigate a little better in which timezone the server expects the 
times to be handled. In particular, whether it wants/sends all times in UTC, 
or in the server's timezone. If the latter is the case, we need to find a way 
to query the server's tz...

> To further complicate matters, I'm running 
> KDE on Solaris running on an Ultrasparc processor :)

Ah, a solaris guy. Can you reproduce bug #64342?
http://bugs.kde.org/show_bug.cgi?id=64342

Also, I haven't been able to reproduce bug #87706 for the exchange plugin of 
korganizer (not the resource). 

Cheers,
Reinhold

Comment 41 Ben Damm 2004-11-17 23:32:23 UTC
> Do you know any way to sniff the communication with the server? 

I used "ethereal" to produce the earlier communication logs.

-Ben

Comment 42 Aaron Williams 2004-11-17 23:34:27 UTC
Yep.  I made some patches and was able to improve things.  I can send 
you my patches I have made so far.

I used the debugger and turned on the debugging output and peppered the 
code with kdDebug() messages when debugging this.

You can also try using Ethereal, an awesome network analyzer.  It's 
available for Unix and Windows.

-Aaron

Reinhold Kainhofer wrote:

>------- You are receiving this mail because: -------
>You are on the CC list for the bug, or are watching someone who is.
>        
>http://bugs.kde.org/show_bug.cgi?id=87837        
>
>
>
>
>------- Additional Comments From reinhold kainhofer com  2004-11-17 23:27 -------
>On Wednesday, 17. November 2004 23:14, Aaron Williams wrote:
>  
>
>>Thanks.  BTW, I can help if you need anyone to help test with an
>>exchange server.  
>>    
>>
>
>Thanks a lot. We just got a test server (Exchange 2003 running under vmware), 
>so I could finally reproduce and test this bug.
>
>  
>
>>I've also had problems with the timezone info not 
>>being handled with Exchange. 
>>    
>>
>
>Ah, was this bug 88005? I'm experiencing this myself...
>Do you know any way to sniff the communication with the server?
>I have to investigate a little better in which timezone the server expects the 
>times to be handled. In particular, whether it wants/sends all times in UTC, 
>or in the server's timezone. If the latter is the case, we need to find a way 
>to query the server's tz...
>
>  
>
>>To further complicate matters, I'm running 
>>KDE on Solaris running on an Ultrasparc processor :)
>>    
>>
>
>Ah, a solaris guy. Can you reproduce bug #64342?
>http://bugs.kde.org/show_bug.cgi?id=64342
>
>Also, I haven't been able to reproduce bug #87706 for the exchange plugin of 
>korganizer (not the resource). 
>
>Cheers,
>Reinhold
>  
>

Comment 43 Aaron Williams 2004-11-24 00:45:42 UTC
I had problems with the patch that was provided for korganizer for 
downloading information from our Exchange 2003 server.  The below query 
works.  It will also probably work without the "ORDER BY" statement.  I 
based this off of something I found on a Microsoft web site.

-Aaron

QString ExchangeDownload::dateSelectQuery( const QDate& start, const 
QDate& end )
{
  QString startString;
  startString.sprintf( "%04i-%02i-%02iT00:00:00Z", start.year(),
                       start.month(), start.day() );
  QString endString;
  endString.sprintf( "%04i-%02i-%02iT23:59:59Z", end.year(), end.month(),
                     end.day() );
  QString sql =
        "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", "
        "\"urn:schemas:calendar:uid\"\r\n"
        "FROM Scope('shallow traversal of \"\"')\r\n"
        "WHERE \"urn:schemas:calendar:dtend\" >= CAST(\"" + startString 
+ "\" as 'dateTime')\r\n"
        "AND \"urn:schemas:calendar:dtstart\" < CAST(\"" + endString + 
"\" as 'dateTime')\r\n"
        "AND \"DAV:contentclass\" = 'urn:content-classes:appointment'\r\n"
        "ORDER BY \"urn:schemas:calendar:dtstart\" ASC";
  kdDebug() << "dateSelectQuery is " << sql << endl;
  return sql;
}

>>    
>>