Decoding XML response in VB .NET

The following is the SOAP response from my customer 's intranet based web 
service. From my VB app I call:
Response = getOrdersForDateRange(94, #8/28/2007#, #8/29/2007#) and this is 
what comes back:
<soapenv:Envelope>
<soapenv:Body 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<getOrdersForDateRangeResponse>
    <FilteredOrders href="#id0"/>
</getOrdersForDateRangeResponse>

<multiRef id="id0" soapenc:root="0" 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="ns1829687187:FormatBFilter">
	<ns1829687187:filterId xsi:type="xsd:int">94</ns1829687187:filterId>
	<ns1829687187:Orders href="#id5"/>
</multiRef>

<multiRef id="id5" soapenc:root="0" 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="ns1829687187:FormatBOrder">
	<ns1829687187:orderNum xsi:type="xsd:string">097294</ns1829687187:orderNum>
	<ns1829687187:buildDate 
xsi:type="xsd:dateTime">2007-07-10T23:00:00.000Z</ns1829687187:buildDate>
	<ns1829687187:buildSeq xsi:type="xsd:long">179</ns1829687187:buildSeq>
	<ns1829687187:vehicleLine 
xsi:type="xsd:string">TLS</ns1829687187:vehicleLine>
	<ns1829687187:offlineDate xsi:type="xsd:dateTime" xsi:nil="true"/>
	<ns1829687187:Part href="#id910"/>
	<ns1829687187:Part href="#id911"/>
</multiRef>

<multiRef id="id910" soapenc:root="0" 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="ns1829687187:FormatBPart">
	<ns1829687187:prefix xsi:type="xsd:string">XH42</ns1829687187:prefix>
	<ns1829687187:base xsi:type="xsd:string">017B22</ns1829687187:base>
	<ns1829687187:suffix xsi:type="xsd:string">AA</ns1829687187:suffix>
	<ns1829687187:partDesc xsi:type="xsd:string">SHLD VEH IDENT 
LBL</ns1829687187:partDesc>
	<ns1829687187:freeTextField xsi:type="xsd:string">VIN STAMP CLEAR 
COVER</ns1829687187:freeTextField>
	<ns1829687187:qty xsi:type="xsd:double">1.0</ns1829687187:qty>
	<ns1829687187:supplier xsi:type="xsd:string">L7MTA</ns1829687187:supplier>
	<ns1829687187:lineFeedLoc1 xsi:type="xsd:string" xsi:nil="true"/>
	<ns1829687187:lineFeedLoc2 xsi:type="xsd:string" xsi:nil="true"/>
	<ns1829687187:lineFeedLoc3 xsi:type="xsd:string" xsi:nil="true"/>
	<ns1829687187:lineFeedLoc4 xsi:type="xsd:string" xsi:nil="true"/>
</multiRef>
<multiRef id="id911" soapenc:root="0" 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="ns1829687187:FormatBPart">
	<ns1829687187:prefix xsi:type="xsd:string">XB42</ns1829687187:prefix>
	<ns1829687187:base xsi:type="xsd:string">16G847</ns1829687187:base>
	<ns1829687187:suffix xsi:type="xsd:string">BA</ns1829687187:suffix>
	<ns1829687187:partDesc xsi:type="xsd:string">SHLD VEH IDENT 
LBL</ns1829687187:partDesc>
	<ns1829687187:freeTextField xsi:type="xsd:string">VIN STAMP CLEAR 
COVER</ns1829687187:freeTextField>
	<ns1829687187:qty xsi:type="xsd:double">1.0</ns1829687187:qty>
	<ns1829687187:supplier xsi:type="xsd:string">L7MTA</ns1829687187:supplier>
	<ns1829687187:lineFeedLoc1 xsi:type="xsd:string" xsi:nil="true"/>
	<ns1829687187:lineFeedLoc2 xsi:type="xsd:string" xsi:nil="true"/>
	<ns1829687187:lineFeedLoc3 xsi:type="xsd:string" xsi:nil="true"/>
	<ns1829687187:lineFeedLoc4 xsi:type="xsd:string" xsi:nil="true"/>
</multiRef>

</soapenv:Body>
</soapenv:Envelope>

What is the best way to decode this data for entry onto a database?
Any help much appreciated.

Jonathan Attree
0
8/28/2007 2:40:00 PM
dotnet.xml 7266 articles. 0 followers. Follow

5 Replies
649 Views

Similar Articles

[PageSpeed] 53

"Jonathan Attree" <JonathanAttree@discussions.microsoft.com> wrote in 
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA@microsoft.com...
> The following is the SOAP response from my customer 's intranet based web
> service. From my VB app I call:
> Response = getOrdersForDateRange(94, #8/28/2007#, #8/29/2007#) and this is
> what comes back:
> <soapenv:Envelope>
> <soapenv:Body
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>
> <getOrdersForDateRangeResponse>
>    <FilteredOrders href="#id0"/>
> </getOrdersForDateRangeResponse>
>
> <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns1829687187:FormatBFilter">
> <ns1829687187:filterId xsi:type="xsd:int">94</ns1829687187:filterId>
> <ns1829687187:Orders href="#id5"/>
> </multiRef>


Jonathan, did you try creating proxy classes using Add Web Reference? That 
way, the proxy classes would take care of any deserializing, and you'd have 
nice objects to use in your code (and to persist to your database).
-- 
John Saunders [MVP]

0
John
8/28/2007 2:46:45 PM

"John Saunders [MVP]" wrote:

> "Jonathan Attree" <JonathanAttree@discussions.microsoft.com> wrote in 
> message news:58DC8A04-1107-4DC1-9734-2F90602CABBA@microsoft.com...
> > The following is the SOAP response from my customer 's intranet based web
> > service. From my VB app I call:
> > Response = getOrdersForDateRange(94, #8/28/2007#, #8/29/2007#) and this is
> > what comes back:
> > <soapenv:Envelope>
> > <soapenv:Body
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> >
> > <getOrdersForDateRangeResponse>
> >    <FilteredOrders href="#id0"/>
> > </getOrdersForDateRangeResponse>
> >
> > <multiRef id="id0" soapenc:root="0"
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xsi:type="ns1829687187:FormatBFilter">
> > <ns1829687187:filterId xsi:type="xsd:int">94</ns1829687187:filterId>
> > <ns1829687187:Orders href="#id5"/>
> > </multiRef>
> 
> 
> Jonathan, did you try creating proxy classes using Add Web Reference? That 
> way, the proxy classes would take care of any deserializing, and you'd have 
> nice objects to use in your code (and to persist to your database).
> -- 
> John Saunders [MVP]
> 
> 

Hi John
Thanks for the reply.
I've done a few 'Walkthroughs' from Help etc so know how the Add Web 
Reference thing works.
My problem is that the web service is on my customers intranet so I can't 
access it from my development machine so I can't create a web reference to 
access its objects. All I do have is the .wsdl and .xsd files. Can I find out 
what objects are returned from these?

Jonathan Attree


0
8/28/2007 3:32:07 PM
"Jonathan Attree" <JonathanAttree@discussions.microsoft.com> wrote in 
message news:DAB58928-B3EE-4154-83C7-1FB2F2B1676F@microsoft.com...
>
>
> "John Saunders [MVP]" wrote:
>
>> "Jonathan Attree" <JonathanAttree@discussions.microsoft.com> wrote in
>> message news:58DC8A04-1107-4DC1-9734-2F90602CABBA@microsoft.com...
>> > The following is the SOAP response from my customer 's intranet based 
>> > web
>> > service. From my VB app I call:
>> > Response = getOrdersForDateRange(94, #8/28/2007#, #8/29/2007#) and this 
>> > is
>> > what comes back:
>> > <soapenv:Envelope>
>> > <soapenv:Body
>> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>> >
>> > <getOrdersForDateRangeResponse>
>> >    <FilteredOrders href="#id0"/>
>> > </getOrdersForDateRangeResponse>
>> >
>> > <multiRef id="id0" soapenc:root="0"
>> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> > xsi:type="ns1829687187:FormatBFilter">
>> > <ns1829687187:filterId xsi:type="xsd:int">94</ns1829687187:filterId>
>> > <ns1829687187:Orders href="#id5"/>
>> > </multiRef>
>>
>>
>> Jonathan, did you try creating proxy classes using Add Web Reference? 
>> That
>> way, the proxy classes would take care of any deserializing, and you'd 
>> have
>> nice objects to use in your code (and to persist to your database).
>> -- 
>> John Saunders [MVP]
>>
>>
>
> Hi John
> Thanks for the reply.
> I've done a few 'Walkthroughs' from Help etc so know how the Add Web
> Reference thing works.
> My problem is that the web service is on my customers intranet so I can't
> access it from my development machine so I can't create a web reference to
> access its objects. All I do have is the .wsdl and .xsd files. Can I find 
> out
> what objects are returned from these?

In the Add Web Reference dialog, simply point to the .WSDL file. You don't 
need the actual service. In fact, all the actual service does it return the 
WSDL and schemas.
-- 
John Saunders [MVP]

0
John
8/28/2007 3:36:32 PM
> >> Jonathan, did you try creating proxy classes using Add Web Reference? 
> >> That
> >> way, the proxy classes would take care of any deserializing, and you'd 
> >> have
> >> nice objects to use in your code (and to persist to your database).
> >> -- 
> >> John Saunders [MVP]
> >>
> >>
> >
> > Hi John
> > Thanks for the reply.
> > I've done a few 'Walkthroughs' from Help etc so know how the Add Web
> > Reference thing works.
> > My problem is that the web service is on my customers intranet so I can't
> > access it from my development machine so I can't create a web reference to
> > access its objects. All I do have is the .wsdl and .xsd files. Can I find 
> > out
> > what objects are returned from these?
> 
> In the Add Web Reference dialog, simply point to the .WSDL file. You don't 
> need the actual service. In fact, all the actual service does it return the 
> WSDL and schemas.
> -- 
> John Saunders [MVP]
> 
> 
Thanks again.
That was the first thing I tried and it added the web reference fine but I 
still can't access the service's methods. The service name is 'obom' and when 
I type:
Dim ws As New obom.Service
it says 'Type obom.Service is not defined'

Jonathan Attree
0
8/28/2007 4:00:04 PM
"Jonathan Attree" <JonathanAttree@discussions.microsoft.com> wrote in 
message news:AD5C3D32-3DD8-4EE3-B0D8-C11C88E7667F@microsoft.com...
>> >> Jonathan, did you try creating proxy classes using Add Web Reference?
>> >> That
>> >> way, the proxy classes would take care of any deserializing, and you'd
>> >> have
>> >> nice objects to use in your code (and to persist to your database).
>> >> -- 
>> >> John Saunders [MVP]
>> >>
>> >>
>> >
>> > Hi John
>> > Thanks for the reply.
>> > I've done a few 'Walkthroughs' from Help etc so know how the Add Web
>> > Reference thing works.
>> > My problem is that the web service is on my customers intranet so I 
>> > can't
>> > access it from my development machine so I can't create a web reference 
>> > to
>> > access its objects. All I do have is the .wsdl and .xsd files. Can I 
>> > find
>> > out
>> > what objects are returned from these?
>>
>> In the Add Web Reference dialog, simply point to the .WSDL file. You 
>> don't
>> need the actual service. In fact, all the actual service does it return 
>> the
>> WSDL and schemas.
>> -- 
>> John Saunders [MVP]
>>
>>
> Thanks again.
> That was the first thing I tried and it added the web reference fine but I
> still can't access the service's methods. The service name is 'obom' and 
> when
> I type:
> Dim ws As New obom.Service
> it says 'Type obom.Service is not defined'

This class is usually in a namespace with the same name as the web service 
host. So, for instance, if you called the host "services", you should look 
for services.obom.Service.
-- 
John Saunders [MVP]

0
John
8/28/2007 8:13:35 PM
Reply:

Similar Artilces:

COFF Format & Visual .NET Studio
Is there any mechanism for setting up COFF Format in Win32 Applications created in Visual .NET Studio? I am getting a crash in my application, however, not being able to see a stack trace of any kind in Dr. Watson is not allowing me to get any valid information of where the crash is occurring and how I might fix it. Any help would be appreciated. Thanks Paul ...

.net framework in xp sp2
does .net framework included in win xp sp2? Farhan Farhan wrote: > does .net framework included in win xp sp2? > > > Farhan > > I have SP3 and no .NET *anything* is installed on that computer. So the answer is no. -- C Yes, .NET Framework 1.0 and usually .NET Framework 1.1 SP1. How to determine which versions of the .NET Framework are installed and whether service packs have been applied http://msdn.microsoft.com/en-us/kb/kb00318785.aspx Note: Extended Support for WinXP SP2 ends on 10 July 2010. After that date, computers running ...

XML excel file
Hello!!! I need to insert an image file in this XML Excel file. How can I do it? <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Last...

Importing ADO Persisted XML into Excel 2002
Is it possible to take a ADO.Recordset, which is persisted to XML and import that into Excel 2002 ? I'm using VB/VBA/VBS. I can find a range on a worksheet, and export it to MSPersist format pretty easy, so I assume the reverse can be done ? If so, does anyone have any sample code ? gadrin7@aol.com wrote: > Is it possible to take a ADO.Recordset, which is persisted to XML and > import that into Excel 2002 ? You should be able to just open it in Excel, it should render it somehow. You could re-open the recordset using ADO in VBA code then use Excel's CopyFromRecordset metho...

VS 2003 .net application crashes in AFX_MANAGE_STATE
I have an application that was originally created using VS 6.0. I converted it (and all the associated .dll projects) to VS 2003 .NET. I finally managed to build everything successfully. But now when I run the .exe, my program crashes in the first AFX_MANAGE_STATE(AfxGetStaticModuleState()) call. The .exe is an MFC app. It calls: an MFC shared DLL (COM server with no exported functions) which calls: another MFC shared DLL via an exported function with the AFX_MANAGE_STATE as first line in function code. The last entry in the call stack is a call to CThreadSlotData::GetThreadValue(in...

AAC/M4A VB Tag Decoder Source Code ??
Does anybody have source code that can read AAC/M4A audio files in order to extract the tags? I'm working in VB 6.0. "David Kaye" <sfdavidkaye2@yahoo.com> wrote in message news:i089v8$qrf$3@news.eternal-september.org... : Does anybody have source code that can read AAC/M4A audio files in order to : extract the tags? I'm working in VB 6.0. I just Googled it. Losts of example there. Any reason you couldn't try that first? -- Customer Hatred Knows No Bounds at MSFT Free usenet access at http://www.eternal-september.org ClassicVB Users ...

VB and graphs
Hi, I have a scatter graph with 5 different series., I want to add check boxes to select which of the five series a user want to see in the graph. To explain better, I want the user to choose the 5 or any o the series he/she wants to see plotted on the graph. Is that possible? What code should I use? -- asdf Excel 2007 X Y scatter chart Select visible series http://c0718892.cdn.cloudfiles.rackspacecloud.com/03_04_10a.xlsm ...

decoder error
Get message "decoder error- the video decoder has either malfunctioned or is not installed. Please restart Medic Center or the computer". There are no numbers with the message. Have xp IE8 and noticed possible after last update that has something to do with video that I cannot watch tv or can't recorde a program from tv. Not sure when happened. Other computer on same network in house did same update and does record and play Window Medic Center ok. On Mon, 4 Jan 2010 17:39:01 -0800, Nina Marie <NinaMarie@discussions.microsoft.com> wrote: >Get message ...

altering XML on sql server and getting information on them
Hello there I have an sql process which getting XML from one source or more. IT should get the XML and its attributes, nodes, ect and alter it to a diffrerent xml for example declare @XM xml set @xml = (select Product_id, product_name from products for xml auto) the result shoud be: <Products total="30"> <Product Product_ID="1" ... /> <Product Product_ID="2" ... /> </Products> in essuming i don't know the structure first how can i know what is the name of the node, its attributes? On Sun, 20...

Outlook 2003 unable to decode some attachments
I have an install of Outlook that is unable to decode attachments from two sources. Al that is displayed is the encoded text. The mail comes into our mail server and hits a mailing list from which it is distributed. In this case there are three recipients. Two of the recipients get the attachment one doesn't. In each case the Outlook settings appear identical. The attachment is a Word document. At this point I'm a bit lost as most options seem to be encoding on outgoing mail. I haven't approached the sender to check their settings and all but this one Outlook inst...

Creating XML Element
I'm trying to create Element as following name MyElement:InitialName XmlElement elem = doc.CreateElement("MyElement:InitialName"); when generate the XML the tag is truncated as ONLY "MyElement",why? Any Suggestions Raed Sawalha wrote: > I'm trying to create Element as following name > > MyElement:InitialName > > XmlElement elem = doc.CreateElement("MyElement:InitialName"); > > when generate the XML the tag is truncated as ONLY "MyElement",why? A name with a colon is a qualified name where the part before the co...

XML syntax coloring
Hi. I would like to ask If somebody don't have any small sample to coloring XML syntax, e.g. in RichTextBox. It can be in VB.NET or C#. I watched on SharpDevelop, but I could not understand that code, which is coloring text. Thanks. ...

receiving same response repeatedly from meeting invitee
We are using Outlook 2003, SP3, part of Exhchange, Small Bus Ed 2003. I sent an updated notice of a meeting to all, and I keep receiving one invitee's e-mail response over and over again. His response was "tentative", but in the tracking of the meeting, he was listed as "no response". This has never occurred before. He initially responded from his I-phone. So far, I've received about 10 responses, ranging from every 1-2 minutes to every 8-10 minutes. How can I stop this loop so I don't receive any more? ...

XML document and XML schema
Greetings, We have a requirement to utilize some sort of data storage, and XML strikes as being as viable a technology as the next one. I have started by using the XMLSchema designer to cook up a minimal schema to get us started. Now I'd like to take that schema and start a new XML document based upon the schema. I'm somewhat of a newbie to XML when it comes to this, so I may not even be utilizing it correctly, so please bear with me. Is this a valid operation to do in the .NET framework? If not, how might we generate an XML document based upon the XML schema we cooked up? Thanks...

Mailbox Limits and Exchange Response
First Question: I had two users today who were over their quota. Both claimed to have done all of the necessary cleanup, including emptying the Deleted Items folder, but still had to wait several hours before they could send mail again. Is this likely? Does Exchange respond immediately to deleting and emptying the Deleted Items folder, or does it have to wait for a process to run? Second question: Would there ever be a situation where a user needs a quota increase to even be able to perform a clean-up? Third question (and last, I promise!): Related to item one. Let's say you h...

Campaign Responses #2
Hi, Using CRM 4 and starting to run campaigns. Have done a test one to make sure we know what we are doing and all works well. I want to and have put an unsubscribe link in the email campaign and then I have clicked that link when the email was recieved to unsubscribe. This then creates an email to the sender as I am sure you are all aware. Anyway to the point the email is recieved by the sender and the the user has to associate it to an account/lead/contact whatever and then change the preffered contact methods/disqualify leads. We dont have the email link installed, everything goes ...

XML XSL PDF
Hi Can someone give me some general "where to start looking" advice please. I AM : a dot net developer, good knowledge of xml / xsl transformation into html. I WANT : To produce PDF docs from xml feeds. Large numbers of files and some very large. Questions: I have heard of XSL-FO but know little about it. I have no idea how to convert from XSL-FO to PDF. Are there microsoft / .net / even script ways to do this easily? Do i need a component? Any recommendations (open source freeware preferable but good recommendations mean more than the money) Please help .. even if where t...

How do I decode a paper?
I hit something and now my paper is all squares and symbols. Sounds like it is totally corrupt. What were you doing at the time and where were you saving the document? -- Terry Farrell - MSWord MVP "Janet H" <Janet H@discussions.microsoft.com> wrote in message news:C016ADAC-299E-44DA-A498-E6970A915741@microsoft.com... > I hit something and now my paper is all squares and symbols. ...

Newbie Question : How do i add Elements into a existing XML File ?
Hi NG I got one XML File like this: <Known> <Item>Some Text 1</Item> <Item>Some Text 2</Item> <Item>Some Text 3</Item> </Known> Now i would like to add a Element <Item> with the Value 'Some Text 4' How can i add this Element without tuching the existing Elements ? Thanks for one Example regards Peter Peter Treier wrote: > <Known> > <Item>Some Text 1</Item> > <Item>Some Text 2</Item> > <Item>Some Text 3</Item> > </Known> > > Now i...

XML Serialization and custom collections
I am getting XML from a dataset that has been populated via a storedprocedure no schemas have been applied nor any relationships. But the correct table names have been given to match the table(s) equivalent business object(s). I have a custom collection that implements ICollection and IEnumerable. Here is the collection: Imports ERP.BusinessObjects Imports ERP.BusinessObjects.Helpdesk Imports ICTObjects.Collections Imports System.Xml.Serialization Namespace Collections <Serializable()> _ Public Class BusinessObjectCollection : Implements ICollection, IEnumerable ...

XML in Excel
I work with a website that accepts properly formatted XML documents to do the transactions that I need to do everyday. I was trying to find a way to make these XML documents in Excel because they are quite extensive and all of the data that I use to make the documents is stored in a bunch of Excel documents that I use to make calculations. I tried making a small XML transaction in notepad and then opening it up in Excel and excel opened it up nicely, but then I tried saving it from excel as an XML document and it seriously screwed it up putting all of my data in string tags and adding hundr...

How do I decode ASCII85 to simple binary?
...

Having trouble getting FOR XML AUTO to send to client side script in ASP.Net
I am using SQLXML3 to return me XML formatted result. All the attributes are double quoted. When I try to response.write it as an XML data island to the client side like nothing comes over to the client. Sample result from SQL server: <Customers CustomerID="ANATR"><Orders ShipName="Ana Trujillo Emparedados y helados" ShipCity="M�xico D.F."/><Orders ShipName="Ana Trujillo Emparedados y helados" ShipCity="M�xico D.F."/><Orders ShipName="Ana Trujillo Emparedados y helados" ShipCity="M�xico xml island on the c...

Need site for VB Tutorial
Hello Can someone suggest some site to learn VB?? Thanks Tom -- SMIL ----------------------------------------------------------------------- SMILE's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=488 View this thread: http://www.excelforum.com/showthread.php?threadid=26676 Hi see: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Frank Kabel Frankfurt, Germany "SMILE" <SMILE.1dp2ta@excelforum-nospam.com> schrieb im Newsbeitrag news:SMILE.1dp2ta@excelforum-nospam.com... > > Hello > Can someone suggest some site to learn VB...

XML Schema: Creating Datasets
I am trying to create a dataset from a published schema. The Schema is valid but when I attempt to create a dataset it complains that a column already belongs to the table. The schema I am using can be found at: http://www.westdorset-dc.gov.uk/test/bs7666-v1-2.xsd Any help appreciated Dave ...