在多发性阵列数据Retreiving ksoap2在android系统问题阵列、多发性、数据、问题

由网友(宅若久时天然呆°)分享简介:嗨亲爱的我面临的一个律问题。结果其实我有一个服务的搜索雇员..该服务给我造成多发性阵列的形式,如:hi dear i am facing a lil problem.actually i have a service for search an employee.. that service gives me re...

嗨亲爱的我面临的一个律问题。结果其实我有一个服务的搜索雇员..该服务给我造成多发性阵列的形式,如:

hi dear i am facing a lil problem. actually i have a service for search an employee.. that service gives me result in mutiple array form like:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
  <ns1:searchResponse xmlns:ns1="urn:abcdwsdl">
 <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":[6]">
    <item xsi:type="xsd:string">success</item>
    <item xsi:type="xsd:string">Search results retrieved for *</item>
    <item xsi:type="xsd:">
       <item>
          <ad_id xsi:type="xsd:string">2</ad_id>
          <fname xsi:type="xsd:string">abcr</ad_text>
          <lname xsi:type="xsd:string">def</location>
          <phone xsi:type="xsd:float">123456</lati>
          <address xsi:type="xsd:float">America</longi>
       </item>
       <item>
          <ad_id xsi:type="xsd:string">12</ad_id>
          <fnamet xsi:type="xsd:string">test user</ad_text>
          <lname xsi:type="xsd:string">hello</location>
          <phone xsi:type="xsd:float">987654543</lati>
          <address xsi:type="xsd:float">England</longi>
       </item>
    </item>
    <item xsi:type="xsd:int">2</item>
    <item xsi:type="xsd:int">0</item>
    <item xsi:type="xsd:int">0</item>
 </return>
  </ns1:searchResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>  

现在我加入了以下code:

Now i added the following code:

androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject result=(SoapObject) envelope.getResponse();

但GETRESPONSE给了我以下错误:

But getResponse Gives me the following Error:

in catch
java.lang.ClassCastException: java.util.Vector
at org.test.search.FirstActivity.loginMethod(FirstActivity.java:74)
 at org.test.search.FirstActivity.onCreate(FirstActivity.java:26)
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
 at android.app.ActivityThread.access$2300(ActivityThread.java:125)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:123)
 at android.app.ActivityThread.main(ActivityThread.java:4627)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:521)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 at dalvik.system.NativeStart.main(Native Method)

请朋友帮助在于此。我已经问我的问题上的帖子结果得到ksoap2数据Anroid的

Please friends Help in this. i already have asked my question on the post get data from ksoap2 in anroid

推荐答案

envelope.getResponse()可以返回一个SoapObject或SoapPrimitive /矢量,我想你在SoapObject

envelope.getResponse() can return a SoapObject, or a SoapPrimitive/Vector, I think you're casting a Vector on a SoapObject

阅读全文

相关推荐

最新文章