You need to change your client code as follows:
opts.setTo(new
EndpointReference("http://localhost:8080/axis2/services/WSAddSessionService?wsdl"));
opts.setAction("urn:add");
*opts.setManageSession(true);*
sc.setOptions(opts);
OMElement element = sc.sendReceive(createPayLoad(10));
System.out.println(element.getFirstElement().getText());
element = sc.sendReceive(createPayLoad(10));
System.out.println(element.getFirstElement().getText());
> Options opts = new Options();
> opts.setTo(new
> EndpointReference("http://localhost:8080/axis2/services/WSAddSessionService?wsdl"));
> opts.setAction("urn:add");
> sc.setOptions(opts);
>
> OMElement element = sc.sendReceive(createPayLoad(10));
> System.out.println(element.getFirstElement().getText());
>
> opts.setManageSession(true);
> sc.setOptions(opts);
> element = sc.sendReceive(createPayLoad(10));
> System.out.println(element.getFirstElement().getText());