-1

I want to save data into sql server from eclips is there any solution? Is it possible with web service or json.. i have made one asp.net website and made web service for method...and cath that data into eclips by json...so now how to cath data from elips?

shivani patel
  • 225
  • 1
  • 8
  • 22

2 Answers2

0

I am used belove code for get data from asp.net SOAP webservice in android try this

 public static String SOAP_NAMESPACE = "http://myweb.com/";
public static String SOAP_METHOD_GetQuestionAnswer = "GetQuestionAnswer";

// GetQuestionAnswer Method
public static String GetQuestionAnswer(String GameIDValue, String QuestionIDValue) {
    String responce = null; 

    SoapObject request = new SoapObject(SOAP_NAMESPACE, SOAP_METHOD_GetQuestionAnswer);

    PropertyInfo GameID = new PropertyInfo();
    PropertyInfo QuestionID = new PropertyInfo();

    GameID.setName("gameid");
    GameID.setValue(GameIDValue);

    QuestionID.setName("queid");
    QuestionID.setValue(QuestionIDValue);

    request.addProperty(GameID);
    request.addProperty(QuestionID);

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE aht = new HttpTransportSE(SOAP_URL);
    try {
        aht.call(SOAP_ACTION_GetQuestionAnswer, envelope);
        SoapPrimitive LoginResult;
        LoginResult = (SoapPrimitive)envelope.getResponse();
        System.out.println("=================GetQuestion Results: "+LoginResult);
        System.out.println(LoginResult.toString());
        responce = LoginResult.toString();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (XmlPullParserException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return responce;
}
Hemantvc
  • 2,111
  • 3
  • 30
  • 42
0

In android you can create a JSON object and POST in to your asp web service, which eventually send data to your remote sql database.

JSONObject obj = new JSONObject();
obj.put("val1",val1);
obj.put("val2",val2);
obj.put("val3",val3);
Robin Chander
  • 7,225
  • 3
  • 28
  • 42