diff options
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/samples/store-android/src/services/ShoppingCartProxy.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/branches/sca-java-1.x/samples/store-android/src/services/ShoppingCartProxy.java b/branches/sca-java-1.x/samples/store-android/src/services/ShoppingCartProxy.java index 872db654a4..a451f00060 100644 --- a/branches/sca-java-1.x/samples/store-android/src/services/ShoppingCartProxy.java +++ b/branches/sca-java-1.x/samples/store-android/src/services/ShoppingCartProxy.java @@ -3,10 +3,12 @@ package services; import org.json.JSONException; import org.json.JSONObject; +import android.util.Log; + import services.json.rpc.JSONRpc; public class ShoppingCartProxy { - private static final String jsonRPCTotalServiceURI = "http://192.168.1.104:8080/ShoppingCart/Total"; + private static final String jsonRPCTotalServiceURI = "http://192.168.1.102:8080/ShoppingCart/Total"; private static final String jsonRPCTotalRequest = "{\"id\": 4, \"method\": \"Service.getTotal\", \"params\": []}"; public Item[] getItems() { @@ -28,15 +30,18 @@ public class ShoppingCartProxy { public String getTotal() { String total = ""; JSONObject json = null; + Log.e("TUSC", "getting total"); try { json = JSONRpc.invoke(jsonRPCTotalServiceURI, jsonRPCTotalRequest); + Log.e("TUSC", "Request OK"); if(json != null) { - total = json.getString("result"); + total = json.getString("result"); + Log.e("TUSC", "Total: "+total); } } catch (JSONException e) { - e.printStackTrace(); + Log.e("TUSC",e.getMessage()); } return total; |