当前位置:编程学习 > JAVA >>

envelope.getResponse()获取不到值

 public static SoapObject net(String NAMESPACE,String METHOD_NAME,String URL){
   SoapObject response = null;
       
       HttpTransportSE ht=new HttpTransportSE(URL);
       ht.debug=true;
       
       SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
       
       SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
       
       envelope.bodyOut=request;
        System.out.println("-------------");
       try {
ht.call(null, envelope);
System.out.println(">>>>>>>>>>>>>>");
if(envelope.getResponse()!=null){
System.out.println("+++++++++++");
response = (SoapObject) envelope.bodyIn;
    String result = response.getProperty(0).toString();
                System.out.println(result);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
       
       return response;
 
 
 }
      final static String NAMESPACE = "com.dao/show";
    final static String URL = "http://192.168.0.155:9991/Xfire/services/show";
    final static String METHOD_NAME="show"; 命名空间 URL --------------------编程问答-------------------- 我的也是。通过gprs 得不到数值
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,