问题是出在移动终端程序上,我写的测试代码如下:
import java.rmi.RemoteException;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.xml.rpc.Stub;
import LearnTra.IHi_Stub;
public class Learn extends MIDlet {
private
String serviceURL = "http://localhost/mdl/prjhi.dll/soap/ihi";
IHi_Stub hisv;
Form form;
public Learn() {
super();
}
protected void startApp() throws MIDletStateChangeException {
hisv = new IHi_Stub();
hisv._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
serviceURL);
hisv._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, new
Boolean(true));
form = new Form("Hello World"
;
Display.getDisplay(this).setCurrent(form);;
Thread th = new Thread(new GetEmpInfoTask());
th.start();
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
public class GetEmpInfoTask implements Runnable {
public void run() {
String str="";
form.append("初始..."
;
try {
str=hisv.getHi(0);
} catch (RemoteException e) {
str="RemoteException";
} catch (Exception e) {
str="Exception";
}
form.append("Result:" + str);
}
}
}