Solved

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

Posted on 2008-06-17
1
572 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now