Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reading an XML post in an ASP.NET web site

    I desperately need some help on this. I have a website that will recieve votes via sms (text messages). The person voting will send a message to a certain number which will then forward on an xml post to an address I have specified.

    I've sent up an aspx file at this point with a form on it. I know how to look through the xml and get out the data I need but what I need help with is how I read that XML post in the first place. How to I get the aspx file to capture the XML post and then allow me to read through it?

    Cheers

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    New York, USA
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you trying to read XML from a remote URL?

    http://samples.gotdotnet.com/QuickSt...adFromUrl.aspx

  • #3
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, what will happen is that after an sms is recieved an xml message will be sent to the url that I've specified. As it won't be saving an xml file for me to read I'm at aloss to figure out how to read the data and then add it to my database

  • #4
    New Coder
    Join Date
    Oct 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this article should help with the xml part of reading

    here is the database part

    Dataset myDataset = new Dataset( );
    myDataset.ReadXml( streamobject ); // think that's how it works...
    // display results in a datagrid
    myDataGrid.DataSource = myDataset.Tables[0].DefaultView;
    myDataGrid.DataBind( );

    string strConnection = " your database connection ";
    OleDbConnection objConnection = new OleDbConnection( strConnection );
    OleDbCommand objCommand = new OleDbCommand(objConnection );
    objCommand.CommandText = "INSERT INTO ..."
    objCommand.ExecuteNonQuery()

    hope this helps
    -john
    Last edited by kampfer; 11-04-2005 at 03:12 AM.

  • #5
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that but getting the data into the database isn't the issue I'm having difficulty with. Its how I read the XML post in the first place

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    How is XML data passed to your site? Is it submitted to you via POST (upload form or normal form submission?) or GET or what?


  •  

    Posting Permissions

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