Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need starting point

First, thanks for any help that is given.
Second, I'm building a web based application that will receive XML in a request that I will need to parse and then perform data base transactions based on what was in the xml. We have schemas set up from the vendor sending the xml to us. I have build many web applications but have little experience with xml. I'm looking for a starting point. How do I take the request and parse the data from the request, and how do I put other xml into the response to send it back to the vendor? How does the schema from the vendor fit into this other than a template?
Thanks again and there will probably be follow up questions!

Comments

  • infidelinfidel Member Posts: 2,900
    : First, thanks for any help that is given.
    : Second, I'm building a web based application that will receive XML in a request that I will need to parse and then perform data base transactions based on what was in the xml. We have schemas set up from the vendor sending the xml to us. I have build many web applications but have little experience with xml. I'm looking for a starting point. How do I take the request and parse the data from the request, and how do I put other xml into the response to send it back to the vendor? How does the schema from the vendor fit into this other than a template?

    As far as receiving and sending XML, XML is really just the contents of a text file, so you are just passing strings. How you get that string from the request and write a different string to the response is up to your web application framework and/or web server.

    There are libraries available for all major (and most minor, I believe) programming languages for parsing XML.

    An XML Schema can be used to validate an XML document. The idea, I believe, is to store the schema somewhere that the web application has access to. Then when it grabs the XML from the request, it can use some utility to validate that the XML adheres to the rules in the Schema. It's a facility to help ensure that both sides of a transaction are dealing with properly formed data.

    So the general flow for a web application is:

    receive request from server
    get XML from request
    validate XML against schema
    parse XML
    do whatever processing you want
    create XML
    send XML in response

    You can create XML a number of ways. Either via simple string concatenation, though that can be a fragile way of doing it. Or by using some kind of object model that serializes itself to XML, or by using XSLT to transform one XML document into another. Depending on the language/framework you're using, there may be other alternatives.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.