android wsdl通信遇到错误The constructor Service
PHP中文网
PHP中文网 2017-04-17 13:24:15
0
1
969

添加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)

PHP中文网
PHP中文网

认证0级讲师

Antworte allen(1)
Ty80

确认你的服务发布了吗?在浏览器中能查看到wsdl吗?
把server端和client端生成的错误代码贴出来看看。

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage