android 开发wenservice问题(java.rmi.RemoteException cannot be resolved)
package com.illa.adrdp.one;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.TextView;
public class AdrdpOneSix extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tx = new TextView(this) ;
String endPoint = "http://localhost:8888/test/services/SayHello" ;
Service service = new Service() ;
Call call = (Call)service.createCall() ;
call.setTargetEndpointAddress(new java.net.URL(endPoint)) ;
call.setOperationName("getName") ;
String str = null ;
try {
str = (String)call.invoke(new Object[]{"高建华"}) ;
}catch(Exception e) {
e.printStackTrace() ;
}
tx.setText(str) ;
setContentView(tx);
}
}
红色部分有problem,
- The method invoke(Object[]) from the type Call refers to the missing type RemoteException
- The type java.rmi.RemoteException cannot be resolved. It is indirectly referenced from required .class files
新学android 这样的问题是为什么呢