Client application for using a .NET service

From: Onur Sencer <>
Date: Tue, 21 Sep 2004 21:46:24 +0300

Hi all
I wrote a code for getting information from .NET service. The client code is below. After execution I get no exception but I also can't get the string that needs to return. I could not find the error, so I started thinking if we can't reach .NET applications with jax-rpc. Is the error related with the types of arguments?


package src.client.hello;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.ParameterMode;
import java.math.*;

public class TranslateRPCForDotNet {

    private static String qnameService = "TranslationService";
    private static String qnamePort = "TranslationServiceSoap";

    private static String BODY_NAMESPACE_VALUE =
    private static String ENCODING_STYLE_PROPERTY =
    private static String NS_XSD =
    private static String URI_ENCODING =

    public static void main(String[] args) {

        String endpointaddress="";
        System.out.println("Endpoint address = " + endpointaddress);

        try {
            ServiceFactory factory =
            Service service =
                new QName(qnameService));
            QName port = new QName(qnamePort);
            Call call = service.createCall(port);

                new Boolean(true));
            QName QNAME_TYPE_STRING =
                        new QName(NS_XSD, "string");
            QName QNAME_TYPE_INTEGER =
                        new QName(NS_XSD, "integer");

                new QName(BODY_NAMESPACE_VALUE,"Translate"));
            call.addParameter("strLanguage", QNAME_TYPE_STRING,
            call.addParameter("strMessage", QNAME_TYPE_STRING,
            String[] params = { "en_fr","hello" };

            String result = (String) call.invoke(params);

        } catch (Exception ex) {

To unsubscribe, e-mail:
For additional commands, e-mail: