1. Download our Official Android App: Forums for Android!

Apps Give values to a web service

Discussion in 'Android Development' started by the phantom, Nov 30, 2011.

  1. the phantom

    the phantom Newbie
    Thread Starter
    Rank:
    None
    Points:
    35
    Posts:
    22
    Joined:
    Oct 6, 2011

    Oct 6, 2011
    22
    0
    35
    Hello all,

    I'm building an app which connects to various web services via ksoap2. Most of the services provide some sort of response in the form of a string which I use in the app, however one of the services doesn't actually provide a response to be used it simply takes the inputted vales and the .net service updates the relevant DB tables.

    Would the set up and call to the service be the same as to the other services that I get information back from? My code is as follows;

    SoapObject Request =
    new SoapObject(NAMESPACE, METHOD_NAME);

    Request.addProperty(
    "Sub_Seq",Sub_Seq);

    Request.addProperty(
    "Start_Time",startDate.toString());

    Request.addProperty(
    "End_Time",endDate.toString());

    Request.addProperty(
    "Status",Status_Id);



    SoapSerializationEnvelope envelope =
    new SoapSerializationEnvelope(SoapEnvelope.VER11);

    envelope.
    dotNet = true;

    envelope.setOutputSoapObject(Request);


    aht =
    new AndroidHttpTransport(URL);




    try {






    aht.call(
    SOAP_ACTION, envelope);


    }

    catch (Exception e)

    {

    e.printStackTrace();




    }
     

    Advertisement

  2. jiminaus

    jiminaus Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    190
    Joined:
    Oct 27, 2011

    Oct 27, 2011
    190
    36
    63
    Sydney, Australia
    Is the web service sending back a 200 or 202 HTTP status code in response to the post? According to SOAP 1.2 specification for the SOAP HTTP binding, a 200 ("OK") response implies the response body contains a SOAP envelope. Only a 202 ("Accepted") response may have an empty response body.
     

Share This Page

Loading...