1
    SoapObject Request = new SoapObject (NAMESPACE, METHOD_NAME);

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(Request);
    envelope.dotNet = true;
    envelope.encodingStyle = SoapSerializationEnvelope.XSD;

    AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
    androidHttpTransport.debug = true;
    androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

    try {

    androidHttpTransport.call(SOAP_ACTION, envelope);
    } 
    catch (Exception e) {

    }

    response = (SoapObject) envelope.bodyIn;
    System.out.println("respone is " + response.toString());
    response1 = (SoapObject) response.getProperty(0);//getting error at this line....
    System.out.println("response1 "+response1.toString());
    return res;

取得エラー:

java.lang.RuntimeException: アクティビティ ComponentInfo を開始できません {com.example.wcf/com.example.wcf.MainActivity}: java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive

response.toString()

01-14 12:45:49.767: I/System.out(2060):

応答は次のとおりです。

GetProfilesResponse {
   GetProfilesResult=   {
      "ROWS":[
         {
            "ProfileId":"103",
            "Name":"henry_103",
            "DisplayName":"henry",
            "Age":"22",
            "ProfileDetail":"good looking",
            "CreatedDate":"12/27/2012 12:00:00 AM",
            "ModifiedDate":"",
            "DeletedFlag":"False",
            "ImageName":"Penguins.jpg",
            "ImageURL":"http://graycelltech.net/AlarmClock/UploadedFiles/Images/henry_103/Penguins.jpg"
         },
         {
            "ProfileId":"110",
            "Name":"jenifer_110",
            "DisplayName":"jenifer",
            "Age":"26",
            "ProfileDetail":"nice",
            "CreatedDate":"1/1/2013 12:00:00 AM",
            "ModifiedDate":"",
            "DeletedFlag":"False",
            "ImageName":"Koala.jpg",
            "ImageURL":"http://graycelltech.net/AlarmClock/UploadedFiles/Images/jenifer_110/Koala.jpg"
         },
         {
            "ProfileId":"113",
            "Name":"jokar_113",
            "DisplayName":"jokar",
            "Age":"30",
            "ProfileDetail":"nice looking",
            "CreatedDate":"1/1/2013 12:00:00 AM",
            "ModifiedDate":"",
            "DeletedFlag":"False",
            "ImageName":"Jellyfish.jpg",
            "ImageURL":"http://graycelltech.net/AlarmClock/UploadedFiles/Images/jokar_113/Jellyfish.jpg"
         }
      ]
   }   ;
}
4

2 に答える 2

0

これを試して:

response = (SoapObject) envelope.getResponse();

それ以外の

response = (SoapObject) envelope.bodyIn;
于 2013-01-19T14:06:52.193 に答える
0

以下を使用します

      SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
      String result = (String)resultsRequestSOAP.getProperty("Rows"); 
于 2013-01-14T08:06:38.003 に答える