这是我的Android main.java我从这里调用webservice。但我有一些问题,但我不知道哪个是失败的。我正在使用android调试器,但它在transpor.call()...
行中停止全部谢谢
package org.exa.prueba2android;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class Main extends Activity {
private static final String accionSoap="http://CartaWS.restaurante.org/showItems";
private static final String Metodo = "showItems";
private static final String namespace="http://CartaWS.restaurante.org";
private static final String url="http://192.168.2.5:8080/CartaWSPrueba/services/CartaWS.CartaWSHttpSoap11Endpoint/";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView) findViewById(R.id.text);
try{
SoapObject request= new SoapObject(namespace, Metodo);
//modelo sobre
SoapSerializationEnvelope sobre = new SoapSerializationEnvelope(SoapEnvelope.VER11);
sobre.dotNet = true;
sobre.setOutputSoapObject(request);
HttpTransportSE transporte = new HttpTransportSE(url);
//LLAMADA
// **HERE IS THE PROBLEM**
transporte.call(accionSoap, sobre)`;
//Result
SoapPrimitive result = (SoapPrimitive)sobre.getResponse();
tv.setText("BEBIDAS: "+result.toString());
} catch (Exception e){}
}
}
我正在使用Tomcat7,axis2,java,android,ksoap 2.6.1。 Android调试器在此行停止
transporte.call(accionSoap, sobre);
或者下一个
SoapPrimitive result = (SoapPrimitive)sobre.getResponse();
我是新来的,谢天谢地。