添加wsimport 方法生成的java文件后出现下面的错误:
第一个错误:The constructor Service(URL, QName, WebServiceFeature[]) is undefined
第二个错误:The method getPort(QName, Class) in the type Service is not applicable for the arguments (QName, Class,
WebServiceFeature[])
上面的错误已经没有了,下面是我的代码
public class MainActivity extends Activity {
private TextSwitcher textswitch;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.textswitch=(TextSwitcher) findViewById(R.id.textSwitcher1);
this.textswitch.setFactory(new ViewFactoryImp());
new Thread() {
public void run() {
try {
Thread.sleep(1000);
UserOperService v = new UserOperService();
String ret = v.getUserOperServer().operReqEn("AUTH","13977618061,780121");
MainActivity.this.textswitch.setText(ret);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
MainActivity.this.textswitch.setText(e.toString());
}
}
}.start();
}
显示没错误,运行起来崩溃。log如下:
W/System.err( 2136): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
W/System.err( 1795): Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/System.err( 1795): Caused by: libcore.io.ErrnoException: setsockopt failed: ENODEV (No such device)
Have you confirmed that your service has been released? Can wsdl be viewed in the browser?
Post the error codes generated by the server and client.