Hi, I have been trying to get a web service up and running with axis2 today but been having a few problems. I am using pojo, one of the parameters is a very simple object and the object arrives but none of the variables of that object arrive.
So on the web service side I have this method
public Hashtable<String, CityLand>
getOwnedLandBetweenPoints(LoginCredentials pCredentials, int pFromX, int
pFromY, int pToX, int pToY)
throws WoWInternalException, WoWAPIUseException
{
//do some stuff
}
Here is my LoginCredentials class:
import java.io.Serializable;
public class LoginCredentials
implements Serializable
{
public String aPIUser;
public String aPIKey;
public String woWUsername;
public String woWPassword;
}
I realise that returning Hashtable might be problematic, but the plan
was to sort that out when I got that far. Anyway you can call the
method thats fine and the LoginCredentials arrives (because when calling
it you can set it to null and in this case you get a null passed in).
However all the fields (no mater what you set them to on the client) are
always null (if you change the class so that all the fields are
initialised to empty string then they are all empty string).
The WSDL generated by axis is attached, and my noddy test class looks
like this
public class Test
{
public static void main(String[] pArgs)
{
try
{
WorldsOfWarAPIStub tStub = new WorldsOfWarAPIStub();
WorldsOfWarAPIStub.GetOwnedLandBetweenPoints tParam = new
WorldsOfWarAPIStub.GetOwnedLandBetweenPoints();
WorldsOfWarAPIStub.LoginCredentials tCreds = new
WorldsOfWarAPIStub.LoginCredentials();
tCreds.setAPIUser("1-WWST");
tCreds.setAPIKey("HTft");
tParam.setPCredentials(tCreds);
tParam.setPFromX(0);
tParam.setPFromY(0);
tParam.setPToX(100);
tParam.setPToY(100);
WorldsOfWarAPIStub.GetOwnedLandBetweenPointsResponse tResponse =
tStub.getOwnedLandBetweenPoints(tParam);
System.out.println(tResponse.get_return());
}
catch (Exception tEx)
{
tEx.printStackTrace();
}
}
}
I have also tried my LoginCredentials with get and set methods and
making the variables private, this made no difference. If someone could
point me in the right direction that would me most appropriated.
Scott
wsdl.wsdl
Description: application/wsdl
