android - XStream No field found exception -
hi have tried lot not able find out doing wrong in aliasing tags, xml response this:
<ns1:redcustomerviewresponse soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://tempuri.org/weblink"> <jobcard xsi:type="ns3:array" ns3:arraytype="ns2:redcustviewdao[1]" xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/"> <additionalrepair xsi:type="xsd:string">n/a</additionalrepair> <custcomplaint xsi:type="xsd:string">service</custcomplaint> <custname xsi:type="xsd:string">baban deokar</custname> <expdeliverydate xsi:type="xsd:string">17/07/2014</expdeliverydate> <hours xsi:type="xsd:string">600</hours> <jobcardno xsi:type="xsd:string">sd</jobcardno> <jobcarddate xsi:type="xsd:string">17/07/2014</jobcarddate> <jobcloseddate xsi:type="xsd:string">18/07/2014</jobcloseddate> <jobsource xsi:type="xsd:string">normal-workshop</jobsource> <labourdetails xsi:type="xsd:string">free service</labourdetails> <phoneno xsi:type="xsd:string">8270325053</phoneno> <serivceadvname xsi:type="xsd:string">sandeep</serivceadvname> <servdealercode xsi:type="xsd:string">abd35926</servdealercode> <servicehstry xsi:type="xsd:string">servicehistory</servicehstry> <servicesubtype xsi:type="xsd:string">second</servicesubtype> <servicetype xsi:type="xsd:string">scheduled services</servicetype> <technicianname xsi:type="xsd:string">irfan shaikh</technicianname> <tractorsrno xsi:type="xsd:string">sd685</tractorsrno> </jobcard> </ns1:redcustomerviewresponse> and aliasing class this
@xstreamalias("ns1:redcustomerviewresponse") public class jobcardresponse { @xstreamalias("jobcard") private return _return; public return getreturn() { return _return; } public void setreturn(return _return) { this._return = _return; } @override public string tostring() { return "authenticationresponse [strresponsecdc=" + getreturn().tostring() + "]"; } @xstreamalias("jobcard") public static class return { @xstreamalias("additionalrepair") private static string additionalrepair; @xstreamalias("custcomplaint") private static string custcomplaint; @xstreamalias("custname") private static string customername; @xstreamalias("expdeliverydate") private static string expdeliverydate; @xstreamalias("hours") private static string hours; @xstreamalias("jobcardno") private static string jobcardno; @xstreamalias("jobcarddate") private static string jobcarddate; @xstreamalias("jobsource") private static string jobsource; @xstreamalias("jobcloseddate") private static string jobclosedate; @xstreamalias("labourdetails") private static string labourdetails; @xstreamalias("phoneno") private static string phoneno; @xstreamalias("serivceadvname") private static string serivceadvname; @xstreamalias("servdealercode") private static string servdealercode; @xstreamalias("servicehstry") private static string servicehistry; @xstreamalias("servicesubtype") private static string servicesubtype; @xstreamalias("servicetype") private static string servicetype; @xstreamalias("technicianname") private static string technicianname; @xstreamalias("tractorsrno") private static string tractorsrno; public string getcustomercomplaint() { return custcomplaint; } public void setcustomercomplaint(string customercomplaint) { this.custcomplaint = customercomplaint; } public string getadditionalrepair() { return additionalrepair; } public void setadditionalrepair(string additionalrepai) { this.additionalrepair = additionalrepai; } public string getcustomername() { return customername; } public void setcustomername(string customername) { this.customername = customername; } public string getexpdeliverydate() { return expdeliverydate; } public void setexpdeliverydate(string expdeliverydate) { this.expdeliverydate = expdeliverydate; } public string gethours() { return hours; } public void sethours(string hours) { this.hours = hours; } public string getjobcardno() { return jobcardno; } public void setjobcardno(string jobcardno) { this.jobcardno = jobcardno; } public string getlabourdetails() { return labourdetails; } public void setlabourdetails(string labourdetails) { this.labourdetails = labourdetails; } public string getjobcarddate() { return jobcarddate; } public void setjobcarddate(string jobcarddate) { this.jobcarddate = jobcarddate; } public string getjobclosedate() { return jobclosedate; } public void setjobclosedate(string jobclosedate) { this.jobclosedate = jobclosedate; } public string getjobsource() { return jobsource; } public void setjobsource(string jobsourrce) { this.jobsource = jobsourrce; } public string getphoneno() { return phoneno; } public void setphoneno(string phoneno) { this.phoneno = phoneno; } public string getserivceadvname() { return serivceadvname; } public void setserivceadvname(string serivceadvname) { this.serivceadvname = serivceadvname; } public string getservdealercode() { return servdealercode; } public void setservdealercode(string servdealercode) { this.servdealercode = servdealercode; } public string getservicehistry() { return servicehistry; } public void setservicehistry(string servicehistry) { this.servicehistry = servicehistry; } public string getservicesubtype() { return servicesubtype; } public void setservicesubtype(string servicesubtype) { this.servicesubtype = servicesubtype; } public string getservicetype() { return servicetype; } public void setservicetype(string servicetype) { this.servicetype = servicetype; } public string gettechnicianname() { return technicianname; } public void settechnicianname(string technicianname) { this.technicianname = technicianname; } public string gettractorsrno() { return tractorsrno; } public void settractorsrno(string tractorsrno) { this.tractorsrno = tractorsrno; } } }
the above code on execution shows me type of error
caused by: com.thoughtworks.xstream.converters.reflection.abstractreflectionconverter$unknownfieldexception: no such field com.bcone.mahindragreenclub.response.jobcardresponse$return.additionalrepair ---- debugging information ---- field : additionalrepair class : com.bcone.mahindragreenclub.response.jobcardresponse$return required-type : com.bcone.mahindragreenclub.response.jobcardresponse$return converter-type : com.thoughtworks.xstream.converters.reflection.reflectionconverter path : /ns1:redcustomerviewresponse/jobcard/additionalrepair line number : 8 class[1] : com.bcone.mahindragreenclub.response.jobcardresponse version : 0.0 am stuck last 2 3 days , not able out of this.
you have string fields declared static means bounded class , not variable members of object can deserialized:
private static string additionalrepair; you should remove static fields:
private string additionalrepair;
Comments
Post a Comment