tags:

views:

34

answers:

2

Hi All, I have a c# server and a java client. Currently they pass plain text between each other using sockets. Now I want to change these sockets to communicate in XML. I can implement the java side, But i do not know how to implement the c# server side so that the server and the client could communicate without any problem. Are there any special technologies/libraries that I could use for this? at least a pointer to some examples is appreciated.

thanks

/Suralk

+1  A: 

Use XmlDocument to create XML. Then you can send the complete string of that XML (xmlDoc.OuterXml) using TcpClient. Then using TcpClient you can also wait for the response.

controlfreak123
what about the c# side? is there any special mechanism for XML? I could not find any
sura
XmlDocument is C#. None of what I was referring to is java.
controlfreak123
thanks a lot. will try this out
sura
A: 

You could do it with a web service (WCF in C#). Both Java and C# can read a WSDL.

http://msdn.microsoft.com/en-us/netframework/aa663324.aspx

http://teaching.cs.uml.edu/~heines/tools/JRun4/docs/html/Programmers_Guide/ws_wsdl5.html

onof
web services would be bit too much for my application. both client and server are running in the server machine. I use sockets because that is the easiest way to communicate between c# and java applications residing in the same machine
sura