Search code examples
c#javacom+

how can i C# application call a java application


can a C# application call a java application.

for example in C#

public int Sum(int a, int b)
{
    return // call java function to do the sum
}

then in Java will have a function do the actual sum

public int Sum(int a, int b)
{
    return a+b;
}

will COM+ help??

Thanks


Solution

  • One thing you could try:

    1. Expose the Java as a Jax-Ws web service.

    2. Use .NET's svcutil.exe against it to generate a c# client

    3. Use the c# client to call Sum