Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. read XML threw API

read XML threw API

Scheduled Pinned Locked Moved ASP.NET
xmljsonhelptutorial
12 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael_jhons
    wrote on last edited by
    #1

    hello, I'M Ssnding some parameters to an url which display for me an XML file. i just want to need how to read that XML page in order to use that data in a table.it's not reading an existing xml file,it's not saving somewhere it's just in that url. i'm new in XML, any help will be extreamly apreciated, thank you in advance

    S 1 Reply Last reply
    0
    • M michael_jhons

      hello, I'M Ssnding some parameters to an url which display for me an XML file. i just want to need how to read that XML page in order to use that data in a table.it's not reading an existing xml file,it's not saving somewhere it's just in that url. i'm new in XML, any help will be extreamly apreciated, thank you in advance

      S Offline
      S Offline
      surender m
      wrote on last edited by
      #2

      hi michael, You can load that XML into an XMLDocument and iterate through the nodes,use xpath expressions and get the data. Regards surender

      M 1 Reply Last reply
      0
      • S surender m

        hi michael, You can load that XML into an XMLDocument and iterate through the nodes,use xpath expressions and get the data. Regards surender

        M Offline
        M Offline
        michael_jhons
        wrote on last edited by
        #3

        hi surrender, thank you for your answer , here is how am i sending the parametrers via post method

        <form method="POST" action="someURL.php">
        <input type='hidden' name='serial' value='a' >
        <input type='hidden' name='transactionid' value='b' >
        <input type='submit' name='submit' value='submit'>
        </form>

        the someURL.php contain the XML file after sending its parameters. where should i put that URL in the code, could you please give me a small example thank you so much

        S 1 Reply Last reply
        0
        • M michael_jhons

          hi surrender, thank you for your answer , here is how am i sending the parametrers via post method

          <form method="POST" action="someURL.php">
          <input type='hidden' name='serial' value='a' >
          <input type='hidden' name='transactionid' value='b' >
          <input type='submit' name='submit' value='submit'>
          </form>

          the someURL.php contain the XML file after sending its parameters. where should i put that URL in the code, could you please give me a small example thank you so much

          S Offline
          S Offline
          surender m
          wrote on last edited by
          #4

          sorry i didn't get u.... r u submitting postdata?? if yes provide the format of the post data. if you want to submit post data you can create a weburi using webrequest object and set the parameters like WebRequest req = WebRequest.Create("URL to be accessed"); req.Method = "POST"; req.ContentType = "text/xml"; string str = "POST DATA"; StreamWriter sw = new StreamWriter(req.GetRequestStream()); sw.WriteLine(str); sw.Close(); WebResponse res = req.GetResponse(); and res will contain response from the accessed URL. Regards surender

          M 1 Reply Last reply
          0
          • S surender m

            sorry i didn't get u.... r u submitting postdata?? if yes provide the format of the post data. if you want to submit post data you can create a weburi using webrequest object and set the parameters like WebRequest req = WebRequest.Create("URL to be accessed"); req.Method = "POST"; req.ContentType = "text/xml"; string str = "POST DATA"; StreamWriter sw = new StreamWriter(req.GetRequestStream()); sw.WriteLine(str); sw.Close(); WebResponse res = req.GetResponse(); and res will contain response from the accessed URL. Regards surender

            M Offline
            M Offline
            michael_jhons
            wrote on last edited by
            #5

            i'm so sorry i thing i missed explained here is the detail i developping a sim card website so users could enter and check calls they made (call history) . i have to send PARAMETERS (date, login username and password) to a specific url. when i'm redirecting to that url an xml file is displayed (here is URL u can check it "https://www.xfone.co.uk/mobile/CdrsView.php") but of course i can't show this page to the user i have to retreive that data to a table. hope that will give you a clearer idea. sorry for the miss-understanding regards michael

            P 1 Reply Last reply
            0
            • M michael_jhons

              i'm so sorry i thing i missed explained here is the detail i developping a sim card website so users could enter and check calls they made (call history) . i have to send PARAMETERS (date, login username and password) to a specific url. when i'm redirecting to that url an xml file is displayed (here is URL u can check it "https://www.xfone.co.uk/mobile/CdrsView.php") but of course i can't show this page to the user i have to retreive that data to a table. hope that will give you a clearer idea. sorry for the miss-understanding regards michael

              P Offline
              P Offline
              Paddy Boyd
              wrote on last edited by
              #6

              Could you simply provide an xslt stylesheet with the xml page to have it render as you like?

              M 1 Reply Last reply
              0
              • P Paddy Boyd

                Could you simply provide an xslt stylesheet with the xml page to have it render as you like?

                M Offline
                M Offline
                michael_jhons
                wrote on last edited by
                #7

                :) the page which contain the url is sent by another system another provider i don't have any control on it simply i get a xml page which i want to retreivem the data regards

                P 1 Reply Last reply
                0
                • M michael_jhons

                  :) the page which contain the url is sent by another system another provider i don't have any control on it simply i get a xml page which i want to retreivem the data regards

                  P Offline
                  P Offline
                  Paddy Boyd
                  wrote on last edited by
                  #8

                  OK, so you can use the code posted above to read the XML into an XMLDocument on the server side - you should be able to bind this to a grid...

                  M 2 Replies Last reply
                  0
                  • P Paddy Boyd

                    OK, so you can use the code posted above to read the XML into an XMLDocument on the server side - you should be able to bind this to a grid...

                    M Offline
                    M Offline
                    michael_jhons
                    wrote on last edited by
                    #9

                    ok, thank you for your time

                    1 Reply Last reply
                    0
                    • P Paddy Boyd

                      OK, so you can use the code posted above to read the XML into an XMLDocument on the server side - you should be able to bind this to a grid...

                      M Offline
                      M Offline
                      michael_jhons
                      wrote on last edited by
                      #10

                      dear surrender in the code above where could i specify the parameters value??

                      S 1 Reply Last reply
                      0
                      • M michael_jhons

                        dear surrender in the code above where could i specify the parameters value??

                        S Offline
                        S Offline
                        surender m
                        wrote on last edited by
                        #11

                        hi micheal, in the code given refer string str = "POST DATA"; here replace "POST DATA" with approriate parameters and their values. Regards surender

                        No Defeat Is Final Until You Stop Trying!.......

                        M 1 Reply Last reply
                        0
                        • S surender m

                          hi micheal, in the code given refer string str = "POST DATA"; here replace "POST DATA" with approriate parameters and their values. Regards surender

                          No Defeat Is Final Until You Stop Trying!.......

                          M Offline
                          M Offline
                          michael_jhons
                          wrote on last edited by
                          #12

                          thank you so much

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups