所以我们有代码创建客户,然后是客户工作.由于无法解释的原因,客户工作失败了. 这是最初的要求: ?xml version="1.0" encoding="US-ASCII"??qbxml version="8.0"?QBXML QBXMLMsgsRq newMessageSetID="c80f653c176ed
这是最初的要求:
<?xml version="1.0" encoding="US-ASCII"?><?qbxml version="8.0"?> <QBXML> <QBXMLMsgsRq newMessageSetID="c80f653c176ed1e5975e" onError="stopOnError"> <CustomerAddRq> <CustomerAdd> <Name>xxxx. (20615)</Name> <CompanyName>xxxx</CompanyName> <Salutation/> <FirstName/> <MiddleName/> <LastName/> <BillAddress> <Addr1>xxxx</Addr1> <Addr2>xxx</Addr2> <Addr3/> <Addr4/> <City>xxx</City> <State>xx</State> <PostalCode>xxxxx</PostalCode> <Country>USA</Country> <Note/> </BillAddress> <Phone>000000</Phone> <Fax>000000</Fax> <Email/> <Contact/> <TermsRef> <FullName>Net 30</FullName> </TermsRef> </CustomerAdd> </CustomerAddRq> </QBXMLMsgsRq> </QBXML>
以及回复的相关部分:
<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs newMessageSetID="3368552138367687637"> <CustomerAddRs statusCode="0" statusSeverity="Info" statusMessage="Status OK"> <CustomerRet> <ListID>80000118-1272906278</ListID> <TimeCreated>2010-05-03T13:04:38-05:00</TimeCreated> <TimeModified>2010-05-03T13:04:38-05:00</TimeModified> <EditSequence>1272906278</EditSequence> <TermsRef> <ListID>80000006-1244039697</ListID> <FullName>Net 30</FullName> </TermsRef> <Balance>0.00</Balance> <TotalBalance>0.00</TotalBalance> <JobStatus>None</JobStatus> </CustomerRet> </CustomerAddRs> </QBXMLMsgsRs> </QBXML>
我们回到Quickbooks:
<?xml version="1.0" encoding="US-ASCII"?><?qbxml version="8.0"?> <QBXML> <QBXMLMsgsRq newMessageSetID="0da30b5086cd3938febe" onError="stopOnError"> <CustomerAddRq> <CustomerAdd> <Name>xxxxxxx</Name> <ParentRef> <ListID>80000118-1272906278</ListID> </ParentRef> <CompanyName>xxxxxxx</CompanyName> <Salutation/> <FirstName/> <MiddleName/> <LastName/> <BillAddress> <Addr1>xxxxx</Addr1> <Addr2>xxxxx</Addr2> <Addr3/> <Addr4/> <City>xxxx</City> <State>xxx</State> <PostalCode>xxxx</PostalCode> <Country>USA</Country> <Note/> </BillAddress> <Phone>00000000</Phone> <Fax>0000000</Fax> <Email/> <Contact/> <TermsRef> <FullName>Net 30</FullName> </TermsRef> </CustomerAdd> </CustomerAddRq> </QBXMLMsgsRq> </QBXML>
然后Quickbooks用这个响应第二个请求:
<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs newMessageSetID="0da30b5086cd3938febe"> <CustomerAddRs statusCode="3240" statusSeverity="Error" statusMessage="Object "80000118-1272906278" specified in the request cannot be found. "/> </QBXMLMsgsRs> </QBXML>
第一个回复是2013-01-21 10:34:22.353,第二个回复是2013-01-21 10:35:21.080(服务器时间).
它为什么失败?请注意,它通常有效.仅在此请求序列中,它使用相同的命令创建了另外两个没有问题.
有时为了好的措施,它会用这个代替:
<?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs newMessageSetID="215932fd6e1fffdd574c"> <CustomerAddRs statusCode="3120" statusSeverity="Error" statusMessage="Object "11A0001-1289401726" specified in the request cannot be found. QuickBooks error message: Invalid argument. The specified record does not exist in the list."/> </QBXMLMsgsRs> </QBXML>
您如何确保刚创建的客户在列表中以便在下一个命令中引用?
您是否尝试过指定< FullName>并使用它代替< ListID>? SDK指南的第15章中有一个奇怪的部分,名为“关于ListID的注释”,表示当您尝试添加作业时可能正在更改ListID.