Write XML to object not a file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim P.

    #1

    Write XML to object not a file

    Still new to .Net so bare with me. Working on a client/server app. But
    I'm trying to build an XML file on the fly (without writing to a file) using
    data from my application. This info includes IP address, Port, GUID, etc.

    I can write to a file with no problem. But I want to output to some kind of
    object which I can then serialize and send across the wire to the server,
    which will then de-serialize it and read it.

    Any any ideas on how I would output the XmlTextWriter to an object so it'll
    be ready for serialization?

    thanks


  • Dare Obasanjo [MSFT]

    #2
    Re: Write XML to object not a file

    You may want to investigate using the XmlSerializer.

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Jim P." <tranzparency@y ahoo.com> wrote in message
    news:OPVadKW5DH A.2312@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Still new to .Net so bare with me. Working on a client/server app. But
    > I'm trying to build an XML file on the fly (without writing to a file)[/color]
    using[color=blue]
    > data from my application. This info includes IP address, Port, GUID, etc.
    >
    > I can write to a file with no problem. But I want to output to some kind[/color]
    of[color=blue]
    > object which I can then serialize and send across the wire to the server,
    > which will then de-serialize it and read it.
    >
    > Any any ideas on how I would output the XmlTextWriter to an object so[/color]
    it'll[color=blue]
    > be ready for serialization?
    >
    > thanks
    >
    >[/color]


    Comment

    • Dino Chiesa [Microsoft]

      #3
      Re: Write XML to object not a file

      Also when you "send across the wire"- how is this accomplished?
      Are you aware that XML serialization happens automagically with web services
      in .NET?
      you don't need to explicitly serialize your objects to XML, it happens
      implicitly.


      "Dare Obasanjo [MSFT]" <dareo@online.m icrosoft.com> wrote in message
      news:OUlqhOb5DH A.2556@TK2MSFTN GP09.phx.gbl...[color=blue]
      > You may want to investigate using the XmlSerializer.
      >
      > --
      > This posting is provided "AS IS" with no warranties, and confers no[/color]
      rights.[color=blue]
      >
      > "Jim P." <tranzparency@y ahoo.com> wrote in message
      > news:OPVadKW5DH A.2312@TK2MSFTN GP12.phx.gbl...[color=green]
      > > Still new to .Net so bare with me. Working on a client/server app.[/color][/color]
      But[color=blue][color=green]
      > > I'm trying to build an XML file on the fly (without writing to a file)[/color]
      > using[color=green]
      > > data from my application. This info includes IP address, Port, GUID,[/color][/color]
      etc.[color=blue][color=green]
      > >
      > > I can write to a file with no problem. But I want to output to some[/color][/color]
      kind[color=blue]
      > of[color=green]
      > > object which I can then serialize and send across the wire to the[/color][/color]
      server,[color=blue][color=green]
      > > which will then de-serialize it and read it.
      > >
      > > Any any ideas on how I would output the XmlTextWriter to an object so[/color]
      > it'll[color=green]
      > > be ready for serialization?
      > >
      > > thanks
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...