views:

85

answers:

0

Hello,

First of all i success to programming a client for an Axis 1.2 web service, but for Axis2 i don't know how i can do, and the tutorial in Apache don't really help me.

Here my code :

import java.net.URL;

import javax.xml.namespace.QName;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class EmployeClient {

    public static void main(String [] args) throws Exception {
        Service service = new Service();
        Call call = (Call)service.createCall();
        String endpoint = "http://localhost:8080/axis/services/EmployeService";
        call.setTargetEndpointAddress(new URL(endpoint));
        call.setOperationName(new QName("getCurrentID"));

        String dept = "marketing";
        String name = "sacha";
        String position = (String)call.invoke(new Object  [] {new String(dept), new String(name)});

        System.out.println("Résultat de la recherche : " + position );
    }
}

So how can i do for convert this code in Axis2 ? Thanks you very much.

ps : i'm french, sorry for my bad english !