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
  1. Home
  2. General Programming
  3. C#
  4. XML Post

XML Post

Scheduled Pinned Locked Moved C#
comxmlquestion
1 Posts 1 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.
  • K Offline
    K Offline
    kibromg
    wrote on last edited by
    #1

    Hi all, I have the following sda.fill(ds); string xmlDs = ds.GetXml(); WebRequest req = null; WebResponse rsp = null; try { string fileName = xmlDs; string uri = "http://www.website.com/Pages/CongratulationsListener.aspx"; req = WebRequest.Create(uri); //req.Proxy = WebProxy.GetDefaultProxy(); // Enable if using proxy req.Method = "POST"; // Post method req.ContentType = "text/xml"; // content type // Wrap the request stream with a text-based writer StreamWriter writer = new StreamWriter(req.GetRequestStream()); // Write the XML text into the stream writer.WriteLine(fileName); writer.Close(); // Send the data to the webserver // SendRequest(uri); rsp = req.GetResponse(); rsp.Close(); } catch (WebException webEx) { } catch (Exception ex) { } finally { if (req != null) req.GetRequestStream().Close(); if (rsp != null) rsp.GetResponseStream().Close(); } My listner page (CongratulationsListener.aspx) doesnt seem to get any Xml data? Can any one advice please? Thank you in advance.

    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