Quickbook web connector error - quickbooks

I am trying to connect quickbooks web connector with my php website. I have successfully integrated QWC file with it.
Here is the QWC file:
<QBWCXML>
<AppName>QuickBooks Integrator</AppName>
<AppID></AppID>
<AppURL>https://domain.com/quick1/docs/example_web_connector.php</AppURL>
<AppDescription>Test desktop quickbook</AppDescription>
<AppSupport>http://domain.com/file.html</AppSupport>
<UserName>mudit</UserName>
<OwnerID>{90A44FB7-33D9-4815-AC85-AC86A7E7D1EB}</OwnerID>
<FileID>{57F3B9B6-86F1-4FCC-B1FF-967DE1813D20}</FileID>
<QBType>QBFS</QBType>
<Scheduler>
<RunEveryNMinutes>2</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>false</IsReadOnly>
</QBWCXML>
When I run this from web connector I get error Last result: authentication failed.
Below is a small snippet of error log:
For backward compatibility of all webservers, QBWC will catch all errors under app-not-supporting-serverVersion.
20130628.20:14:55 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : This application does not contain support for serverVersion. Allowing update operation for backward compatibility.
20130628.20:14:55 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.0.0.139">
20130628.20:14:56 UTC : QBWebConnector.SOAPWebService.updateWS() : Actual error received from web service for clientVersion call: <The request failed with the error message:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>

The logs are indicating that your AppURL is incorrect:
20130628.20:14:56 UTC : QBWebConnector.SOAPWebService.updateWS() : Actual error received from web service for clientVersion call: <The request failed with the error message:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
The Web Connector is hitting your server, and your server is returning a "301 Moved Permanently" response instead of a "200 OK" response like it should be.
Are you 100% positive that your AppURL is correct?
Can you actually post your AppURL, so that we can verify that it's correct?

Related

ASP.NET Core 3.1 errors time out after Start processing HTTP request POST

I have a time out exception just after the "Start processing HTTP request POST" of HttpClientFactory
when does this message occurs exactly , is it before or after calling the server?
info: System.Net.Http.HttpClient.MyClient.LogicalHandler[100]
Start processing HTTP request GET https://api.github.com/repos/aspnet/docs/branches
ritical : System.Net.Http.HttpRequestException : Connection timed out

Quickbook web connector : QBWC1042: ReceiveResponseXML failed Error message: The request failed with HTTP status 413: Request Entity Too Large

