Solved

Cannot Read an XML file into our Database via VB.NET 2005

Posted on 2008-06-17
1
575 Views
Last Modified: 2013-12-06
I am trying to read an XML file into our database via VB.NET 2005.

I retrieve the file via a WebDAV query to exchange 2003. My XML knowledge is not the strongest and I am really struggling.

The XML is already loaded in a XmlDataDocument object and I need to read all the data from the XML file and read them into the database.

The XML file is below: -

<?xml version="1.0"?>
<a:multistatus xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:d="urn:schemas:httpmail:" xmlns:c="xml:" xmlns:e="http://schemas.microsoft.com/mapi/proptag/" xmlns:a="DAV:">
<a:response>
<a:href>http://0.0.0.0/exchange/blair/Inbox/RE:%20Developers%20Conference.EML</a:href>
<a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
<a:prop>
<d:from>mailfrom</d:from>
<d:to>mailto</d:to>
<d:datereceived b:dt="dateTime.tz">2008-06-17T13:57:21.192Z</d:datereceived>
<d:subject>RE: Developers Conference</d:subject>
<a:uid>AQEAAAAICkcJAAAAAAAAAAAAAAAA</a:uid>
<e:x10800003 b:dt="int">-1</e:x10800003>
</a:prop>
</a:propstat>
<a:propstat>
<a:status>HTTP/1.1 404 Resource Not Found</a:status>
<a:prop>
<e:x10810003 />
</a:prop>
</a:propstat>
</a:response>
<a:response>
<a:href>http://0.0.0.0/exchange/blair/Inbox/RE:-8.EML</a:href><a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
<a:prop>
<d:from>mailfrom</d:from>
<d:to>mailto</d:to>
<d:datereceived b:dt="dateTime.tz">2008-06-17T13:36:47.000Z</d:datereceived>
<d:subject>RE: </d:subject>
<a:uid>AQEAAAAICkcHAAAAAAAAAAAAAAAA</a:uid>
</a:prop>
</a:propstat>
<a:propstat>
<a:status>HTTP/1.1 404 Resource Not Found</a:status>
<a:prop>
<e:x10800003 />
<e:x10810003 />
</a:prop>
</a:propstat>
</a:response>
</a:multistatus>


0
Comment
Question by:kennethscff
1 Comment
 

Accepted Solution

by:
kennethscff earned 0 total points
ID: 21811565
Here is how it is done!          

 Dim ns As New XmlNamespaceManager(xmlDOMParams.NameTable)
            ns.AddNamespace("b", "urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/")
            ns.AddNamespace("d", "urn:schemas:httpmail:")
            ns.AddNamespace("c", "xml:")
            ns.AddNamespace("e", "http://schemas.microsoft.com/mapi/proptag/")
            ns.AddNamespace("a", "DAV:")


            For Each node As XmlNode In xmlDOMParams.SelectNodes("//a:response", ns)
                MailURLNode = node.SelectSingleNode("a:href", ns)
                MailURL = MailURLNode.InnerText
            Next

0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question