Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9167675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:26:55+00:00 2026-06-17T15:26:55+00:00

I have websevice: http://nclex.testshell.net/api/forums/1?type=json which is placed in json lint formatter,but data not coming

  • 0

I have websevice: “http://nclex.testshell.net/api/forums/1?type=json” which is placed in “json lint” formatter,but data not coming from webservice. But this webservice is placed in browser directly then data will come.This is a Dot net webservice.But programatically I am getting response:”zero”.This is my asynchtask class:

class ListDoback extends AsyncTask<URL, Integer, Long>{     
protected void onPreExecute() 
{
try
{
                                                            pgrDialog=MyProgressDialog.show(ForumsDetailsActivity.this, null,null);
}
catch(Exception e){}
}
protected Long doInBackground(URL... arg0) 
{
                       if(!CheckInternetConnection.isOnline(ForumsDetailsActivity.this))
{                   
pgrDialog.dismiss();                    
new AlertDialog.Builder(ForumsDetailsActivity.this).setTitle(DataUrls.dialogtitle)
                            .setMessage(DataUrls.dialogmsg)
                              .setPositiveButton(DataUrls.dialogbutton, new DialogInterface.OnClickListener() 
                            {                                                  public void onClick(DialogInterface dialog, int whichButton)  {
finish();       }
}).show();
cancel (true);
}
else
{
Log.e("forum id:",DataUrls.strForumId);

            strResponseReply=UrltoValue.getValuefromUrl(DataUrls.replyforum+DataUrls.strForumId+"type=json");
                               Log.e("check",DataUrls.replyforum+DataUrls.strForumId+"?type=json");
                            Log.e("response:",strResponseReply);

                            try {
                                JSONObject jsonObject=new JSONObject(strResponseReply);
                                JSONObject jObject=jsonObject.getJSONObject("data");
                                jsonArray=jObject.getJSONArray("Reply");

                                strReplyId=new String[jsonArray.length()];
                                strForumId=new String[jsonArray.length()];
                                strUserId=new String[jsonArray.length()];
                                strUserName=new String[jsonArray.length()];
                                strUserPicture=new String[jsonArray.length()];
                                strNickname=new String[jsonArray.length()];
                                strAgo=new String[jsonArray.length()];
                                strPostTopic=new String[jsonArray.length()];

                                for(int i=0;i<jsonArray.length();i++){
                                    strForumId[i]=jsonArray.getJSONObject(i).getString("ForumId");
                                    strUserId[i]=jsonArray.getJSONObject(i).getString("UserId");
                                    strUserName[i]=jsonArray.getJSONObject(i).getString("UserName");
                                    strNickname[i]=jsonArray.getJSONObject(i).getString("NickName");
                                    strAgo[i]=jsonArray.getJSONObject(i).getString("Ago");
                                    strUserPicture[i]=jsonArray.getJSONObject(i).getString("UserPicture");
                                    strPostTopic[i]=jsonArray.getJSONObject(i).getString("posttopic");
                                    strReplyId[i]=jsonArray.getJSONObject(i).getString("ReplyId");

                                    Log.e("Nick name:",strNickname[i]); 
                                    Log.e("post topic:",strPostTopic[i]);
                                }
                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                        }                 
                    return null;
                }
                protected void onProgressUpdate(Integer... progress) 
                {

                }
                protected void onPostExecute(Long result) 
                {
                    Log.e("postexecute","onpostexecute");
                    if(strResponseReply.equals("zero")||jsonArray.length()==0)
                    {
                        Toast.makeText(ForumsDetailsActivity.this, "No forums found", Toast.LENGTH_SHORT).show();
                    }
                    try
                    {

                        lvPostReply.setAdapter(new ForumsReplyList(ForumsDetailsActivity.this,R.layout.forumreplyitem,strNickname,strPostTopic,strUserPicture,strAgo));
                    }
                    catch(Exception e)
                    {
                        pgrDialog.dismiss();
                    }
                    pgrDialog.dismiss();
                    Log.e("hi","hi");
                }
            } //closing BarPicsDoback process.

Please help me.Thanks In Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:26:56+00:00Added an answer on June 17, 2026 at 3:26 pm

    Use this code in your asynchronous class
    and you will get the response

    try
    {
         response = httpclient.execute(httpget);
         Log.e("Response", "Status:[" + response.getStatusLine().toString() + "]");
         Log.e("check",DataUrls.replyforum+DataUrls.strForumId+"?type=application/json");
         HttpEntity entity = response.getEntity();
    
         if (entity != null) 
         {                                              
            InputStream instream = entity.getContent();
            strResponseReply = RestClient.convertStreamToString(instream);
            Log.i("Result", "Result of converstion: [" + strResponseReply + "]");
            instream.close();
            return result;
         }
     } 
    catch (ClientProtocolException e) 
    {
         Log.e("REST", "There was a protocol based error", e);
    }
    catch (IOException e) 
    {
         Log.e("REST", "There was an IO Stream related error", e);
    }              
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this url which is JSON webservice http://ws.geonames.org/weatherJSON?north=90&south=-9.9&east=-22.4&west=55.2 I need to write a
I have a WCF REST Service which accepts a JSON string One of the
I have a url which normally points to a postcode lookup webservice: http://localhost/afddata.pce?Serial=xxxxxx&Password=<PASSWORD>&UserID=<UNAME>&Data=Address&Task=PropertyLookup&Fields=List&MaxQuantity=200&Lookup=BD1+3RA I
I have following scenario: alt text http://static.zooomr.com/images/7579022_e64808b855_o.png We have a WebService which poses as
I have a webservice returning jsonp format. here's the code: $(document).ready(function(){ $.getJSON(http://api.tubeupdates.com/?method=get.status&lines=central,victoria&return=name&jsonp=?, function (result){
Hi i have a webservice like this <audio title=Terry Waychuk Pure2010 audio=http://www.boodang.com/api/audio/**Terry_Waychuk**/Terry_Waychuk_Pure2010.mp3 description=Terry Waychuk
I have a Webservice(API) which I am passing to the DOM parser and it
I have a webservice method which described as follow: POST /servis.asmx HTTP/1.1 Host: webservice.myproject.com
I have a webservice which return this kind of json object : { dossiers:
I have to map a REST Webservice URL like http://server:8080/application/service/customer/v1 to createCustomer method in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.