Quickbooks - sendRequestXML -> com.sun.istack.SAXException2 -
i implementing webservice quickbooks web connector. here sendrequestxml method.. far testing.
@override @webresult(name = "sendrequestxmlresult", targetnamespace = "http://developer.intuit.com/") @requestwrapper(localname = "sendrequestxml", targetnamespace = "http://developer.intuit.com/", classname = "com.intuit.developer.sendrequestxml") @webmethod(action = "http://developer.intuit.com/sendrequestxml") @responsewrapper(localname = "sendrequestxmlresponse", targetnamespace = "http://developer.intuit.com/", classname = "com.intuit.developer.sendrequestxmlresponse") public string sendrequestxml(@webparam(name = "ticket", targetnamespace = "http://developer.intuit.com/") string ticket, @webparam(name = "strhcpresponse", targetnamespace = "http://developer.intuit.com/") string strhcpresponse, @webparam(name = "strcompanyfilename", targetnamespace = "http://developer.intuit.com/") string strcompanyfilename, @webparam(name = "qbxmlcountry", targetnamespace = "http://developer.intuit.com/") string qbxmlcountry, @webparam(name = "qbxmlmajorvers", targetnamespace = "http://developer.intuit.com/") int qbxmlmajorvers, @webparam(name = "qbxmlminorvers", targetnamespace = "http://developer.intuit.com/") int qbxmlminorvers) { string result = ""; stringwriter writer; try { qbxml qbxml = new qbxml(); qbxmlmsgsrq qbxmlmsgsrq = new qbxmlmsgsrq(); list<object> hostqueryrqorcompanyqueryrqoraccountaddrq = qbxmlmsgsrq.gethostqueryrqorcompanyqueryrqoraccountaddrq(); invoiceadd invoiceadd = new invoiceadd(); list<object> invoicelineaddorinvoicelinegroupadd = invoiceadd.getinvoicelineaddorinvoicelinegroupadd(); invoicelineadd invoicelineadd = new invoicelineadd(); invoicelineadd.setamount("100"); invoicelineadd.setdesc("programming book"); invoicelineadd.setquantity("1"); salestaxcoderef salestaxcoderef = new salestaxcoderef(); invoicelineadd.setsalestaxcoderef(salestaxcoderef); invoicelineaddorinvoicelinegroupadd.add(invoicelineadd); hostqueryrqorcompanyqueryrqoraccountaddrq.add(invoiceadd); qbxml.setqbxmlmsgsrq(qbxmlmsgsrq); jaxbcontext context = jaxbcontext.newinstance(qbxml.class); marshaller marshaller = context.createmarshaller(); writer = new stringwriter(); marshaller.marshal(qbxml, writer); string xml = writer.tostring(); result = xml; } catch (jaxbexception e) { // todo auto-generated catch block e.printstacktrace(); } return result; } when test :
caused by: com.sun.istack.saxexception2: instance of "com.intuit.xsd.generated.invoiceadd" substituting "java.lang.object", "com.intuit.xsd.generated.invoiceadd" bound anonymous type.
found problem...
qbxml qbxml = new qbxml(); qbxmlmsgsrq qbxmlmsgsrq = new qbxmlmsgsrq(); qbxmlmsgsrq.setonerror("stoponerror"); list<object> hostqueryrqorcompanyqueryrqoraccountaddrq = qbxmlmsgsrq.gethostqueryrqorcompanyqueryrqoraccountaddrq(); invoiceaddrqtype invoiceaddrqtype = new invoiceaddrqtype(); invoiceaddrqtype.setrequestid("1"); invoiceadd invoiceadd = new invoiceadd(); customerref customerref = new customerref(); customerref.setfullname("onp"); invoiceadd.setcustomerref(customerref); list<object> invoicelineaddorinvoicelinegroupadd = invoiceadd.getinvoicelineaddorinvoicelinegroupadd(); invoicelineadd invoicelineadd = new invoicelineadd(); itemref itemref = new itemref(); itemref.setfullname("programming book"); invoicelineadd.setitemref(itemref); invoicelineadd.setamount("100"); invoicelineadd.setdesc("programming book"); invoicelineadd.setquantity("1"); salestaxcoderef salestaxcoderef = new salestaxcoderef(); invoicelineadd.setsalestaxcoderef(salestaxcoderef); invoicelineaddorinvoicelinegroupadd.add(invoicelineadd); invoiceaddrqtype.setinvoiceadd(invoiceadd); hostqueryrqorcompanyqueryrqoraccountaddrq.add(invoiceaddrqtype); qbxml.setqbxmlmsgsrq(qbxmlmsgsrq); jaxbcontext context = jaxbcontext.newinstance(qbxml.class); marshaller marshaller = context.createmarshaller(); writer = new stringwriter(); marshaller.marshal(qbxml, writer); string xml = writer.tostring(); result = xml; now quickbooks received message, error in web connector.
"quickbooks found error when parsing provided xml text stream"
but nothing error is...
Comments
Post a Comment