0

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.

3
  • 1
    It's hard to know exactly what you're asking here. The obvious option would be to use HTTP, for example... Commented Nov 14, 2012 at 10:06
  • Basically WSDL based communications is what is required... A previous question discusses that stackoverflow.com/questions/1703951/… Commented Nov 14, 2012 at 10:06
  • Here is an example using WCF+Json+Java Commented Nov 14, 2012 at 10:54

2 Answers 2

2

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.
Sign up to request clarification or add additional context in comments.

1 Comment

This sounds like it has potential. I'll have to do more research on how to implement a web service in C# to give it a try
1

(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.

2 Comments

The common structure is indeed XML, but it's the means of transferring that data that I need and do not understand. I need it to be compatible with both programming languages, as well as being capable of understanding XML format
What you need is called HTTP, and is supported by anything nowadays.

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.