Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to generate a request Query string

Status
Not open for further replies.

MattDawg

Programmer
Jul 10, 2006
2
US
I am new to XML and I am creating a webDav program which requires a query XML to search through the directory listings but I don't know how to build it. I found an example that looks like this

sQuery += "<?xml version='1.0'?><D:propfind xmlns:D='DAV:' ";

sQuery += "xmlns:h=' ";

sQuery += "xmlns:hm='urn:schemas:httpmail:'><D:prop><h:adbar/>";

sQuery += "<hm:contacts/><hm:inbox/><hm:eek:utbox/><hm:sendmsg/>";

sQuery += "<hm:sentitems/><hm:deleteditems/><hm:drafts/>";

sQuery += "<hm:msgfolderroot/><h:maxpoll/><h:sig/></D:prop></D:propfind>";

This is to traverse a Exchange server WebDav folder but I just want to traverse a normal WebDav folder. I am writing the code in C++. I wrote a program to genereate what the XML file will look like and this is what I need

<?xml version="1.0" ?>
- <a:multistatus xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:c="xml:" xmlns:a="DAV:">
- <a:response>
<a:href>- <a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
- <a:prop>
<a:getcontentlength b:dt="int">0</a:getcontentlength>
<a:creationdate b:dt="dateTime.tz">2006-07-06T17:26:02.088Z</a:creationdate>
<a:displayname>WebDav</a:displayname>
<a:getetag>"85d2a15343a4c61:31c"</a:getetag>
<a:getlastmodified b:dt="dateTime.rfc1123">Mon, 10 Jul 2006 17:07:29 GMT</a:getlastmodified>
- <a:resourcetype>
<a:collection />
</a:resourcetype>
<a:supportedlock />
<a:ishidden b:dt="boolean">0</a:ishidden>
<a:iscollection b:dt="boolean">1</a:iscollection>
<a:getcontenttype />
</a:prop>
</a:propstat>
</a:response>
- <a:response xmlns:d="urn:schemas-microsoft-com:">
<a:href>- <a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
- <a:prop>
<d:Win32CreationTime>Fri, 30 Jun 2006 16:55:12 GMT</d:Win32CreationTime>
<d:Win32LastAccessTime>Thu, 06 Jul 2006 17:28:01 GMT</d:Win32LastAccessTime>
<d:Win32LastModifiedTime>Thu, 06 Jul 2006 17:28:01 GMT</d:Win32LastModifiedTime>
<d:Win32FileAttributes>00000020</d:Win32FileAttributes>
<a:getcontentlength b:dt="int">2427</a:getcontentlength>
<a:creationdate b:dt="dateTime.tz">2006-07-06T17:27:25.292Z</a:creationdate>
<a:displayname>Notes.txt</a:displayname>
<a:getetag>"5b2777221a1c61:31c"</a:getetag>
<a:getlastmodified b:dt="dateTime.rfc1123">Thu, 06 Jul 2006 17:27:25 GMT</a:getlastmodified>
<a:resourcetype />
- <a:supportedlock>
- <a:lockentry>
<a:write />
<a:shared />
</a:lockentry>
- <a:lockentry>
<a:write />
<a:exclusive />
</a:lockentry>
</a:supportedlock>
<a:ishidden b:dt="boolean">0</a:ishidden>
<a:iscollection b:dt="boolean">0</a:iscollection>
<a:getcontenttype />
</a:prop>
</a:propstat>
</a:response>
</a:multistatus>

I hope this is easy becase I really don't know what I am doing for this so any help or explination would be great. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top