Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

android - java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive? -


i calling web service android client application. after getting response when trying display getting classcastexception. following code:

public void onclick(view v) {   setcontentview(r.layout.report);   soapobject request = new soapobject(namespace, method_name);   epcdetails epcdetails=new epcdetails();   epcdetails.setepcid(input_val.gettext().tostring());          request.addproperty("id", id         soapserializationenvelope sse=new soapserializationenvelope(soapenvelope.ver11);         sse.setoutputsoapobject(request);          sse.addmapping(namespace,          productdetailsrequest.productdetailsrequest.getsimplename(),         productdetailsrequest.productdetailsrequest);          sse.implicittypes=true;         sse.setaddadornments(false);         androidhttptransport aht=new androidhttptransport(url);          try          {          aht.call(soap_action, sse);          soapobject response= (soapobject) sse.getresponse();          item_code.settext((charsequence)(response.getproperty(6)));          desc.settext((charsequence) (response.getproperty(5)));          price.settext(calc_price.tostring());          } catch (ioexception e)          {          e.printstacktrace();         } catch (xmlpullparserexception e)         {           e.printstacktrace();        } 

i getting exception @ item_code.settext((charsequence)(response.getproperty(6)));

12-20 19:26:12.864: error/androidruntime(811): fatal exception: main 12-20 19:26:12.864: error/androidruntime(811): java.lang.classcastexception: org.ksoap2.serialization.soapprimitive 12-20 19:26:12.864: error/androidruntime(811):     @ com.truevue.modules.report.mainsimulation.onclick(mainsimulation.java:123) 12-20 19:26:12.864: error/androidruntime(811):     @ android.view.view.performclick(view.java:2408) 12-20 19:26:12.864: error/androidruntime(811):     @ android.view.view$performclick.run(view.java:8816) 12-20 19:26:12.864: error/androidruntime(811):     @ android.os.handler.handlecallback(handler.java:587) 12-20 19:26:12.864: error/androidruntime(811):     @ android.os.handler.dispatchmessage(handler.java:92) 12-20 19:26:12.864: error/androidruntime(811):     @ android.os.looper.loop(looper.java:123) 12-20 19:26:12.864: error/androidruntime(811):     @ android.app.activitythread.main(activitythread.java:4627) 12-20 19:26:12.864: error/androidruntime(811):     @ java.lang.reflect.method.invokenative(native method) 12-20 19:26:12.864: error/androidruntime(811):     @ java.lang.reflect.method.invoke(method.java:521) 12-20 19:26:12.864: error/androidruntime(811):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) 12-20 19:26:12.864: error/androidruntime(811):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) 12-20 19:26:12.864: error/androidruntime(811):     @ dalvik.system.nativestart.main(native method) 

please suggest soln asap.

regards, rahul

because type of webservice return string ,so can solve way:

object  response=  sse.getresponse();   

when webservice return values type byte[] ,you can it

soapobject response=(soapobject)envelope.bodyin; 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -