-1
我想通過我的.Net應用程序更新客戶地址,發票地址等QuickBook Data。我能夠通過API獲取所有的QuickBook數據,但我沒有得到更新QuickBook的數據。.Net應用程序更新QuickBook應用程序信息,如地址
更新功能
StringBuilder strXML = new StringBuilder(string.Empty);
XmlDocument inputXMLDoc = new XmlDocument();
inputXMLDoc.AppendChild(inputXMLDoc.CreateXmlDeclaration("1.0", null, null));
inputXMLDoc.AppendChild(inputXMLDoc.CreateProcessingInstruction("qbxml", "version=\"8.0\""));
XmlElement qbXML = inputXMLDoc.CreateElement("QBXML");
inputXMLDoc.AppendChild(qbXML);
XmlElement qbXMLMsgsRq = inputXMLDoc.CreateElement("QBXMLMsgsRq");
qbXML.AppendChild(qbXMLMsgsRq);
qbXMLMsgsRq.SetAttribute("onError", "stopOnError");
XmlElement custModeRq = inputXMLDoc.CreateElement("CustomerModRq");
qbXMLMsgsRq.AppendChild(custModeRq);
custModeRq.SetAttribute("requestID", "15");
XmlElement custMod = inputXMLDoc.CreateElement("CustomerMod");
custModeRq.AppendChild(custMod);
XmlElement ListId = inputXMLDoc.CreateElement("ListID");
custMod.AppendChild(ListId);
ListId.InnerText = _listID;
XmlElement EditSequence = inputXMLDoc.CreateElement("EditSequence");
custMod.AppendChild(EditSequence);
EditSequence.InnerText = _editSequence;
XmlElement Name = inputXMLDoc.CreateElement("Name");
custMod.AppendChild(Name);
Name.InnerText = "Jack Sparrow";
string s = QuickbooksAPI.APIBase.GetQBQueryResponce(inputXMLDoc.OuterXml);
return inputXMLDoc.OuterXml;
Get請求/響應功能
RequestProcessor2 rp = null;
string ticket = null;
string response = null;
try
{
rp = new RequestProcessor2();
rp.OpenConnection("", "Stamps.com");
//rp.OpenConnection2("", "Stamps.com",QBXMLRPConnectionType.localQBDLaunchUI);
ticket = rp.BeginSession("", QBFileMode.qbFileOpenDoNotCare);
response = rp.ProcessRequest(ticket, strRequest);
}
catch (System.Runtime.InteropServices.COMException ex)
{
//MessageBox.Show("COM Error Description = " + ex.Message, "COM error");
return "";
}
finally
{
if (ticket != null)
{
rp.EndSession(ticket);
}
if (rp != null)
{
rp.CloseConnection();
}
};
感謝提前。
發佈您的代碼,上傳你發送到QuickBooks的XML請求,並張貼你找回XML響應。沒有人可以幫助你,如果你不發佈任何細節。 –