I am getting an exception when I try to send [qbxml request][1] from WCF...I am sending the qbxml request from wcf service using web connector to quick book desktop to get report summery and used GeneralDetailReportQueryRq query xml. But getting "QBWC1042: ReceiveResponseXML failed
Error message: The request failed with HTTP status 413: Request Entity Too Large" Error message on web connector and have checked logs and found all response in verbose logs but web connector showing [1] "QBWC1042: ReceiveResponseXML failed".
This is the qbxml request
<?xml version="1.0" encoding="UTF-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<GeneralDetailReportQueryRq>
<GeneralDetailReportType>OpenInvoices</GeneralDetailReportType>
<ReportDateMacro>Today</ReportDateMacro>
<IncludeColumn>TxnID</IncludeColumn>
<IncludeColumn>TxnNumber</IncludeColumn>
<IncludeColumn>RefNumber</IncludeColumn>
<IncludeColumn>Name</IncludeColumn>
<IncludeColumn>TxnType</IncludeColumn>
<IncludeColumn>Date</IncludeColumn>
<IncludeColumn>Account</IncludeColumn>
<IncludeColumn>Aging</IncludeColumn>
<IncludeColumn>Amount</IncludeColumn>
<IncludeColumn>OpenBalance</IncludeColumn>
<IncludeColumn>RunningBalance</IncludeColumn>
<IncludeColumn>Terms</IncludeColumn>
<IncludeColumn>DueDate</IncludeColumn>
</GeneralDetailReportQueryRq>
</QBXMLMsgsRq>
</QBXML>
This the logs in web connector
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : cfn=""
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbNationality="US"
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMajorVers="13"
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMinorVers="0"
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : Received from sendRequestXML() following parameter:
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : strRequestXML =
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : XML dump follows: -
<?xml version="1.0" encoding="utf-8"?><?qbxml version="13.0"?><QBXML><QBXMLMsgsRq onError="continueOnError"><GeneralDetailReportQueryRq><GeneralDetailReportType>OpenInvoices</GeneralDetailReportType><ReportDateMacro>Today</ReportDateMacro><IncludeColumn>TxnID</IncludeColumn><IncludeColumn>TxnNumber</IncludeColumn><IncludeColumn>RefNumber</IncludeColumn><IncludeColumn>Name</IncludeColumn><IncludeColumn>TxnType</IncludeColumn><IncludeColumn>Date</IncludeColumn><IncludeColumn>Account</IncludeColumn><IncludeColumn>Aging</IncludeColumn><IncludeColumn>Amount</IncludeColumn><IncludeColumn>OpenBalance</IncludeColumn><IncludeColumn>RunningBalance</IncludeColumn><IncludeColumn>Terms</IncludeColumn><IncludeColumn>DueDate</IncludeColumn></GeneralDetailReportQueryRq></QBXMLMsgsRq></QBXML>
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : Request xml received.
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Processing request #1
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : REQUEST: received from application: size (bytes) = 786
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending request to QuickBooks.
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Response received from QuickBooks: size (bytes) = 93980
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending response back to application.
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : *** Calling receiveResponseXML() with following parameters:
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : wcTicket="d8bf5ba7-5e03-422a-a8ce-185cb86cf168"
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : response =
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : XML dump follows: -
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<GeneralDetailReportQueryRs statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<ReportRet>
<ReportTitle>Open Invoices</ReportTitle>
<ReportSubtitle>As of July 20, 2017</ReportSubtitle>
<ReportBasis>Accrual</ReportBasis>
<NumRows>246</NumRows>
<NumColumns>14</NumColumns>
<NumColTitleRows>1</NumColTitleRows>
<ColDesc colID="1" dataType="STRTYPE">
<ColTitle titleRow="1" />
<ColType>Blank</ColType>
</ColDesc>
<TotalRow rowNumber="246">
<ColData colID="1" value="TOTAL" />
<ColData colID="9" value="1202982.55" />
<ColData colID="10" value="1089736.86" />
<ColData colID="11" value="1202982.55" />
</TotalRow>
</ReportData>
</ReportRet>
</GeneralDetailReportQueryRs>
</QBXMLMsgsRs>
</QBXML>
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : hresult=""
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : message=""
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : QBWC1042: ReceiveResponseXML failed
Error message: The request failed with HTTP status 413: Request Entity Too Large.
More info:
StackTrace = at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QBWebConnector.localhost.WCWebServiceDoc.receiveResponseXML(String ticket, String response, String hresult, String message)
at QBWebConnector.localhost.WCWebService.receiveResponseXML(String ticket, String response, String hresult, String message)
at QBWebConnector.SOAPWebService.receiveResponseXML(String wcTicket, String response, String hresult, String message)
at QBWebConnector.WebService.do_receiveResponseXML(String wcTicket, String response, String hresult, String message, Boolean& success, Boolean& timeout)
Source = System.Web.Services
This is the error screen short.
Note : I have updated above logs and remove response data.I am getting complete response in log file but getting error on web connector for some requests.
I have implemented my service according to https://developer-static.intuit.com/qbSDK-current/doc/PDF/QBWC_proguide.pdf doc. receiveResponseXML method in CHAPTER 10.
Your web server is rejecting the HTTP request with this message:
The request failed with HTTP status 413: Request Entity Too Large
If you do a Google search, you'll find that by default WCF limits requests to 65 kilobytes maximum.
The request QuickBooks wants to send you is:
QuickBooks: size (bytes) = 93980
(or 93.98 kilobytes, roughly 30 kilobytes over the maximum size)
Reconfigure your WCF service/web server so that it allows larger payloads. Here's how:
https://stackoverflow.com/search?q=413%3A+Request+Entity+Too+Large

RESTClient not returning the Server Response Message

I am working on a ruby project which involve using RESTClient to reach out to an API. The API returns a 400 HTTP Status Code for a particular result with an accompanying response message (A JSON Response).
But when I check the response of my call:
response = RESTClient.post(...) {
logger.info response.to_s
}
I am getting a Proxy Server 400 page html:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
which is not what I'm expecting.
Please what could be wrong?
Also, the behaviour is different with DEV and TEST Environment. On DEV Environment, it's giving the JSON while on TEST, I'm getting this issue.
Thanks.
If this is your API you can enable response in JSON format to any request. Just add this to your base API controller:
before_filter :default_request_format
private
def default_request_format
request.format = :json
end
If this is not your API you should specify Accept header with JSON content type.

