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"
}
]
} ;
}