Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Applications / June 2006

Tip: Looking for answers? Try searching our database.

Error 400 Creating Search

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Yahya - 03 Jun 2006 15:33 GMT
Dear Sirs,

   I am trying to create a search folder using the MKCOL with the below
attached code, but when the "where" condition grows the search folder
creation produces fails producing a 400 error.

strBody = "<?xml version=""1.0""?><a:propertyupdate xmlns:a=""DAV:""
><a:set>"

strBody = strBody & "<a:prop><a:searchrequest><a:sql>"

strBody = strBody & "SELECT ""DAV:displayname"" "

strBody = strBody & " FROM Scope('shallow traversal of """ & strRootURI &
"""',"

strBody = strBody & " 'shallow traversal of """ & strRootURIConfidential &
"""')"

strBody = strBody & " WHERE ""urn:schemas:httpmail:textdescription"" like
'%*** www***%' or ""urn:schemas:httpmail:textdescription"" like '%*** qqq
***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
111***%' or ""urn:schemas:httpmail:textdescription"" like '%*** 222***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
333***%' or ""urn:schemas:httpmail:textdescription"" like '%*** 444***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
555***%' or ""urn:schemas:httpmail:textdescription"" like '%*** 666***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
777 ***%' or ""urn:schemas:httpmail:textdescription"" like '%*** 888***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
999***%' or ""urn:schemas:httpmail:textdescription"" like '%*** 000***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
eee***%' or ""urn:schemas:httpmail:textdescription"" like '%*** rrr***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
ttt***%' or ""urn:schemas:httpmail:textdescription"" like '%*** yyy***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
uuu***%' or ""urn:schemas:httpmail:textdescription"" like '%*** iii***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
ooo***%' or ""urn:schemas:httpmail:textdescription"" like '%*** ppp***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
sss***%' or ""urn:schemas:httpmail:textdescription"" like '%*** aaa***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
ddd***%' or ""urn:schemas:httpmail:textdescription"" like '%*** ggg***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
hhh***%' or ""urn:schemas:httpmail:textdescription"" like '%*** jjj***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
mmm***%' or ""urn:schemas:httpmail:textdescription"" like '%*** kkk***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
nnn***%' or ""urn:schemas:httpmail:textdescription"" like '%*** lll***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
bbb***%' or ""urn:schemas:httpmail:textdescription"" like '%*** vvv***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
xxx***%' or ""urn:schemas:httpmail:textdescription"" like '%*** ccc***%'"

strBody = strBody & " or ""urn:schemas:httpmail:textdescription"" like '%***
zzz***%' or ""urn:schemas:httpmail:textdescription"" like '%*** asd***%'"

strBody = strBody &
"</a:sql></a:searchrequest></a:prop></a:set></a:propertyupdate>"

req.open("MKCOL", strSearchFolderURI, False)

req.setRequestHeader("Content-Type", "text/xml")

req.setRequestHeader("Translate", "f")

req.setRequestHeader("Depth", "0")

req.setRequestHeader("Content-Length", "" & strBody.Length)

req.send(strBody)

Regards,
Yahya
Lee Derbyshire - 05 Jun 2006 10:40 GMT
Hard to say, without seeing the resulting strBody, but this bit seems odd (I
don't think you should have 'shallow traversal of <URI>' in there twice).
Unless you know that it is allowed?  I've never seen an example like that,
though.

strBody = strBody & " FROM Scope('shallow traversal of """ & strRootURI &
"""',"

strBody = strBody & " 'shallow traversal of """ & strRootURIConfidential &
"""')"

Lee.

Signature

___________________________________

Outlook Web Access for PDA and WAP:
www.leederbyshire.com
___________________________________

> Dear Sirs,
>
[quoted text clipped - 104 lines]
> Regards,
> Yahya
Yahya - 06 Jun 2006 15:55 GMT
Yes, it is working,
when the "where" condition is smaller the search folder is created, but when
more conditions are added to the "where" the creation fails.

Regards,
Yahya

> Hard to say, without seeing the resulting strBody, but this bit seems odd (I
> don't think you should have 'shallow traversal of <URI>' in there twice).
[quoted text clipped - 117 lines]
> > Regards,
> > Yahya
Lee Derbyshire - 06 Jun 2006 16:17 GMT
> Yes, it is working,
> when the "where" condition is smaller the search folder is created, but when
> more conditions are added to the "where" the creation fails.
>
> Regards,
> Yahya

What is the condition that you are adding?  Perhaps there are special
characters in it (like < or > or & ) that need HTML escape codes?
Yahya - 07 Jun 2006 10:45 GMT
I am using the "or" condition as shown in the attached code, when there are
about 10 variables it is working okay, when they grow to more than that an
error is produced, 400.

> > Yes, it is working,
> > when the "where" condition is smaller the search folder is created,
[quoted text clipped - 6 lines]
> What is the condition that you are adding?  Perhaps there are special
> characters in it (like < or > or & ) that need HTML escape codes?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.