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

添加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级讲师

全部回覆(1)
Ty80

確認你的服務發佈了嗎?在瀏覽器中能查看到wsdl嗎?
把server端和client端產生的錯誤碼貼出來看看。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板