Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / August 2007

Tip: Looking for answers? Try searching our database.

Decoding XML response in VB .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Attree - 28 Aug 2007 15:40 GMT
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
John Saunders [MVP] - 28 Aug 2007 15:46 GMT
> The following is the SOAP response from my customer 's intranet based web
> service. From my VB app I call:
[quoted text clipped - 14 lines]
> <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).
Signature

John Saunders [MVP]

Jonathan Attree - 28 Aug 2007 16:32 GMT
> > The following is the SOAP response from my customer 's intranet based web
> > service. From my VB app I call:
[quoted text clipped - 18 lines]
> 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).

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
John Saunders [MVP] - 28 Aug 2007 16:36 GMT
>> > The following is the SOAP response from my customer 's intranet based
>> > web
[quoted text clipped - 32 lines]
> 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.
Signature

John Saunders [MVP]

Jonathan Attree - 28 Aug 2007 17:00 GMT
> >> Jonathan, did you try creating proxy classes using Add Web Reference?
> >> That
[quoted text clipped - 15 lines]
> need the actual service. In fact, all the actual service does it return the
> WSDL and schemas.
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
John Saunders [MVP] - 28 Aug 2007 21:13 GMT
>> >> Jonathan, did you try creating proxy classes using Add Web Reference?
>> >> That
[quoted text clipped - 27 lines]
> 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.
Signature

John Saunders [MVP]


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.