Astroboy2

Hi All,

I'm a newbie and need a little guidance. I connect to a server & port to send/recieve asyn messages sent as a string (XML) which is something like the below. I don't know what System object(s) I need to use. I understand that serialization is for sending and deserialization is for receiving but am confused when it comes to how things should fit together.

Can someone help me and point me in the right direction

Thank You
Eugene =)


Sent to server:

<MsgId>111</MsgId>
<OpCode>50</OpCode>
<Message>Apple</Message>

Recieved from server:

<MsgId>111</MsgId>
<Status>0</Status>
<Quantity>50</Quantity>



Re: XML and the .NET Framework Sending and recieving XML strings into a object

Sergey Dubinets - MSFT

You can use XmlReader to read XML stream and XmlWriter to write XML to stream.




Re: XML and the .NET Framework Sending and recieving XML strings into a object

Astroboy2

Hi Sergey,

I can use both XmlReader/XmlWriter even though I am not using HTTP as a transport I'm assuming that the reader/writer will create me an object

Thank You
Eugene =)





Re: XML and the .NET Framework Sending and recieving XML strings into a object

Chris Lively

There are a lot of ways to do what you need. If the server is running as a webservice you can use a Web Reference which generates all of the plumbing necessary for your app to talk to it.

If not, I assume you know how to open a port and pass data to it. If so, then the XmlReader / XmlWriter objects are your best bet. You can find all sorts of examples on how to use them.

Good luck