|
|
|
date: Fri, 26 Oct 2007 01:55:00 -0700,
group: microsoft.public.exchange.applications
back
Showing "Bad Request" when selecting particular appointment
I am doing following code:
Dim sQuery As String
Dim status As Integer
Dim oXMLHttp1 As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30
Try
oXMLHttp1.open("SEARCH", stURI, False, Me.UserNameAlias,
Me.Password)
sQuery = "<?xml version='1.0' encoding= 'utf-8'?>" & _
"<a:searchrequest xmlns:a='DAV:'
xmlns:m='urn:schemas:mailheader:' xmlns:cal=""urn:schemas:calendar:""> " & _
"<a:sql>SELECT ""DAV:id"", ""DAV:getlastmodified"" " & _
"FROM Scope('SHALLOW TRAVERSAL OF """ & stURI & """')"
& _
"WHERE ""DAV:href"" = """ & strHref & """ " & _
"</a:sql>" & _
"</a:searchrequest>"
oXMLHttp1.setRequestHeader("Content-Type", "text/xml")
oXMLHttp1.setRequestHeader("Brief", "t")
' Send the query.
oXMLHttp1.send(sQuery)
status = CheckStatus(oXMLHttp1.status)
If status = En.enStatus.Multi_Status Then
MsgBox(oXMLHttp1.responseText)
End If
Catch ex As Exception
Throw New Exception(ex.Message, ex.InnerException)
Finally
sQuery = Nothing
status = Nothing
End Try
The value of sQuery contains:
<?xml version="1.0" encoding="utf-8" ?>
- <a:searchrequest xmlns:a="DAV:" xmlns:m="urn:schemas:mailheader:"
xmlns:cal="urn:schemas:calendar:">
<a:sql>SELECT "DAV:id", "DAV:getlastmodified" FROM Scope('SHALLOW
TRAVERSAL OF
"http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/"')WHERE
"DAV:href" =
"http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML"</a:sql>
</a:searchrequest>
but it is giving me "Bad Request" error where as appointment is present with
href
"http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML".
Although If I remove where condition in Select clause then it shows all the
appointment including href
"http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML".
Please suggest where I am doing wrong.
Thanks & regards,
Atul Saxena
date: Fri, 26 Oct 2007 01:55:00 -0700
author: Atul Saxena
Re: Showing "Bad Request" when selecting particular appointment
Hello,
DAV:href is a constructed property, you cannot search for it.
But since you already got the URL, just do a PROPFIND request on the
address.
Kind regards,
Henning Krause
"Atul Saxena" wrote in message
news:7E732066-233A-4DCA-A144-6FDD8478A532@microsoft.com...
>I am doing following code:
>
> Dim sQuery As String
> Dim status As Integer
> Dim oXMLHttp1 As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30
> Try
>
> oXMLHttp1.open("SEARCH", stURI, False, Me.UserNameAlias,
> Me.Password)
>
> sQuery = "<?xml version='1.0' encoding= 'utf-8'?>" & _
> "<a:searchrequest xmlns:a='DAV:'
> xmlns:m='urn:schemas:mailheader:' xmlns:cal=""urn:schemas:calendar:""> " &
> _
> "<a:sql>SELECT ""DAV:id"", ""DAV:getlastmodified"" "
> & _
> "FROM Scope('SHALLOW TRAVERSAL OF """ & stURI &
> """')"
> & _
> "WHERE ""DAV:href"" = """ & strHref & """ " & _
> "</a:sql>" & _
> "</a:searchrequest>"
>
>
> oXMLHttp1.setRequestHeader("Content-Type", "text/xml")
> oXMLHttp1.setRequestHeader("Brief", "t")
> ' Send the query.
> oXMLHttp1.send(sQuery)
>
> status = CheckStatus(oXMLHttp1.status)
> If status = En.enStatus.Multi_Status Then
> MsgBox(oXMLHttp1.responseText)
> End If
>
> Catch ex As Exception
> Throw New Exception(ex.Message, ex.InnerException)
> Finally
> sQuery = Nothing
> status = Nothing
> End Try
>
> The value of sQuery contains:
>
> <?xml version="1.0" encoding="utf-8" ?>
> - <a:searchrequest xmlns:a="DAV:" xmlns:m="urn:schemas:mailheader:"
> xmlns:cal="urn:schemas:calendar:">
> <a:sql>SELECT "DAV:id", "DAV:getlastmodified" FROM Scope('SHALLOW
> TRAVERSAL OF
> "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/"')WHERE
> "DAV:href" =
> "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML"</a:sql>
> </a:searchrequest>
>
> but it is giving me "Bad Request" error where as appointment is present
> with
> href
> "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML".
>
> Although If I remove where condition in Select clause then it shows all
> the
> appointment including href
> "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML".
>
> Please suggest where I am doing wrong.
>
> Thanks & regards,
>
> Atul Saxena
date: Sat, 27 Oct 2007 19:38:03 +0200
author: Henning Krause [MVP - Exchange]
Re: Showing "Bad Request" when selecting particular appointment
Thanks Henning, You are right, it is working fine with PROPFIND.
Thanks & regards,
Atul Saxena
"Henning Krause [MVP - Exchange]" wrote:
> Hello,
>
> DAV:href is a constructed property, you cannot search for it.
>
> But since you already got the URL, just do a PROPFIND request on the
> address.
>
> Kind regards,
> Henning Krause
>
> "Atul Saxena" wrote in message
> news:7E732066-233A-4DCA-A144-6FDD8478A532@microsoft.com...
> >I am doing following code:
> >
> > Dim sQuery As String
> > Dim status As Integer
> > Dim oXMLHttp1 As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30
> > Try
> >
> > oXMLHttp1.open("SEARCH", stURI, False, Me.UserNameAlias,
> > Me.Password)
> >
> > sQuery = "<?xml version='1.0' encoding= 'utf-8'?>" & _
> > "<a:searchrequest xmlns:a='DAV:'
> > xmlns:m='urn:schemas:mailheader:' xmlns:cal=""urn:schemas:calendar:""> " &
> > _
> > "<a:sql>SELECT ""DAV:id"", ""DAV:getlastmodified"" "
> > & _
> > "FROM Scope('SHALLOW TRAVERSAL OF """ & stURI &
> > """')"
> > & _
> > "WHERE ""DAV:href"" = """ & strHref & """ " & _
> > "</a:sql>" & _
> > "</a:searchrequest>"
> >
> >
> > oXMLHttp1.setRequestHeader("Content-Type", "text/xml")
> > oXMLHttp1.setRequestHeader("Brief", "t")
> > ' Send the query.
> > oXMLHttp1.send(sQuery)
> >
> > status = CheckStatus(oXMLHttp1.status)
> > If status = En.enStatus.Multi_Status Then
> > MsgBox(oXMLHttp1.responseText)
> > End If
> >
> > Catch ex As Exception
> > Throw New Exception(ex.Message, ex.InnerException)
> > Finally
> > sQuery = Nothing
> > status = Nothing
> > End Try
> >
> > The value of sQuery contains:
> >
> > <?xml version="1.0" encoding="utf-8" ?>
> > - <a:searchrequest xmlns:a="DAV:" xmlns:m="urn:schemas:mailheader:"
> > xmlns:cal="urn:schemas:calendar:">
> > <a:sql>SELECT "DAV:id", "DAV:getlastmodified" FROM Scope('SHALLOW
> > TRAVERSAL OF
> > "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/"')WHERE
> > "DAV:href" =
> > "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML"</a:sql>
> > </a:searchrequest>
> >
> > but it is giving me "Bad Request" error where as appointment is present
> > with
> > href
> > "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML".
> >
> > Although If I remove where condition in Select clause then it shows all
> > the
> > appointment including href
> > "http://192.168.111.10/Exchange/ccrindiaadmin@ccrindia.com/Calendar/No%20Appointment.EML".
> >
> > Please suggest where I am doing wrong.
> >
> > Thanks & regards,
> >
> > Atul Saxena
>
>
date: Sun, 28 Oct 2007 21:04:00 -0700
author: Atul Saxena
|
|