c# - QBPOS export request received and processed but no response -
i'm looking qbpossdklog , can see request being processed not receiving response queried information. feel missing simple. if going test code make sure platform x86 or going receive com error. using c# , qbposfc3.
using system; using system.net; using system.drawing; using system.collections; using system.componentmodel; using system.windows.forms; using system.data; using system.io; using interop.qbposfc3; using system.xml; namespace qbpos { public class po { [stathread] public static void main(string[] args) { po_query(); } public static void po_query() { bool sessionbegun = false; bool connectionopen = false; qbpossessionmanager sessionmanager = null; try { sessionmanager = new qbpossessionmanager(); imsgsetrequest requestmsgset = sessionmanager.createmsgsetrequest(3,0); requestmsgset.attributes.onerror = enrqonerror.roecontinue; ipurchaseorderquery poq = requestmsgset.appendpurchaseorderqueryrq(); sessionmanager.openconnection("appid","po export"); connectionopen = true; sessionmanager.beginsession(""); sessionbegun = true; imsgsetresponse responsemsgset = sessionmanager.dorequests(requestmsgset); iresponselist responselist = responsemsgset.responselist; for(int = 0; < responselist.count; i++) { iresponse response = responselist.getat(i); enresponsetype responsetype = (enresponsetype)response.type.getvalue(); ipurchaseorderretlist por = (ipurchaseorderretlist)response.detail; ipurchaseorderret purchaseorderret = por.getat(i); if (purchaseorderret.txnid != null) { purchaseorderret.txnid.getvalue(); } if (purchaseorderret.timecreated != null) { purchaseorderret.timecreated.getvalue(); } if (purchaseorderret.timemodified != null) { purchaseorderret.timemodified.getvalue(); } if (purchaseorderret.associate != null) { purchaseorderret.associate.getvalue(); } if (purchaseorderret.canceldate != null) { purchaseorderret.canceldate.getvalue(); } if (purchaseorderret.companyname != null) { purchaseorderret.companyname.getvalue(); } if (purchaseorderret.discount != null) { purchaseorderret.discount.getvalue(); } if (purchaseorderret.discountpercent != null) { purchaseorderret.discountpercent.getvalue(); } if (purchaseorderret.fee != null) { purchaseorderret.fee.getvalue(); } if (purchaseorderret.instructions != null) { purchaseorderret.instructions.getvalue(); } if (purchaseorderret.itemscount != null) { purchaseorderret.itemscount.getvalue(); } if (purchaseorderret.purchaseordernumber != null) { purchaseorderret.purchaseordernumber.getvalue(); } if (purchaseorderret.purchaseorderstatusdesc != null) { purchaseorderret.purchaseorderstatusdesc.getvalue(); } if (purchaseorderret.qtydue != null) { purchaseorderret.qtydue.getvalue(); } if (purchaseorderret.qtyordered!= null) { purchaseorderret.qtyordered.getvalue(); } if (purchaseorderret.qtyordered!= null) { purchaseorderret.qtyreceived.getvalue(); } if (purchaseorderret.salesordernumber != null) { purchaseorderret.salesordernumber.getvalue(); } if (purchaseorderret.shiptostorenumber != null) { purchaseorderret.shiptostorenumber.getvalue(); } if (purchaseorderret.startshipdate != null) { purchaseorderret.startshipdate.getvalue(); } if (purchaseorderret.storeexchangestatus != null) { purchaseorderret.storeexchangestatus.getvalue(); } if (purchaseorderret.storenumber != null) { purchaseorderret.storenumber.getvalue(); } if (purchaseorderret.subtotal != null) { purchaseorderret.subtotal.getvalue(); } if (purchaseorderret.terms != null) { purchaseorderret.terms.getvalue(); } if (purchaseorderret.termsdiscount != null) { purchaseorderret.termsdiscount.getvalue(); } if (purchaseorderret.termsdiscountdays != null) { purchaseorderret.termsdiscountdays.getvalue(); } if (purchaseorderret.total != null) { purchaseorderret.total.getvalue(); } if (purchaseorderret.txndate != null) { purchaseorderret.txndate.getvalue(); } if (purchaseorderret.unfilledpercent != null) { purchaseorderret.unfilledpercent.getvalue(); } if (purchaseorderret.vendorcode != null) { purchaseorderret.vendorcode.getvalue(); } if (purchaseorderret.vendorlistid != null) { purchaseorderret.vendorlistid.getvalue(); } (int x = 0 ; x < purchaseorderret.purchaseorderitemretlist.count; x++) { ipurchaseorderitemret purchaseorderitemret = purchaseorderret.purchaseorderitemretlist.getat(x); //get value of listid if (purchaseorderitemret.listid != null) { purchaseorderitemret.listid.getvalue(); } //get value of txnlineid if (purchaseorderitemret.txnlineid != null) { purchaseorderitemret.txnlineid.getvalue(); } //get value of alu if (purchaseorderitemret.alu != null) { purchaseorderitemret.alu.getvalue(); } //get value of attribute if (purchaseorderitemret.attribute != null) { purchaseorderitemret.attribute.getvalue(); } //get value of cost if (purchaseorderitemret.cost != null) { purchaseorderitemret.cost.getvalue(); } //get value of desc1 if (purchaseorderitemret.desc1 != null) { purchaseorderitemret.desc1.getvalue(); } //get value of desc2 if (purchaseorderitemret.desc2 != null) { purchaseorderitemret.desc2.getvalue(); } //get value of extendedcost if (purchaseorderitemret.extendedcost != null) { purchaseorderitemret.extendedcost.getvalue(); } //get value of itemnumber if (purchaseorderitemret.itemnumber != null) { purchaseorderitemret.itemnumber.getvalue(); } //get value of numberofbaseunits if (purchaseorderitemret.numberofbaseunits != null) { purchaseorderitemret.numberofbaseunits.getvalue(); } //get value of qty if (purchaseorderitemret.qty != null) { purchaseorderitemret.qty.getvalue(); } //get value of qtyreceived if (purchaseorderitemret.qtyreceived != null) { purchaseorderitemret.qtyreceived.getvalue(); } //get value of size if (purchaseorderitemret.size != null) { purchaseorderitemret.size.getvalue(); } //get value of unitofmeasure if (purchaseorderitemret.unitofmeasure != null) { purchaseorderitemret.unitofmeasure.getvalue(); } //get value of upc if (purchaseorderitemret.upc != null) { purchaseorderitemret.upc.getvalue(); } } } sessionmanager.endsession(); sessionbegun = false; sessionmanager.closeconnection(); connectionopen = false; } catch (exception e) { messagebox.show(e.message, "error"); if (sessionbegun) { sessionmanager.endsession(); } if (connectionopen) { sessionmanager.closeconnection(); } } } } }
Comments
Post a Comment