I have an ArrayList containing 10 values.
ArrayList<String> a=new ArrayList<String>();
a.add("a1");
a.add("a2");
a.add("a3");
I am invoking WebService to pass this ArrayList as an input parameter.. However when I created a dummy client and tested for the ArrayList I am not getting the output.. I am using Apache Axis 2. I realised that ArrayList is not synchornized and hence there may be a problem...How do I overcome this issue.... I am looking for the simplest solution... Can anyone please guide me...
The server side code is:-
public class TestWebSerrviceForArrayList
{
public String personIdentity="RandomName";
ArrayList<String> personArray=new ArrayList<String>();
public ArrayList<String> addValuesArrayList()
{
personArray.add("Name1");
personArray.add("Name2");
personArray.add("Name3");
personArray.add("Name4");
System.out.println("Added values in person Array " + personArray);
return personArray;
}
public String getName()
{
return personIdentity;
}
}
The code snippet for Client Side is :-
TestWebSerrviceForArrayListStub testWeb=new TestWebSerrviceForArrayListStub();
AddValuesArrayListResponse r=testWeb.(I AM NOT ABLE TO FIND THE FUNCTION NAME)