Я хочу создать соединение с веб-службами с помощью KSOAP2, я уже сделал код и его получение ошибки. Поэтому, пожалуйста, предложите мне, где я делаю неправильно. Также мне нужна помощь в Интернете -service, Что такое пространство имен, метод, который мы называем, soap_action, url, а также некоторые из методов, которые мы используем в веб-сервисах. Я искал много, но не нашел полного описания о веб-сервисахВеб-службы на Android с помощью KSOAP
public class Web_ServicesActivity extends Activity {
private static String SOAP_ACTION = "http://service.fun2shoot.com/getLive";
private static String NAMESPACE = "http://service.fun2shoot.com/";
private static String METHOD_NAME = "getLive";
private static String URL = "http://119.82.75.91:8084/Fun2Shoot-WebService/Fun2ShootAndroid?wsdl";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
System.out
.println("After mail******************************************");
// Initialize soap request + add parameters
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
System.out.println("****************After Request call");
// Use this to add parameters
// request.addProperty("Parameter","Value");
// Declare the version of the SOAP request
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
// Needed to make the internet call
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
// this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION, envelope);
} catch (Exception e) {
e.printStackTrace();
}
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject) envelope.bodyIn;
if (result != null) {
TextView t = (TextView) this.findViewById(R.id.tv);
System.out
.println("***************************************Inside null condition");
// Get the first property and change the label text
t.setText("SOAP response:\n\n" + result.getProperty(0).toString());
}
}
}
14 строка 8 столбца вы используете неправильный метод, если знаете, что я имею в виду. – Hauleth
означает, что вы можете сказать мне вкратце ............ – Jay
Какая ошибка вы получаете? – AndroGeek