Results 1 to 12 of 12

Thread: [RESOLVED] saving XML packet to file

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Resolved [RESOLVED] saving XML packet to file

    Hi there I have a flash application that will send an XML packet to a asp.net server application (.aspx file).

    I know how to sen the XML packet to the .aspx file but does anyone know how i get the .aspx file to save the xml packet back to an xml file, i have found loads of PHP exsaples that are realy simple but I need to do this in asp.net.

    hope sone has an idea cant fined any realistic and simplke links.

    want to know more just ask

    lee

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Re: saving XML packet to file

    Hi there thanks for the tutorial link that was a great example but only tells you how to create a XML document in ASP.NET does not tell you how to recieve an XML packet(being snet from flash) and then save this to an XML file

    anmore ideas would be greatfuly recieved

    lee

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: saving XML packet to file

    But you said:

    I know how to sen the XML packet to the .aspx file

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Exclamation Re: saving XML packet to file

    Hi there
    I know what I said and i can send the xml packet to the asp.net page, but that page then need to take that packet and save it to an xml file. This is what I cant do. The xml file already excists just need to save the packet sent from flash back to the server
    any ideas
    lee

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: saving XML packet to file

    How is it being sent then? As a GET? POST?

  7. #7

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Exclamation Re: saving XML packet to file

    Hi there it is sent from flash using actionscript in the sef

    testxml.SendandLoad(" /test.aspx", textxml) the data is POST

    hope this helps

    lee

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: saving XML packet to file

    You can then get the data sent in the ASPX page using Request.Form["fieldname"]. Where fieldname is the parameter specified in the body of the xml that you've sent. Example:

    Code:
    thexmlpacket=<something><blah><blahdyblah>dkfj</blahdyblah></blah></something>
    So in that case, you would look for Request.Form["thexmlpacket"]

  9. #9

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Re: saving XML packet to file

    that great thanks but how when I have it in the aspx page do i save it

    is that code c# or vb

    lee

  10. #10

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Re: saving XML packet to file

    I cant belive through all the forums and tutorials I have been trough I finaly worked it out

    It works I can now update load XML into flash, update thge XML instance and send that instance to an ASP.NET web service as a XML packet

    The ASP.NET web service then saves the XML packet back to the origonal XML file and it all happends in the background

    Cool

    I must say though that there isnt alot of information on how to do this type of thing using ASP.NET

    Anyone else have this problem jsut ask maybee i can post the answer if enough people require it

    help me heeps

    thanks to all thatr helped me achieve this

    lee

  11. #11
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] saving XML packet to file

    I think you should post the answer anyways because people often search these forums for answers and if they come across your post, they won't even need to ask.

  12. #12

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Re: [RESOLVED] saving XML packet to file

    no probs mate
    in the end the code required was very short
    but I guess when no one knows how to do it doesnt matter how big the code is.

    The code is in 'VB' within the asp.net page

    here it is

    'page load event handler
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim xmlDoc, FilePath
    xmlDoc = New XmlDocument
    xmlDoc.Load(Request.InputStream)
    FilePath = Server.MapPath("")
    xmlDoc.Save(FilePath + "\filename.xml")

    End Sub

    then in flash

    xmlDoc.sendAndLoad("default.aspx", returnXML, "POST");

    any questions just ask, hope this helps other as i have spent about 5 weeks to get this to work

    lee

Posting Permissions

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



Click Here to Expand Forum to Full Width