exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Showing "Bad Request" when selecting particular appointment

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Applications
Author Message
Atul Saxena



Joined: 12 Oct 2007
Posts: 15

PostPosted: Fri Oct 26, 2007 5:55 am    Post subject: Showing "Bad Request" when selecting particular appointment Reply with quote

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 = "" & _
" xmlns:m='urn:schemas:mailheader:' xmlns:cal=""urn:schemas:calendar:""> " & _
"SELECT ""DAV:id"", ""DAV:getlastmodified"" " & _
"FROM Scope('SHALLOW TRAVERSAL OF """ & stURI & """')"
& _
"WHERE ""DAV:href"" = """ & strHref & """ " & _
"" & _
""


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:


- xmlns:cal="urn:schemas:calendar:">
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"


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

Archived from group: microsoft>public>exchange>applications
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Sat Oct 27, 2007 11:38 pm    Post subject: Re: Showing "Bad Request" when selecting particular appointm Reply with quote

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 @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 = "" & _
> " > xmlns:m='urn:schemas:mailheader:' xmlns:cal=""urn:schemas:calendar:""> " &
> _
> "SELECT ""DAV:id"", ""DAV:getlastmodified"" "
> & _
> "FROM Scope('SHALLOW TRAVERSAL OF """ & stURI &
> """')"
> & _
> "WHERE ""DAV:href"" = """ & strHref & """ " & _
> "" & _
> ""
>
>
> 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:
>
>
> - > xmlns:cal="urn:schemas:calendar:">
> 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"
>
>
> 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
Back to top
View user's profile Send private message
Atul Saxena



Joined: 12 Oct 2007
Posts: 15

PostPosted: Mon Oct 29, 2007 1:04 am    Post subject: Re: Showing "Bad Request" when selecting particular appointm Reply with quote

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
> @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 = "" & _
> > " > > xmlns:m='urn:schemas:mailheader:' xmlns:cal=""urn:schemas:calendar:""> " &
> > _
> > "SELECT ""DAV:id"", ""DAV:getlastmodified"" "
> > & _
> > "FROM Scope('SHALLOW TRAVERSAL OF """ & stURI &
> > """')"
> > & _
> > "WHERE ""DAV:href"" = """ & strHref & """ " & _
> > "" & _
> > ""
> >
> >
> > 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:
> >
> >
> > - > > xmlns:cal="urn:schemas:calendar:">
> > 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"
> >
> >
> > 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
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Applications All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group