本帖最后由 chenwenxiang 于 2013-05-23 16:52:03 编辑

解决方案 »

  1.   

    上面的问题解决了,是我 SOAP_ACTION  的值没填好,紧接着又有新问题但是又有新问题
    这是 我的服务器程序public class myio
    {
    public String get_result(String from)
    {
    return "张三是"+from;
    }
    }这是我新改的Android端程序
         
         public void getWeather(String cityName) { 
          try {
                SoapObject rpc = new SoapObject(NAMESPACE, METHOD_NAME); 
                rpc.addProperty("the_result", "白痴");
                
                SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                envelope.bodyOut = rpc;
                envelope.dotNet = true;
                envelope.setOutputSoapObject(rpc); 
                
                HttpTransportSE ht = new HttpTransportSE(URL);
                //AndroidHttpTransport ht = new AndroidHttpTransport(URL);
                ht.debug = true;
                ht.call(SOAP_ACTION, envelope);
                //ht.call(null, envelope);
                //SoapObject result = (SoapObject)envelope.bodyIn;
                //detail = (SoapObject) result.getProperty("getWeatherbyCityNameResult");
                detail =envelope.getResponse();
                 
                //System.out.println("result" + result);
                System.out.println("detail1:" + detail);
                System.out.println("detail2:" + detail.toString());
              //  Toast.makeText(this, detail.toString(), Toast.LENGTH_LONG).show();
                return;
               } catch (Exception e) {
                e.printStackTrace();
               }
         }
    但是,返回结果是:
    detail1:张三是NULL
    detail2:张三是NULL
    不是我期待的设置的值,再次求指教 
      

  2.   

    问题找到了  
    envelope.dotNet = true;
    应该设为false,       .net下才设置为true
    参考链接1:http://bbs.csdn.net/topics/370122236
    参考链接2:http://blog.sina.com.cn/s/blog_980024ca01015qxl.html