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 6337205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:12:30+00:00 2026-05-24T19:12:30+00:00

I am totally new to C#. I have one service method //actual method public

  • 0

I am totally new to C#.
I have one service method

    //actual method
    public DataTable LoadDownLoadTablesData(string strBusinessUnit, string strExecutive, string strTableName, ref string strDate, string strTerritoryCode, string strUField1, string strUField2, string strUFeild3)
    {            
        DataTable ds = new DataTable();
        try 
            {
                XontPDAServiceDAL vu = new XontPDAServiceDAL();
                if (vu.validateExecutive(strBusinessUnit, strExecutive) == true)
                {
                    DownloadFetchBLL wmd = new DownloadFetchBLL();
                    strDate = DateTime.Now.ToString();
                    ds = wmd.LoadDownLoadTableData(strBusinessUnit, strExecutive, strTableName, strTerritoryCode, strUField1, strUField2, strUFeild3);
                }
                else
                {
                    throw new FaultException("Executive Not Active in the system.");
                }
        }
        catch (FaultException) { }
        catch (Exception ex)
        {
            throw new FaultException("Database Server is Not Responding." + ex.Message);
        }

        return ds;
    }

    //Converting datatable to String type
    public string LoadDownLoadTablesDataJson(string strBusinessUnit, string strExecutive, string strTableName, ref string strDate, string strTerritoryCode, string strUField1, string strUField2, string strUFeild3)
    {
        DataTable dtDownloadJson = new DataTable();
        dtDownloadJson = this.LoadDownLoadTablesData(strBusinessUnit, strExecutive, strTableName, ref strDate, strTerritoryCode, strUField1, strUField2, strUFeild3);
        return this.ConverTableToJson(dtDownloadJson);
    }


    //Converting table to json
    public String ConverTableToJson(DataTable dtDownloadJson)
    {
        string[] StrDc = new string[dtDownloadJson.Columns.Count];
        string HeadStr = string.Empty;

     //   if (dtDownloadJson.Columns.Count > 0)
      //  {

            for (int i = 0; i < dtDownloadJson.Columns.Count; i++)
            {

                StrDc[i] = dtDownloadJson.Columns[i].Caption;
                HeadStr += "\"" + StrDc[i] + "\" : \"" + StrDc[i] + i.ToString() + "¾" + "\",";
            }
            if (HeadStr.Length > 0)
            {
                HeadStr = HeadStr.Substring(0, HeadStr.Length - 1);
                StringBuilder Sb = new StringBuilder();
                Sb.Append("{\"" + dtDownloadJson.TableName + "\" : [");

                for (int i = 0; i < dtDownloadJson.Rows.Count; i++)
                {

                    string TempStr = HeadStr;
                    Sb.Append("{");

                    for (int j = 0; j < dtDownloadJson.Columns.Count; j++)
                    {
                        TempStr = TempStr.Replace(dtDownloadJson.Columns[j] + j.ToString() + "¾", dtDownloadJson.Rows[i][j].ToString());
                    }

                    Sb.Append(TempStr + "},");
                }

                Sb = new StringBuilder(Sb.ToString().Substring(0, Sb.ToString().Length - 1));
                Sb.Append("]}");
                return Sb.ToString();
            }else
            {
                return "0";
            }
       // }else{
       //     return "0";
       // }
    }

This LoadDownLoadTablesData() reference variable is there.

I have to pass call this LoadDownLoadTablesDataJson(….) from Android,

I called like this way;

    // ksoap2 calling wcf
public SoapPrimitive soapPrimitiveData(String method_name1, String soap_action1, String NAMESPACE, String APPURL ,String tablename ) throws IOException,XmlPullParserException {

    SoapPrimitive responses = null;
    SoapObject request = new SoapObject(NAMESPACE, method_name1); // set up

    request.addProperty("strBusinessUnit", "HEMA");
    request.addProperty("strExec", "4515");
    request.addProperty("strTableName", "RD.AlternativeProductHeader");
    // after login we will get these fields value
    request.addProperty("strDate", "2000-04-29");
    request.addProperty("TerritoryCode", "KAND");

    request.addProperty("strUField1", "");
    request.addProperty("strUField2", "");
    request.addProperty("strUField3", "");


    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); // put all required data into a soap// envelope
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    AndroidHttpTransport httpTransport = new AndroidHttpTransport(APPURL);
    httpTransport.debug = true;
    try {
        httpTransport.call(soap_action1, envelope);
        responses = (SoapPrimitive) envelope.getResponse();

        Log.w("log_tag", "@@@@ 218 @@@@" + responses);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return responses;
}

This always return “0”. But when I run through dummy testing C# site, It return some result.
See

  String da1 = "2000-04-29";
        String s = client.LoadDownLoadTablesDataJson("HEMA", "4515", "RD.AlternativeProductHeader", ref da1, "KAND", "", "", "");
        Label1.Text = s;

output is :

{"Table1" : [{"TableName" : "LoadDistributor","Description" : "Distributor ","MandatoryFlag" : "1","Status" : "","Priority" : "0"},{"TableName" : "LoadPrice","Description" : "Price ","MandatoryFlag" : "1","Status" : "","Priority" : "0"}]}

I have confuse how we want to pass reference type using Android?

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-05-24T19:12:32+00:00Added an answer on May 24, 2026 at 7:12 pm

    Should have give like this request.addProperty("strExecutive", "4515");
    not request.addProperty("strExe", "4515");

    I shoube be service argument name.Can’t give different name

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally new to Cake. I have this table named Content and another one named
I'm totally new in wordpress, and i have one blog. I want to change
I have a RESTful web service deployed at http://example.com/v1/SomeResource . One day, a new
I am totally new to HTML5. Previously I have developed Silverlight and ASP .Net
first of all I'm totally new to FAST but I already have a couple
ok, I'm totally new to SOLR and Lucene, but have got Solr running out-of-the-box
I have written a REST web service with Jersey Server (that totally rocks !).
I have two jsp(one is main page, another one is new window) and single
I have a really simple jQuery problem (I guess). But im totally new to
I have to support a website developed in umbraco. I am totally new to

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.