Team Foundation Services are not available from server

OK, I hate to reopen a previously solved case, but I can't get it to work. I have two endpoints listening to events from TFS 2010 event service, one build with Web Service (ASMX) and one with WCF (SVC). The first one works fine. The second causes TFS to raise this error
HistoryId : 4643911
EndTime : 4/12/2013 11:40:31 AM
ResultMessage : There were errors or warnings during notification delivery.
0/0 emails delivered.
1/2 soap notifications delivered.
1 errors.
0 warnings.
-------------------------------
Notification not delivered.
Notification: WorkItemChangedEvent (DeliveryType: Soap; Address: http://[removed]/[removed]/Services/TfsListener.svc)
Exception: Microsoft.TeamFoundation.TeamFoundationServiceUnavailableException: Team Foundation services are not available from server
http://[removed]/[removed]/Services/TfsListener.svc.
Technical information (for administrator):
HTTP code 404: Not Found ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.AsyncWebRequest.ExecRequest(Object obj)
--- End of inner exception stack trace ---
at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.ProcessHttpResponse(HttpWebResponse response, Stream responseStream, WebException webException,
XmlReader& xmlResponseReader)
at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.ExecWebServiceRequest(HttpWebRequest request, XmlWriter requestXml, String methodName,
HttpWebResponse& response)
at Microsoft.TeamFoundation.JobService.Extensions.Core.TeamFoundationNotificationClient.Notify(String eventXml, String tfsIdentityXml, Subscription subscription)
at Microsoft.TeamFoundation.JobService.Extensions.Core.NotificationJobExtension.SendSoapNotification(TeamFoundationRequestContext requestContext,
TeamFoundationNotification notification, TeamFoundationIdentityService identityService)
JobSource : d9ee5b23-4aa4-4768-a7fb-4db33ab686d0
JobId : a4804dcf-4bb6-4109-b61c-e59c2e8a9ff7
QueueTime : 4/12/2013 11:40:29 AM
ExecutionStartTime : 4/12/2013 11:40:30 AM
AgentId : 917eb9ee-2622-455c-a6e6-a1c96eeb1666
Result : PartiallySucceeded
I have followed every advice I could find, including, 404 Error when TFS 2010 Sends SOAP Alert to a WCF 4.0 Service and http://www.ewaldhofman.nl/post/2010/08/02/How-to-use-WCF-to-subscribe-to-the-TFS-2010-Event-Service-rolling-up-hours.aspx.
Any other ideas?
OK, got it work. Here is what is missing from some of the websites out there:
<service behaviorConfiguration="EventServiceBehavior" name="FullSvcClassName">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="EventServiceBinding"
contract="FullSvcInterfaceName" />
</service>
If name of the service will not match your full class name (including namespace), you will get a basicHttpBinding and it will not work.
If you put anything in the endpoint address, like a relative address I thought I should provide, it will get appended to the and of the URI and fail.
I used WcfTestClient.exe and Fiddler2 to track it down. Enjoy!

QBWC error QBWC1013: "Could not start QuickBooks."

I cannot get QuickBooks to start up from the Web Connector. I am passing valid filepath, everything looks right according to the documentation.
QBWC version is 2.1.0.3.0
QB Ver is Premier Contractor Edition 2010
If I have QuickBooks open already, the Web Connector runs fine. If it's not open, I get the QBWC1013 error...
Relevant portion of log:
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application.
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppName: FOO
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): FOO
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: https://www.foo.com/server.php
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter:<serverVersionRet="PHP QuickBooks SOAP Server v1.5.3 at /server.php">
20130312.14:14:56 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.1.0.30">
20130312.14:14:57 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter:<clientVersionRet="">
20130312.14:14:57 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation.
20130312.14:14:57 UTC : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'FOO', username = 'foo'
20130312.14:14:57 UTC : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="foo"><password=<MaskedForSecurity>
20130312.14:14:58 UTC : QBWebConnector.SOAPWebService.updateWS() : Received from authenticate() following parameters:<authRet[0]="91f62aac622b49ad483f20ef9d7729a3"><authRet[1]=""\\FOOSERVER\Users\Public\Documents\Intuit\QuickBooks\Company Files\Some Company File Inc..QBW""><authRet[2]=""><authRet[3]="">
20130312.14:14:58 UTC : QBWebConnector.RegistryManager.setCurrentWebServiceName() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\CurrentWebServiceName has been set to FOO
20130312.14:14:58 UTC : QBWebConnector.RegistryManager.setCurrentWebServiceSessionTicket() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\CurrentWebServiceSessionTicket has been set to 91f62aac622b49ad483f20ef9d7729a3
20130312.14:14:58 UTC : QBWebConnector.SOAPWebService.CheckCFNResponse() : User authenticated.
20130312.14:14:58 UTC : QBWebConnector.SOAPWebService.do_authenticate() : Done.
20130312.14:14:58 UTC : QBWebConnector.SOAPWebService.OpenConnection() : Connecting to QuickBooks...
20130312.14:14:58 UTC : QBWebConnector.SOAPWebService.handleAllOtherError() : QBWC1013: Error connecting to QuickBooks. Returning error message to application.
Could not start QuickBooks.
20130312.14:14:58 UTC : QBWebConnector.SOAPWebService.do_connectionError() : *** Calling connectionError() with following parameters:<wcTicket="91f62aac622b49ad483f20ef9d7729a3"><hresult="0x80040408"><message="Could not start QuickBooks.">
20130312.14:14:59 UTC : QBWebConnector.SOAPWebService.do_connectionError() : Received from connectionError() following parameters:<tryAgain="done">
20130312.14:14:59 UTC : QBWebConnector.SOAPWebService.OpenConnection() : Error connecting to QuickBooks. Application sent back DONE. Job ending.
20130312.14:14:59 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
20130312.14:14:59 UTC : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session unlocked *********************
20130312.14:14:59 UTC : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update completed with errors. See log (QWClog.txt) for details.
I'm going to assume that your QWC file is with the correct format.
If may looks something like this
<QBWCXML>
<AppName>Example WS</AppName>
<AppID></AppID>
<AppURL>https://localhost/Quickbooks.asmx</AppURL>
<AppDescription>Example Service Service</AppDescription>
<AppSupport>https://localhost/</AppSupport>
<UserName>Etile</UserName>
<OwnerID>{XXXXB9B1-86F1-4fcc-B1EE-566DE1813D20}</OwnerID>
<FileID>{XXXX4FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID>
<QBType>QBFS</QBType>
<Scheduler>
<RunEveryNMinutes>1</RunEveryNMinutes>
</Scheduler>
</QBWCXML>
When you add the application to QuickBooks's Web Connector, you will be prompted to allow the application access to QuickBooks data. You need to select the last option "Yes, always; allow access even if QuickBooks is not running"
And don't forget to return the full path to the company file from your Web Service's authenticate() method.
A Sample SOAP Response would be:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://developer.intuit.com/">
<SOAP-ENV:Body>
<ns1:authenticateResponse>
<ns1:authenticateResult>
<ns1:string>1e3ea2ed-a734-03e4-ed8c-80eb12f19845</ns1:string>
<ns1:string>C:\Quickbooks Company File.QBW</ns1:string>
</ns1:authenticateResult>
</ns1:authenticateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Note that if you are using quickbooks-php, the file must be added manually for some reason. The Web Connector documentation and the new QuickBooks integration wiki both lack clarity on this detail.
I was banging my head against the wall on this but after 4 hours on the phone with Intuit and finally having the tier 2 engage there development team they clued me to into some more details on this vague as hell error. When you get this error the problem is not that it can't start quickbooks its that you're request from your server is attempting to open the file incorrectly. Things that will cause this. The name of the file is wrong, the path of the file is wrong. Your request is not formatted correctly.
In my case we had the file name correct but my server was suppose to pull the path of the file which you can confirm in the register at hkey_current_user\software\intuit\qbwebconnector\soapwebservices\ look for companyfile and you'll see the name and full path.
hope this helps someone deal with this vague error.
As log data is showing -> user authenticated, that means .qwc file is in correct format. After authentication, web connector is making a request to QuickBook to connect, which is failing in your case.
Steps to connect to QuickBooks desktop through web connector are :
Run web service and QuickBook desktop application in Admin mode
Name of web service and QuickBook company name should be same
Run QuickBook desktop in multi-user mode so that you can connect QuickBook through web connector as well.
In web service code, if user is authentic then make authReturn[1]=""
// to connect to the company file that is currently openned in QuickBooks
It worked for me.
All the best for you.

Resources