-1
public class main extends Activity {

    /** Called when the activity is first created. */
    private static String SOAP_ACTION = "http://footballpool.dataaccess.eu/data/TopGoalScorers";
    private static String NAMESPACE = "http://footballpool.dataaccess.eu";
    private static String METHOD_NAME = "TopGoalScorers";
    private static String URL = "http://footballpool.dataaccess.eu/data/info.wso?WSDL";

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    request.addProperty("iTopN", 5);

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);

    // Make the soap call.
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    //AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport("http://www.google.co.in");

     try {
        // this is the actual part that will call the webservice
        androidHttpTransport. call(SOAP_ACTION, envelope);
     } catch (Exception e) {
        e.printStackTrace();
        Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
     }
    // Get the SoapResult from the envelope body.
    SoapObject result = (SoapObject) envelope.bodyIn;
  }
}
SilentKiller
  • 6,944
  • 6
  • 40
  • 75

1 Answers1

3

Have you added INTERNET permission to your manifest file?

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Mohammed Azharuddin Shaikh
  • 41,633
  • 14
  • 96
  • 115