【问题标题】:Issue with Ksoap when i trying t connect to my webservice当我尝试连接到我的网络服务时出现 Ksoap 问题
【发布时间】:2013-02-10 19:26:18
【问题描述】:

我正在尝试通过 ksoap 连接到我的网络服务并给我这个错误

找不到{}的调度方法

我知道这两个问题都有相同的错误,他们没有正确放置命名空间或添加正确的方法名称,这里我添加了正确的命名空间,而且它现在工作的正确方法也不是,那就是问题,这里是调用webservice的代码

ObjConexion 对象 = 新 ObjConexion();

SoapObject request = new SoapObject(object.NameSpace(), "login");
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    Bundle extras = getIntent().getExtras();



    /*PropertyInfo namePro =new PropertyInfo();
    namePro.setName("_name");
    //namePro.setValue(extras.getString("name"));
    namePro.setValue("sdfasdfsadf");
    namePro.setType(String.class);
    request.addProperty(namePro);
    */
    PropertyInfo emailPro =new PropertyInfo();
    emailPro.setName("email");
    //emailPro.setValue(extras.getString("mail"));
    emailPro.setValue("asdfsdfasdfasdf");
    emailPro.setType(String.class);
    request.addProperty(emailPro);

    PropertyInfo passwordPro =new PropertyInfo();
    passwordPro.setName("password");
    //passwordPro.setValue(((EditText) findViewById(R.id.passwd)).getText().toString());
    passwordPro.setValue("asdkasdkfkasdf");
    passwordPro.setType(String.class);
    request.addProperty(passwordPro);


    HttpTransportSE androidHttpTransport = new HttpTransportSE("WSDLPath");
    androidHttpTransport.debug = true;
    try {
        androidHttpTransport.call("", envelope);
        SoapPrimitive result = (SoapPrimitive)envelope.getResponse();   

    }catch (Exception e) {
        e.printStackTrace();

        Toast.makeText(this,e.getMessage().toString(),Toast.LENGTH_LONG).show();
    }

【问题讨论】:

    标签: android wsdl ksoap2


    【解决方案1】:

    你还没有输入方法名:

    androidHttpTransport.call("", envelope);
    

    输入方法名:

    androidHttpTransport.call(METHOD_NAME, envelope);
    

    首选以下网址,您可以在其中获得答案。这个问题是我问的。解决后我把答案给别人用。

    create soap envelope with security header in android using ksoap2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-26
      • 1970-01-01
      • 2021-08-19
      相关资源
      最近更新 更多