A
Atul Saxena
Dear All,
I am working exchange server & fetching task of outlook 2007
through MSXML2.XMLHTTP30 now I am facing the following error
"Name cannot begin with the '0' character, hexadecimal value
0x30. Line 1, position 564" while reading XML. Please help me to
solve this problem. I am also mentioning the code below:
Private Function ReadTask(ByVal stURI As System.String)
Dim sQuery As String
Dim status As Integer
Try
' Open the item.
oXMLHttp.open("PROPFIND", stURI, False,
Me.UserNameAlias, Me.Password)
' Set up the query to get subject, from, and to.
sQuery = "<?xml version='1.0' encoding = 'utf-8'?>" &
_
"<aropfind xmlns:a='DAV:'
xmlns:m='urn:schemas:mailheader:' " & _
"xmlns:b='urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c 14882/' " & _
"xmlns:g='urn:schemas:httpmail:' " & _
"xmlns:i='http://schemas.microsoft.com/mapi/id/" & _
"{00062008-0000-0000-C000-000000000046}/' " &
_
"xmlns:h='http://schemas.microsoft.com/mapi/id/" & _
"{00062003-0000-0000-C000-000000000046}/'> "
& _
"<arop>" & _
"<m:subject/>" & _
"</arop>" & _
"<arop>" & _
"<g:textdescription/>" & _
"</arop>" & _
"<arop>" & _
"<h:0x00008102/>" & _
"</arop>" & _
"<arop>" & _
"<h:0x00008104/>" & _
"</arop>" & _
"<arop>" & _
"<h:0x00008101/>" & _
"</arop>" & _
"<arop>" & _
"<i:0x8516/>" & _
"</arop>" & _
"<arop>" & _
"<i:0x8517/>" & _
"</arop>" & _
"</aropfind>"
' Set up request headers.
oXMLHttp.setRequestHeader("Content-Type", "text/xml")
' oXMLHttp.setRequestHeader("Brief", "t")
' Send the query.
oXMLHttp.send(sQuery)
status = CheckStatus(oXMLHttp.status)
If status = En.enStatus.Multi_Status Then
Call ParseTaskXML(oXMLHttp.responseText)
End If
Catch ex As Exception
Throw New Exception(ex.Message, ex.InnerException)
Finally
sQuery = Nothing
status = Nothing
End Try
End Function
Private Function ParseTaskXML(ByVal responseText As
System.String)
Dim reader As New XmlNodeReader(xmlDoc)
Try
xmlDoc.LoadXml(responseText)
While reader.Read()
If reader.Name.ToLower() = "d:subject" Then
strSubject = reader.ReadInnerXml()
End If
If reader.Name.ToLower() = "e:textdescription"
Then
Me.strDescription = reader.ReadInnerXml
End If
If reader.Name.ToLower() = "f:0x00008102" Then
Me.dbTasksCompletedPercent reader.ReadInnerXml()
End If
If reader.Name.ToLower() = "g:0x8516" Then
Me.dtTasksStartDate = reader.ReadInnerXml
End If
If reader.Name.ToLower() = "g:0x8517" Then
Me.dtTasksDueDate = reader.ReadInnerXml()
End If
If reader.Name.ToLower() = "f:0x00008101" Then
' reader.ReadInnerXml
End If
End While
Catch ex As Exception
Throw New Exception(ex.Message, ex.InnerException)
Finally
reader = Nothing
End Try
End Function
I am working exchange server & fetching task of outlook 2007
through MSXML2.XMLHTTP30 now I am facing the following error
"Name cannot begin with the '0' character, hexadecimal value
0x30. Line 1, position 564" while reading XML. Please help me to
solve this problem. I am also mentioning the code below:
Private Function ReadTask(ByVal stURI As System.String)
Dim sQuery As String
Dim status As Integer
Try
' Open the item.
oXMLHttp.open("PROPFIND", stURI, False,
Me.UserNameAlias, Me.Password)
' Set up the query to get subject, from, and to.
sQuery = "<?xml version='1.0' encoding = 'utf-8'?>" &
_
"<aropfind xmlns:a='DAV:'
xmlns:m='urn:schemas:mailheader:' " & _
"xmlns:b='urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c 14882/' " & _
"xmlns:g='urn:schemas:httpmail:' " & _
"xmlns:i='http://schemas.microsoft.com/mapi/id/" & _
"{00062008-0000-0000-C000-000000000046}/' " &
_
"xmlns:h='http://schemas.microsoft.com/mapi/id/" & _
"{00062003-0000-0000-C000-000000000046}/'> "
& _
"<arop>" & _
"<m:subject/>" & _
"</arop>" & _
"<arop>" & _
"<g:textdescription/>" & _
"</arop>" & _
"<arop>" & _
"<h:0x00008102/>" & _
"</arop>" & _
"<arop>" & _
"<h:0x00008104/>" & _
"</arop>" & _
"<arop>" & _
"<h:0x00008101/>" & _
"</arop>" & _
"<arop>" & _
"<i:0x8516/>" & _
"</arop>" & _
"<arop>" & _
"<i:0x8517/>" & _
"</arop>" & _
"</aropfind>"
' Set up request headers.
oXMLHttp.setRequestHeader("Content-Type", "text/xml")
' oXMLHttp.setRequestHeader("Brief", "t")
' Send the query.
oXMLHttp.send(sQuery)
status = CheckStatus(oXMLHttp.status)
If status = En.enStatus.Multi_Status Then
Call ParseTaskXML(oXMLHttp.responseText)
End If
Catch ex As Exception
Throw New Exception(ex.Message, ex.InnerException)
Finally
sQuery = Nothing
status = Nothing
End Try
End Function
Private Function ParseTaskXML(ByVal responseText As
System.String)
Dim reader As New XmlNodeReader(xmlDoc)
Try
xmlDoc.LoadXml(responseText)
While reader.Read()
If reader.Name.ToLower() = "d:subject" Then
strSubject = reader.ReadInnerXml()
End If
If reader.Name.ToLower() = "e:textdescription"
Then
Me.strDescription = reader.ReadInnerXml
End If
If reader.Name.ToLower() = "f:0x00008102" Then
Me.dbTasksCompletedPercent reader.ReadInnerXml()
End If
If reader.Name.ToLower() = "g:0x8516" Then
Me.dtTasksStartDate = reader.ReadInnerXml
End If
If reader.Name.ToLower() = "g:0x8517" Then
Me.dtTasksDueDate = reader.ReadInnerXml()
End If
If reader.Name.ToLower() = "f:0x00008101" Then
' reader.ReadInnerXml
End If
End While
Catch ex As Exception
Throw New Exception(ex.Message, ex.InnerException)
Finally
reader = Nothing
End Try
End Function