B
Bernhard Weitlaner
Hello!
I am new in webdav. I am trying for a long time to create an appointment in
an exchange calendar (pubic folder) using webdav but without success.
I am despairing.
Here my programm:
String strCalendarURI = "http://server/public/test1";
HttpURL hrl = new HttpURL(strCalendarURI);
hrl.setUserinfo("user", "pw");
WebdavResource wdr = new WebdavResource(hrl);
wdr.setDebug(1);
Hashtable props = new Hashtable();
props.put(new PropertyName("DAV:", "contentclass"),
"urn:content-classes:appointment");
props.put(new PropertyName("DAV:", "contentclass"),
"urn:content-classes:appointment");
props.put(new PropertyName("http//schemas.microsoft.com/exchange",
"outlookmessageclass"), "IPM.Appointment");
props.put(new PropertyName("urn:schemas:httpmail","subject"), "Changed
Test Appointment Subject");
props.put(new PropertyName("urn:schemas:httpmail","htmldescription"),
"Let's meet here");
props.put(new PropertyName("urn:schemas:calendar","location"), "do");
props.put(new PropertyName("urn:schemas:calendar","dtstart"),
"2006-01-01T10:00:00.000Z");
props.put(new PropertyName("urn:schemas:calendar", "dtend"),
"2006-01-01T10:30:00.000Z");
props.put(new PropertyName("urn:schemas:calendar","instancetype"), "0");
props.put(new PropertyName("urn:schemas:calendar","alldayevent"), "0");
props.put(new PropertyName("urn:schemas:calendar","responserequested"),
"1");
props.put(new PropertyName("urn:schemas:calendar","busystatus"), "BUSY");
props.put(new PropertyName("urn:schemas:calendar","meetingstatus"),
"CONFIRMED");
props.put(new PropertyName("header", "to"), "user");
props.put(new PropertyName("urn:schemas:mapi","finvited"), "1");
out.print("returned value ... " + wdr.proppatchMethod(props, true));
The output:
PROPPATCH /public/test1 HTTP/1.1
Authorization: Basic Qi5XZWl0bGFuZXI6c3NvYg==
Content-Type: text/xml; charset=utf-8
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: server
Content-Length: 1068
<Dropertyupdate xmlns="DAV:">
<D:set>
<Drop>
<responserequested xmlns="urn:schemas:calendar">
1
</responserequested>
<dtend xmlns="urn:schemas:calendar">
2006-01-01T10:30:00.000Z
</dtend>
<meetingstatus xmlns="urn:schemas:calendar">
CONFIRMED
</meetingstatus>
<to xmlns="header">
user
</to>
<instancetype xmlns="urn:schemas:calendar">
0
</instancetype>
<outlookmessageclass xmlns="http//schemas.microsoft.com/exchange">
IPM.Appointment
</outlookmessageclass>
<location xmlns="urn:schemas:calendar">
do
</location>
<alldayevent xmlns="urn:schemas:calendar">
0
</alldayevent>
<dtstart xmlns="urn:schemas:calendar">
2006-01-01T10:00:00.000Z
</dtstart>
<htmldescription xmlns="urn:schemas:httpmail">
Let's meet here
</htmldescription>
<finvited xmlns="urn:schemas:mapi">
1
</finvited>
<D:contentclass>
urn:content-classes:appointment
</D:contentclass>
<v xmlns="urn:schemas:contacts">
1
</v>
<subject xmlns="urn:schemas:httpmail">
Changed Test Appointment Subject
</subject>
<busystatus xmlns="urn:schemas:calendar">
BUSY
</busystatus>
</Drop>
</D:set>
</Dropertyupdate>
------------------------------------------------------------------------
<<<<<<< from server ---------------------------------------------------
HTTP/1.1 207 Multistatus
Date: Wed, 25 Jan 2006 08:38:54 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
MS-Exchange-Permanent-URL:
http://server/public/-FlatUrlSpace-/ddd97380fa9bf5429d9fdc31ddb24cd9-288e4
Repl-UID: <rid:ddd97380fa9bf5429d9fdc31ddb24cd9000000000529>
Content-Type: text/xml
Content-Length: 617
ResourceTag:
<rt:ddd97380fa9bf5429d9fdc31ddb24cd9000000000529ddd97380fa9bf5429d9fdc31ddb24cd9000000000879>
MS-WebStorage: 6.5.7638
<a:multistatus
xmlns:a="DAV:"
xmlns:b="urn:schemas:calendar"
xmlns:c="header"
xmlns:d="http//schemas.microsoft.com/exchange"
xmlns:e="urn:schemas:httpmail"
xmlns:f="urn:schemas:mapi"
xmlns:g="urn:schemas:contacts">
<a:response>
<a:href>
http://server/public/test1
</a:href>
<aropstat>
<a:status>
HTTP/1.1 200 OK
</a:status>
<arop>
<b:responserequested>
</b:responserequested>
<b:dtend>
</b:dtend>
<b:meetingstatus>
</b:meetingstatus>
<c:to>
</c:to>
<b:instancetype>
</b:instancetype>
<dutlookmessageclass>
</dutlookmessageclass>
<b:location>
</b:location>
<b:alldayevent>
</b:alldayevent>
<b:dtstart>
</b:dtstart>
<e:htmldescription>
</e:htmldescription>
<f:finvited>
</f:finvited>
<a:contentclass>
</a:contentclass>
<g:v>
</g:v>
<e:subject>
</e:subject>
<b:busystatus>
</b:busystatus>
</arop>
</aropstat>
</a:response>
PROPFIND /public/test1 HTTP/1.1
Authorization: Basic Qi5XZWl0bGFuZXI6c3NvYg==
Content-Type: text/xml; charset=utf-8
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: server
Content-Length: 207
Depth: 0
<Dropfind xmlns="DAV:">
<Drop>
<D:displayname>
</D:displayname>
<D:getcontentlength>
</D:getcontentlength>
<D:getcontenttype>
</D:getcontenttype>
<D:resourcetype>
</D:resourcetype>
<D:getlastmodified>
</D:getlastmodified>
<D:lockdiscovery>
</D:lockdiscovery>
</Drop>
</Dropfind>
------------------------------------------------------------------------
<<<<<<< from server ---------------------------------------------------
HTTP/1.1 207 Multistatus
Date: Wed, 25 Jan 2006 08:38:54 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Content-Type: text/xml
Accept-Ranges: rows
MS-WebStorage: 6.5.7638
Transfer-Encoding: chunked
<a:multistatus
xmlns:a="DAV:"
xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:c="xml:">
<a:response>
<a:href>
http://server/public/test1/
</a:href>
<aropstat>
<a:status>
HTTP/1.1 200 OK
</a:status>
<arop>
<a:displayname>
test1
</a:displayname>
<a:getcontentlength b:dt="int">
0
</a:getcontentlength>
<a:resourcetype>
<a:collection>
</a:collection>
</a:resourcetype>
<a:getlastmodified b:dt="dateTime.tz">
2006-01-25T08:38:54.755Z
</a:getlastmodified>
<lockdiscovery xmlns="DAV:">
</lockdiscovery>
</arop>
</aropstat>
<aropstat>
<a:status>
HTTP/1.1 404 Resource Not Found
</a:status>
<arop>
<a:getcontenttype>
</a:getcontenttype>
</arop>
</aropstat>
</a:response>
</a:multistatus>
------------------------------------------------------------------------
It looks not so bad. But no appointment is created.
Where is the problem?
When i google for the problem i always find howtos for .NET but nearly
nothing for java
Thank you for your help.
best regards
Bernhard
I am new in webdav. I am trying for a long time to create an appointment in
an exchange calendar (pubic folder) using webdav but without success.
I am despairing.
Here my programm:
String strCalendarURI = "http://server/public/test1";
HttpURL hrl = new HttpURL(strCalendarURI);
hrl.setUserinfo("user", "pw");
WebdavResource wdr = new WebdavResource(hrl);
wdr.setDebug(1);
Hashtable props = new Hashtable();
props.put(new PropertyName("DAV:", "contentclass"),
"urn:content-classes:appointment");
props.put(new PropertyName("DAV:", "contentclass"),
"urn:content-classes:appointment");
props.put(new PropertyName("http//schemas.microsoft.com/exchange",
"outlookmessageclass"), "IPM.Appointment");
props.put(new PropertyName("urn:schemas:httpmail","subject"), "Changed
Test Appointment Subject");
props.put(new PropertyName("urn:schemas:httpmail","htmldescription"),
"Let's meet here");
props.put(new PropertyName("urn:schemas:calendar","location"), "do");
props.put(new PropertyName("urn:schemas:calendar","dtstart"),
"2006-01-01T10:00:00.000Z");
props.put(new PropertyName("urn:schemas:calendar", "dtend"),
"2006-01-01T10:30:00.000Z");
props.put(new PropertyName("urn:schemas:calendar","instancetype"), "0");
props.put(new PropertyName("urn:schemas:calendar","alldayevent"), "0");
props.put(new PropertyName("urn:schemas:calendar","responserequested"),
"1");
props.put(new PropertyName("urn:schemas:calendar","busystatus"), "BUSY");
props.put(new PropertyName("urn:schemas:calendar","meetingstatus"),
"CONFIRMED");
props.put(new PropertyName("header", "to"), "user");
props.put(new PropertyName("urn:schemas:mapi","finvited"), "1");
out.print("returned value ... " + wdr.proppatchMethod(props, true));
The output:
PROPPATCH /public/test1 HTTP/1.1
Authorization: Basic Qi5XZWl0bGFuZXI6c3NvYg==
Content-Type: text/xml; charset=utf-8
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: server
Content-Length: 1068
<Dropertyupdate xmlns="DAV:">
<D:set>
<Drop>
<responserequested xmlns="urn:schemas:calendar">
1
</responserequested>
<dtend xmlns="urn:schemas:calendar">
2006-01-01T10:30:00.000Z
</dtend>
<meetingstatus xmlns="urn:schemas:calendar">
CONFIRMED
</meetingstatus>
<to xmlns="header">
user
</to>
<instancetype xmlns="urn:schemas:calendar">
0
</instancetype>
<outlookmessageclass xmlns="http//schemas.microsoft.com/exchange">
IPM.Appointment
</outlookmessageclass>
<location xmlns="urn:schemas:calendar">
do
</location>
<alldayevent xmlns="urn:schemas:calendar">
0
</alldayevent>
<dtstart xmlns="urn:schemas:calendar">
2006-01-01T10:00:00.000Z
</dtstart>
<htmldescription xmlns="urn:schemas:httpmail">
Let's meet here
</htmldescription>
<finvited xmlns="urn:schemas:mapi">
1
</finvited>
<D:contentclass>
urn:content-classes:appointment
</D:contentclass>
<v xmlns="urn:schemas:contacts">
1
</v>
<subject xmlns="urn:schemas:httpmail">
Changed Test Appointment Subject
</subject>
<busystatus xmlns="urn:schemas:calendar">
BUSY
</busystatus>
</Drop>
</D:set>
</Dropertyupdate>
------------------------------------------------------------------------
<<<<<<< from server ---------------------------------------------------
HTTP/1.1 207 Multistatus
Date: Wed, 25 Jan 2006 08:38:54 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
MS-Exchange-Permanent-URL:
http://server/public/-FlatUrlSpace-/ddd97380fa9bf5429d9fdc31ddb24cd9-288e4
Repl-UID: <rid:ddd97380fa9bf5429d9fdc31ddb24cd9000000000529>
Content-Type: text/xml
Content-Length: 617
ResourceTag:
<rt:ddd97380fa9bf5429d9fdc31ddb24cd9000000000529ddd97380fa9bf5429d9fdc31ddb24cd9000000000879>
MS-WebStorage: 6.5.7638
<a:multistatus
xmlns:a="DAV:"
xmlns:b="urn:schemas:calendar"
xmlns:c="header"
xmlns:d="http//schemas.microsoft.com/exchange"
xmlns:e="urn:schemas:httpmail"
xmlns:f="urn:schemas:mapi"
xmlns:g="urn:schemas:contacts">
<a:response>
<a:href>
http://server/public/test1
</a:href>
<aropstat>
<a:status>
HTTP/1.1 200 OK
</a:status>
<arop>
<b:responserequested>
</b:responserequested>
<b:dtend>
</b:dtend>
<b:meetingstatus>
</b:meetingstatus>
<c:to>
</c:to>
<b:instancetype>
</b:instancetype>
<dutlookmessageclass>
</dutlookmessageclass>
<b:location>
</b:location>
<b:alldayevent>
</b:alldayevent>
<b:dtstart>
</b:dtstart>
<e:htmldescription>
</e:htmldescription>
<f:finvited>
</f:finvited>
<a:contentclass>
</a:contentclass>
<g:v>
</g:v>
<e:subject>
</e:subject>
<b:busystatus>
</b:busystatus>
</arop>
</aropstat>
</a:response>
PROPFIND /public/test1 HTTP/1.1
Authorization: Basic Qi5XZWl0bGFuZXI6c3NvYg==
Content-Type: text/xml; charset=utf-8
User-Agent: Jakarta Commons-HttpClient/2.0final
Host: server
Content-Length: 207
Depth: 0
<Dropfind xmlns="DAV:">
<Drop>
<D:displayname>
</D:displayname>
<D:getcontentlength>
</D:getcontentlength>
<D:getcontenttype>
</D:getcontenttype>
<D:resourcetype>
</D:resourcetype>
<D:getlastmodified>
</D:getlastmodified>
<D:lockdiscovery>
</D:lockdiscovery>
</Drop>
</Dropfind>
------------------------------------------------------------------------
<<<<<<< from server ---------------------------------------------------
HTTP/1.1 207 Multistatus
Date: Wed, 25 Jan 2006 08:38:54 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Content-Type: text/xml
Accept-Ranges: rows
MS-WebStorage: 6.5.7638
Transfer-Encoding: chunked
<a:multistatus
xmlns:a="DAV:"
xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:c="xml:">
<a:response>
<a:href>
http://server/public/test1/
</a:href>
<aropstat>
<a:status>
HTTP/1.1 200 OK
</a:status>
<arop>
<a:displayname>
test1
</a:displayname>
<a:getcontentlength b:dt="int">
0
</a:getcontentlength>
<a:resourcetype>
<a:collection>
</a:collection>
</a:resourcetype>
<a:getlastmodified b:dt="dateTime.tz">
2006-01-25T08:38:54.755Z
</a:getlastmodified>
<lockdiscovery xmlns="DAV:">
</lockdiscovery>
</arop>
</aropstat>
<aropstat>
<a:status>
HTTP/1.1 404 Resource Not Found
</a:status>
<arop>
<a:getcontenttype>
</a:getcontenttype>
</arop>
</aropstat>
</a:response>
</a:multistatus>
------------------------------------------------------------------------
It looks not so bad. But no appointment is created.
Where is the problem?
When i google for the problem i always find howtos for .NET but nearly
nothing for java
Thank you for your help.
best regards
Bernhard