ricgeorge
ricgeorge

Reputation: 188

Pass XML data from C# to Java?

I have two applications: one in C#, the other in Java. I need a way to transfer data from the C# application in XML format to the Java application using some kind of service.

I have only worked with sockets before, but am looking for something less proprietary for future use with other applications. What other alternatives are there?

*Please note that the extent of my knowledge with working with sockets was a simple client/server written in java.

Upvotes: 0

Views: 557

Answers (2)

avishayp
avishayp

Reputation: 706

(I see now you insist on XML. So forget about it)

These are completely distinct issues - it's like asking if I want to speak with you now, should we have a phone call in French or maybe mail correspondence in Mandarin. So it's:

  1. Means of transferring data (S.A HTTP, or TCP, or whatever).

  2. Some common structure of data.

Confusingly, both are regarded as 'protocols'.

Anyhow I'd say protobuf over HTTP is the most obvious and straight forward thing to use.

Upvotes: 1

mindandmedia
mindandmedia

Reputation: 6825

If both programs run on the same machine, you could of course also use files, but in general, this is how it goes down:

  1. Create a webservice in C#, implementing a method that exposes your data.
  2. Use the wsimport tool provided with the jdk, point it at the above created .wsdl file to generate java classes to use as a soap client.
  3. Use generated classes to consume webservice.

Upvotes: 2

Related Questions