}
Client1:
public class Client {
public static void main(String args[])throws Exception{
LoginStub stub = new LoginStub();
Loginname loginname = new Loginname();
loginname.setUsername("nicholas");
stub.loginname(loginname);
System.out.println(stub.loginname(loginname));
GetLoginmsg msg = new GetLoginmsg ();
while(true){
Thread.sleep(2000);
System.out.println(stub.getLoginmsg(msg).get_return());
}
}
}
Client2:
public class Client {
public static void main(String args[])throws Exception{
LoginStub stub = new LoginStub();
Loginname loginname = new Loginname();
loginname.setUsername("xiewenbo");
stub.loginname(loginname);
System.out.println(stub.loginname(loginname));
GetLoginmsg msg = new GetLoginmsg ();
while(true){
Thread.sleep(2000);
System.out.println(stub.getLoginmsg(msg).get_return());
}
}
}
public LoginStub(org.apache.axis2.context.ConfigurationContext configurationContext,
java.lang.String targetEndpoint, boolean useSeparateListener)
throws org.apache.axis2.AxisFault {
//To populate AxisService
populateAxisService();
populateFaults();
_serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service);
configurationContext = _serviceClient.getServiceContext().getConfigurationContext();
_serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(
targetEndpoint));
_serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
//Set the soap version
_serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
_serviceClient.getOptions().setManageSession(true);
}