Parse XML Response String And Get Usable Variables
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Parse XML Response String And Get Usable Variables

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    Parse XML Response String And Get Usable Variables

    Hi,

    I'm new to VB.net and totally new to XML. I am building a program that receives a response to a XML inquiry from hwresponse.GetResponseStream. So far I have been able to submit the request and receive a response. I now need take that response (in the form of a string) and convert it to a format which will allow me to make decisions based on it. Perhaps by creating dataset/datatable and passing to variables.

    My rough idea would be to create a new row for each lineid corresponding to an articleid with dates etc then loop.

    I've spent days Googling an can't find anything in VB.net that fits. I know this is down to my lack of knowledge and a tiny brain. I would be eternally grateful to anyone who could help.

    The response is a reply to a stock enquiry:


    <?xml version="1.0" encoding="UTF-8" ?>
    <ew:quote_A2 xmlns:ew="http://www.reifen.net">
    <DocumentID>A2</DocumentID>
    <Variant>5</Variant>
    <ErrorHead>
    <ErrorCode>0</ErrorCode>
    </ErrorHead>
    <BuyerParty>
    <PartyID>305026</PartyID>
    <AgencyCode>91</AgencyCode>
    </BuyerParty>
    <OrderLine>
    <LineID>10</LineID>
    <OrderedArticle>
    <ArticleIdentification>
    <ManufacturersArticleID>520654</ManufacturersArticleID>
    <EANUCCArticleID>5452000877154</EANUCCArticleID>
    </ArticleIdentification>
    <ArticleDescription>
    <ArticleDescriptionText>205/55R16 91H OPTIGRIP FP</ArticleDescriptionText>
    </ArticleDescription>
    <Availability>3</Availability>
    <RequestedQuantity>
    <QuantityValue>200</QuantityValue>
    </RequestedQuantity>
    <Error>
    <ErrorCode>0</ErrorCode>
    </Error>
    <ScheduleDetails>
    <DeliveryDate>9999-12-31</DeliveryDate>
    <AvailableQuantity>
    <QuantityValue>200</QuantityValue>
    </AvailableQuantity>
    </ScheduleDetails>
    </OrderedArticle>
    </OrderLine>
    <OrderLine>
    <LineID>10</LineID>
    <OrderedArticle>
    <ArticleIdentification>
    <ManufacturersArticleID>522794</ManufacturersArticleID>
    <EANUCCArticleID>5452001082922</EANUCCArticleID>
    </ArticleIdentification>
    <ArticleDescription>
    <ArticleDescriptionText>205/55R16 91H UG 8 MS FP</ArticleDescriptionText>
    </ArticleDescription>
    <Availability>2</Availability>
    <RequestedQuantity>
    <QuantityValue>200</QuantityValue>
    </RequestedQuantity>
    <Error>
    <ErrorCode>0</ErrorCode>
    </Error>
    <ScheduleDetails>
    <DeliveryDate>2013-02-04</DeliveryDate>
    <AvailableQuantity>
    <QuantityValue>5</QuantityValue>
    </AvailableQuantity>
    </ScheduleDetails>
    <ScheduleDetails>
    <DeliveryDate>9999-12-31</DeliveryDate>
    <AvailableQuantity>
    <QuantityValue>195</QuantityValue>
    </AvailableQuantity>
    </ScheduleDetails>
    </OrderedArticle>
    </OrderLine>
    </ew:quote_A2>

  2. #2
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    51

    Re: Parse XML Response String And Get Usable Variables


    Microsoft MVP .NET Programming (2012 - Present)
    ®Crestron DMC-T Certified Automation Programmer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center