HighTechTalks DotNet Forums  

Decoding XML response in VB .NET

Dotnet XML microsoft.public.dotnet.xml


Discuss Decoding XML response in VB .NET in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?=
 
Posts: n/a

Default Decoding XML response in VB .NET - 08-28-2007 , 10:40 AM






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">
<ns1829687187rderNum xsi:type="xsd:string">097294</ns1829687187rderNum>
<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>
<ns1829687187fflineDate 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">
<ns1829687187refix xsi:type="xsd:string">XH42</ns1829687187refix>
<ns1829687187:base xsi:type="xsd:string">017B22</ns1829687187:base>
<ns1829687187:suffix xsi:type="xsd:string">AA</ns1829687187:suffix>
<ns1829687187artDesc xsi:type="xsd:string">SHLD VEH IDENT
LBL</ns1829687187artDesc>
<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">
<ns1829687187refix xsi:type="xsd:string">XB42</ns1829687187refix>
<ns1829687187:base xsi:type="xsd:string">16G847</ns1829687187:base>
<ns1829687187:suffix xsi:type="xsd:string">BA</ns1829687187:suffix>
<ns1829687187artDesc xsi:type="xsd:string">SHLD VEH IDENT
LBL</ns1829687187artDesc>
<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

Reply With Quote
  #2  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 10:46 AM






"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA (AT) microsoft (DOT) com...
Quote:
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]



Reply With Quote
  #3  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 10:46 AM



"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA (AT) microsoft (DOT) com...
Quote:
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]



Reply With Quote
  #4  
Old   
=?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?=
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 11:32 AM





"John Saunders [MVP]" wrote:

Quote:
"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA (AT) microsoft (DOT) 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




Reply With Quote
  #5  
Old   
=?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?=
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 11:32 AM





"John Saunders [MVP]" wrote:

Quote:
"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA (AT) microsoft (DOT) 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




Reply With Quote
  #6  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 11:36 AM



"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message newsAB58928-B3EE-4154-83C7-1FB2F2B1676F (AT) microsoft (DOT) com...
Quote:

"John Saunders [MVP]" wrote:

"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA (AT) microsoft (DOT) 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]



Reply With Quote
  #7  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 11:36 AM



"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message newsAB58928-B3EE-4154-83C7-1FB2F2B1676F (AT) microsoft (DOT) com...
Quote:

"John Saunders [MVP]" wrote:

"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:58DC8A04-1107-4DC1-9734-2F90602CABBA (AT) microsoft (DOT) 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]



Reply With Quote
  #8  
Old   
=?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?=
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 12:00 PM



Quote:
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


Reply With Quote
  #9  
Old   
=?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?=
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 12:00 PM



Quote:
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


Reply With Quote
  #10  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: Decoding XML response in VB .NET - 08-28-2007 , 04:13 PM



"Jonathan Attree" <JonathanAttree (AT) discussions (DOT) microsoft.com> wrote in
message news:AD5C3D32-3DD8-4EE3-B0D8-C11C88E7667F (AT) microsoft (DOT) com...
Quote:
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]



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.