How to pass xml data between c# and java sockets
I have a c# server and a java client. Currently they pas开发者_运维技巧s 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
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.
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
精彩评论