Re: Error: Name cannot begin with the '0' character, hexadecimal value

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

that error is a standard XML error message - Exchange requires you to sent invalid xml to the server.

You can work around this by escaping the 0 in the front. See http://www.infinitec.de/articles/exchange/creatingwebdavrequestswithxmlreaderwriter.aspx.

If I recall it correctly, a:0x must be written <h:0x8102/> must be written as <h:_x0030_x8102>

Kind regards,
Henning

"Atul Saxena" <AtulSaxena@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D17E96F0-BC10-499D-830F-30D85996FDFF@xxxxxxxxxxxxxxxx
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'?>" & _
"<a:propfind xmlns:a='DAV:'
xmlns:m='urn:schemas:mailheader:' " & _

"xmlns:b='urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/' " & _
"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}/'> " & _
"<a:prop>" & _
"<m:subject/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<a:id/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<g:textdescription/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<h:0x00008102/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<h:0x00008104/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<h:0x00008101/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<i:0x8516/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<a:getlastmodified/>" & _
"</a:prop>" & _
"<a:prop>" & _
"<i:0x8517/>" & _
"</a:prop>" & _
"</a:propfind>"

' 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

.



Relevant Pages

  • Creating calendar entries in Exchange 5.5 programatically over the
    ... I would like to be able to send XML to an Exchange 5.5 server over the web to ... create calendar entries. ...
    (microsoft.public.exchange.applications)
  • Re: Duplicate Record with .ADDNEW
    ... If the database server will allow you to create a table without something, ... table there is no possibility of duplicate records. ... field imported from the XML. ... Use the Command object instead. ...
    (microsoft.public.vb.database.ado)
  • RE: XML iFilter needed for SPS 2003 infopath forms?
    ... did in fact need to be installed on the Sharepoint server, ... Apparently the claim that SP indexes xml files is not quite specific enough. ... It must use a default text Filter not a true xml ifilter. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: What is the logic of storing XML in a Database?
    ... customer, and likely a broker or exchange as well, which is a pretty ... data and do not have the need to use XML at all. ... Sure, it consumes extra resources. ... adopting an industry standard can prove to be simpler than making up ...
    (comp.databases.theory)
  • Re: Using Word Mail Merge feature for custom templates
    ... > You are suggesting that I store the content in XML at server end and when I ... A browser knows to open a ... WordProcessingML file in Word due to the PI Word writes into it. ...
    (microsoft.public.word.mailmerge.fields)