0
是新如何調用Android中的.Net Web服務正在實施 我的代碼,請如何調用的.NET Web服務在Android應用程序在Android應用程序使用Eclipse
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv = (TextView)findViewById(R.id.textView1);
call();
}
public void call()
{
try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("hello", "world");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug=true;
androidHttpTransport.call(SOAP_ACTION, envelope);
// SoapPrimitive sp=(SoapPrimitive)envelope.getResponse();
Object result = (Object)envelope.getResponse();
tv.setText(result.toString());
}
catch (Exception e)
{
tv.setText(e.getMessage());
}
}
但是我得到錯誤定界符丟失,還操作超時,並請人幫助我如何使用Eclipse
感謝 @Lakshmi
調試Android應用程序