0

I have Quickbooks Desktop Enterprise Solution 18.0 Trial version R5P and QB web connector 2.2.0.80.

I am completely new to Quickbooks. I already go through this link (How to create a .qwc file for QuickBooks Web Connector?). i generated .qwc file and tried connect with quickbooks through web connector and I got a error QWC1501: The new application was not added

This is my qwc file content:

Please guide me if there is anything wrong.

<?xml version="1.0"?>
<QBXML>
<AppName>WCWebService</AppName>
<AppID>
</AppID>
<AppURL>http://loaclhost/QBWebService.asmx</AppURL>
<AppDescription>A Short Description for WCWebservice</AppDescription>
<AppSupport>http://localhost/QBWebService.asmx?wsdl</AppSupport>
<UserName>Nagarajan</UserName>
<OwnerID>7ff3fabf-1c2c-490b-bff1-91148fc8d9a8</OwnerID>
<FileID>81d4dad8-a5dc-4b79-8c09-be679c9d8e28</FileID>
<QBType>QBFS</QBType>
<Scheduler>
<RunEveryNMinutes>2</RunEveryNMinutes>
</Scheduler>
</QBXML>`

Log file says that

Log file initialized at Sunday, April 8, 2018 - 10:10 AM UTC  
Timestamp format used: YYYYMMDD.HH:MM:SS UTC
QBWebConnector 2.2 has been initialized with its logging status to level = 
DEBUG.
Please restart QBWebConnector for any change in log level to take effect. 
Use file menu to clear log.

20180408.10:10:43 UTC   : QBWebConnector.RegistryManager.setUpdateLock() : 
HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to 
False
20180408.10:10:43 UTC   : QBWebConnector.RegistryManager.setUpdateLock() : 
********************* Update session unlocked *********************
20180408.10:10:43 UTC   : QWCReader.ParseQWC() : Contents of QWC file: -
<QBXML>
<AppName>WCWebService</AppName>
<AppID></AppID>
<AppURL>http://localhost/WCWebService.asmx</AppURL>
<AppDescription>A Short Description for WCWebservice</AppDescription>
<AppSupport>http://localhost/QBWebService.asmx?wsdl</AppSupport>
<UserName>Nagarajan</UserName>
<OwnerID>47c49092-071c-4edb-97a3-2715ab6325f8</OwnerID>
<FileID>1938435f-db77-40d2-8392-64ab98f5081c</FileID>
</QBXML>
20180408.10:10:45 UTC   : QBWebConnector.WebServiceManager.ReadQWC(string 
fileName) : Unexpected root doc: QBXML

QBWC1051: The new application was not added
20180408.10:10:45 UTC   :  : ~SingleInstanceHandler() - usingInstanceChannel 
= false. Returning without any Registry key delete or unmarshalling.

This is my code for Customer add.

    string strRequestXML ="";
        XmlDocument inputXMLDoc = null;

        // CustomerQuery
        inputXMLDoc = new XmlDocument();
        inputXMLDoc.AppendChild(inputXMLDoc.CreateXmlDeclaration("1.0",null, null));
        inputXMLDoc.AppendChild(inputXMLDoc.CreateProcessingInstruction("qbxml", "version=\"4.0\""));

        XmlElement qbXML = inputXMLDoc.CreateElement("QBXML");
        inputXMLDoc.AppendChild(qbXML);
        XmlElement qbXMLMsgsRq = inputXMLDoc.CreateElement("QBXMLMsgsRq");
        qbXML.AppendChild(qbXMLMsgsRq);
        qbXMLMsgsRq.SetAttribute("onError", "stopOnError");
            XmlElement CustomerAddRq = inputXMLDoc.CreateElement("CustomerAddRq");
            qbXMLMsgsRq.AppendChild(CustomerAddRq);
        CustomerAddRq.SetAttribute("requestID", "1");
        XmlElement custAdd = inputXMLDoc.CreateElement("CustomerAdd");
        CustomerAddRq.AppendChild(custAdd);
        custAdd.AppendChild(inputXMLDoc.CreateElement("Name","Naga"));
        custAdd.AppendChild(inputXMLDoc.CreateElement("FirstName", "Nagarajan"));
        custAdd.AppendChild(inputXMLDoc.CreateElement("MiddleName", ""));
        custAdd.AppendChild(inputXMLDoc.CreateElement("LastName", "varatharajan"));
        XmlElement BillAddress = inputXMLDoc.CreateElement("BillAddress");
        custAdd.AppendChild(BillAddress);
        BillAddress.AppendChild(inputXMLDoc.CreateElement("Addr1", "7/78"));
        BillAddress.AppendChild(inputXMLDoc.CreateElement("City", "Chennai"));
        BillAddress.AppendChild(inputXMLDoc.CreateElement("State", "TN"));            
        XmlElement maxReturned = inputXMLDoc.CreateElement("MaxReturned");
        CustomerAddRq.AppendChild(maxReturned).InnerText="1";
        strRequestXML = inputXMLDoc.OuterXml;
        req.Add(strRequestXML);

2 Answers2

0

Your .QWC file is invalid.

You can use the XML Validator tool included with the QuickBooks SDK to verify this. You may also want to refer to other .QWC-related questions on StackOverflow, which show properly constructed .QWC files. For example:

If you read the log file, this is pretty obvious. You can see this:

QBWebConnector.WebServiceManager.ReadQWC(string fileName) : Unexpected root doc: QBXML

Fix your .QWC file (specifically the root node) so that it meets the specification.

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • Thank you @KeithPalmerJr. As per you suggestion i created connection using qwc file through the web connector. I tried sync data it shows error in the status bar that is Description: Error message received from application via getLastError(): Error! and i will include log file and code file. Please review it. – Nagarajan Varatharajan Apr 09 '18 at 17:41
  • If you have a question about a totally new thing (e.g. anything that's NOT about creating a .QWC file) then you need to ask a new question. – Keith Palmer Jr. Apr 11 '18 at 01:18
0

I see three things:

  • QBXML should be QBWCXML
  • you have a quote after the closing QBXML
  • You have spelled localhost incorrectly in the AppURL element.

But looking again at the responses to Keith's answer, it looked like that fixed your problem, so you should mark it as correct.

Scott C Wilson
  • 19,102
  • 10
  • 61
  • 83