When i debug my application when the  httpGet = new HttpGet(getUrl);
is executed nothing happens :/

My WebGet function looks like:


  public String webGet(String methodName, Map<String, String> params)
{
        String getUrl = webServiceUrl + methodName;

        int i = 0;
        for (Map.Entry<String, String> param : params.entrySet())
        {
                if(i == 0){
                        getUrl += "?";
                }
                else{
                        getUrl += "&";
                }

                try {
                                getUrl += param.getKey() + "=" +
URLEncoder.encode(param.getValue(),"UTF-8");
                        } catch (UnsupportedEncodingException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }

                i++;
        }

        httpGet = new HttpGet(getUrl);
-----------------------------------------------------> when this
executes nothing else is executed, like i would exit function...

        Log.e("WebGetURL: ",getUrl);

        try {
            response = httpClient.execute(httpGet);
        } catch (Exception e) {
            Log.e("Groshie:", e.getMessage());
        }

        // we assume that the response body contains the error message
        try {
                if(response != null)
            ret = EntityUtils.toString(response.getEntity());
                else
                        ret = "error";
        } catch (IOException e) {
            Log.e("Groshie:", e.getMessage());
        }

        return ret;
    }



I call webservice function like:


 WebService logInService = new WebService("172.17.1.62:58207/
JSON.asmx");


                Map<String, String> params = new HashMap<String, String>();
                params.put("username", "USERNAME");
                params.put("password", "1234");
                logInService.webGet("LogInUser", params);
---------------------------------------->LogInUser is function in
c# .net web service
                String response1 = logInService.webGet("LogInUser", params);


and my c# login function looks like:


  public void LogInUser() {
            string username = Context.Request.Params["username"];
            string password = Context.Request.Params["password"];

            if (username != null && password != null) {
     .
     .
     .
     .
     .

             }

        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to