Hello !
I've got the following problem:
The webservice
[System.Web.Services.WebMethod]
public int Add(int i, int j) {
return i + j;
}//Add
does not get the parameters I tried to send in my client code.
The client
public static void main(String[] args) {
try {
System.out.println("STARTING WEBSERVICE CALL.");
// build request string
Integer i = new Integer(10);
Integer j = new Integer(20);
SoapObject rpc = new SoapObject("http://tempuri.org", "Add");
rpc.addProperty("i", i);
rpc.addProperty("j", j);
String result = new
HttpTransportSE("http://localhost/WebApplication/GroupDataWebService.asmx",
"http://tempuri.org/Add").call(rpc).toString();
System.out.println(result);
} catch (Exception e) {
e.printStackTrace ();
}//catch
System.out.println("END OF WEBSERVICE CALL.");
}//main
... gets "0" in return all the time. When I return another number instead of
"i + j" it works, so the problem is that my parameters (10 and 20) both
appear to the webservice as "0".
Any clue what I did wrong ?
many thanks, R.K.
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
|