I am trying to implement an application which uses RESTFUL webservices.
I got my session id in my first activity. Now i need to maintain the session when i am navigating to other activities. Now I am getting RECEIVED AUTHENTICATION CHALLEGE IS NULL.
Can anyone help me?
I am passing the sessionid from first activity to second activity.
My second activity :
public class SetHome extends Activity {
String applicationId,sessionId;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
System.out.println("Entered thissss");
applicationId = getIntent().getExtras().getString("applicationId");
System.out.println("Application id is--->" + applicationId);
sessionId = getIntent().getExtras().getString("sessionId");
System.out.println("SessionId is--->" + sessionId);
HttpConnectionRequest conn = new HttpConnectionRequest();
conn.execute();
}
private class HttpConnectionRequest extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
String url = "url/application/"
+ applicationId;
try {
WebServiceClient client = new WebServiceClient();
HashMap<String, String> hm = new HashMap<String, String>();
hm.put("CONTENT-TYPE", "application/xml");
hm.put("Accept", "application/xml");
String sessionId;
String applicationId;
WebServiceResponse res = client.doGet(new URL(url), hm);
int resCode = res.getResponseCode();
String response = res.getResponseContent();
System.out.println(res);
*/
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
public static String getValue(String xpath_expr, String xml) {
return BaseUtil.xpath_result(xpath_expr, xml);
}
public void relay(View v) {
}
public void tasks(View v) {
}
public void applications(View v) {
HttpConnectionRequest conn = new HttpConnectionRequest();
conn.execute();
}
}
Now I am getting Received authentication challenge is null.