1

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

2
  • hey sorry. i ddnt know that we could vote for the answers. Commented Jul 24, 2010 at 6:54
  • No I don't mean voting for answers. Click the empty check mark next to the answer to accept it. That means you feel it is the correct one. Commented Jul 30, 2010 at 0:20

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

what about the c# side? is there any special mechanism for XML? I could not find any
XmlDocument is C#. None of what I was referring to is java.
0

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

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.