Closed Code-Crash closed 7 years ago
Thanks for the heads up and sorry for the late response. Was out of town for the last 2 weeks. I'll try and find a better way to handle that. Give me 2 days tops, tying up loose end son another project.
@TeknoloGenie It's fine 👍 , Let me know once it's done so I will start working, right now I'm going through the documents and trying to understand how will be the schema for the same.
One more thing, where I should put this datasources.json
file, please put one example file.
@Code-Crash This last week has been chaotic trying to get my last project off my chest while at the same time job hunting so its going to be another week before i can even touch this project. Sometime before then i'll create a scrum board of tasks. There's a lot to do here before this connector is ready, my goal is to have 1.0.0.rc1
started by the 1st, and nail it out by the 15th just before christmas time.
If you have a project your attempting to finalize and have a scheduled released date before Jan 1st please let me know and i'll prioritize this. Hate seeing fellow developers be late on a deadline because an open source project has issues or is incomplete.
Thanks @TeknoloGenie , I appreciate this.
Its good to finish this project as soon as possible but I'm not gonna force you :)
You do once you will find a enough time for the same.
Just let me know where to put the datasources.json
and how to start at list running this project so that I can try to make some progress on the same and once you will have enough time you can start for the project.
@Code-Crash I just pushed up an example Loopback API project, take a look and be sure to run npm install
within the /example
directory. Let me know if there are any issues.
I should note that you can take advantage of the built-in Employee
model to use as loopbacks User
model. Giving employee's the ability to login to the API as well if your project requires that sort of thing :) There is one requirement on QuickBooks end to support this.
If you see here within the QBWebService
I have added logic that will automatically create the Employee
record in the database and assign it a password based on if the extra field web_password
exists on their Employee
record within QuickBooks
@TeknoloGenie Thanks, Let me look into the example and I will get back to you :)
@Code-Crash any feedback on it yet? Were you able to get it running?
Hi @TeknoloGenie ,
When I run the example node example/server/server.js
it's giving the error that
server.models.Employee.create({email: 'root@email.com', password: 'root'})
^
TypeError: Cannot read property 'create' of undefined
So I commented this line and now the server is running.
I understand I need to call the http://0.0.0.0:3000/api/{API NAME}
to use this, but I'm running this on Mac OS and I'm using virtual box for Windows with QuickBooks, So I need to handle this with .qwc
file so How to do that?
@TeknoloGenie Here is my .qwc file format
<?xml version="1.0"?>
<QBWCXML>
<AppName>Demo-Company</AppName>
<AppID></AppID>
<AppURL>http://192.168.0.175:8000/api/</AppURL>
<AppDescription></AppDescription>
<AppSupport>http://192.168.0.175:8000/support</AppSupport>
<UserName>Admin</UserName>
<OwnerID>{9AA44FB7-33D9-4615-AC85-AC86A7E7D1EB}</OwnerID>
<FileID>{57F4B9B6-86F1-5FCC-B1FF-967DE1813D20}</FileID>
<QBType>QBFS</QBType>
<Scheduler>
<RunEveryNMinutes>1</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>false</IsReadOnly>
</QBWCXML>
But its There is an Authentication failed error showing on web connector, is something wrong in the .qwc file?
For the error about Employee.create
being undefined
It could be due to my recent update about prepending QB
to the Model names. Rename Employee
to QBEmployee
. If you want you can submit a PR for it, or i can do it later.
Can you post the logs for the web connector?
edit: @Code-Crash The passwords in your datasources.json
and WebConnector
should match, also I'm pretty sure that it needs to be the password you use for the QuickBooks login. Another thing, when you added the .qwc
file did QuickBooks ask you for the proper permissions and did you set it to always allow access to the company file even when QB isn't running?
@TeknoloGenie Okay, I will create a PR for the Employee.create
, and for the .qwc
let me make the changes for the same. :)
Sure I will paste the detailed logs from now, sorry about that. :)
@TeknoloGenie , I'm getting 404 from Web Connector for server version and other default requests from QuickBook Web Connector.
.qwc
<?xml version="1.0"?>
<QBWCXML>
<AppName>Demo-Sample</AppName>
<AppID></AppID>
<AppURL>http://192.168.0.175:3000/api/</AppURL>
<AppDescription></AppDescription>
<AppSupport>http://192.168.0.175:3000/support</AppSupport>
<UserName>Admin</UserName>
<OwnerID>{9AA44FB7-33D9-4615-AC85-AC86A7E7D1EB}</OwnerID>
<FileID>{57F4B9B6-86F1-5FCC-B1FF-967DE1813D20}</FileID>
<QBType>QBFS</QBType>
<Scheduler>
<RunEveryNMinutes>1</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>false</IsReadOnly>
</QBWCXML>
I have created a test QucikBook File username/password is Admin.
My datasources.json
file is:
{
"db": {
"name": "db",
"connector": "memory"
},
"quickbooksService": {
"username": "Admin",
"password": "Admin",
"name": "quickbooksService",
"connector": "loopback-connector-quickbooks",
"companyFile": "C:\\Users\\Public\\Documents\\Intuit\\QuickBooks\\Company Files\\Demo Sample.qbw",
"enableServiceLog": true,
"config": {
"verbosity": 2
}
}
}
Log from QuickBook Web Connector:
192.168.0.17520161123.08:11:47 UTC : UpdateThisScheduledApp() : Password management - Started
20161123.08:11:47 UTC : UpdateThisScheduledApp() : Password management - Ended
20161123.08:11:47 UTC : UpdateThisScheduledApp() : Performing SCHEDULED UPDATE for application = Demo-Sample
20161123.08:11:47 UTC : QBWebConnector.RegistryManager.getUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE
20161123.08:11:47 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to True
20161123.08:11:47 UTC : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session locked *********************
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application.
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppName: Demo-Sample
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): Demo-Sample
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: http://192.168.0.175:3000/api/
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : Actual error received from web service for serverVersion call: <The request failed with HTTP status 404: Not Found.>. For backward compatibility of all webservers, QBWC will catch all errors under app-not-supporting-serverVersion.
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : This application does not contain support for serverVersion. Allowing update operation for backward compatibility.
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.2.0.71">
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.updateWS() : Actual error received from web service for clientVersion call: <The request failed with HTTP status 404: Not Found.>. For backward compatibility of all webservers, QBWC will catch all errors under app-not-supporting-clientVersion.
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : This application does not contain support for clientVersion. Allowing update operation for backward compatibility.
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'Demo-Sample', username = 'Admin'
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="Admin"><password=<MaskedForSecurity>
20161123.08:11:47 UTC : QBWebConnector.SOAPWebService.do_authenticate() : QBWC1012: Authentication failed due to following error message.
The request failed with HTTP status 404: Not Found.
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.authenticate(String strUserName, String strPassword)
at QBWebConnector.localhost.WCWebService.authenticate(String strUserName, String strPassword)
at QBWebConnector.SOAPWebService.authenticate(String UserName, String Password)
at QBWebConnector.WebService.do_authenticate(String& ticket, String& SampleFileName)
Source = System.Web.Services
20161123.08:11:47 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
20161123.08:11:47 UTC : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session unlocked *********************
20161123.08:11:47 UTC : QBWebConnector.WebServiceManager.DoUpdate() : Update completed with errors. See log (QWClog.txt) for details.
20161123.08:11:47 UTC : UpdateThisScheduledApp() : QBWC1031: Update completed with some error. Application has been notified of the error accordingly. See QWCLog for further information.
Server Log is :
initializing QuickBooks Connector DataSource
TIME:2016-11-23T13:22:17+05:30 - MSG: STARTED: QuickBooks Web Service server initialization.
TIME:2016-11-23T13:22:17+05:30 - MSG: STARTED: Building WSDL file.
TIME:2016-11-23T13:22:17+05:30 - MSG: COMPLETED: Building WSDL file.
TIME:2016-11-23T13:22:17+05:30 - MSG: STARTED: SOAP Server
TIME:2016-11-23T13:22:17+05:30 - MSG: COMPLETED: SOAP Server
TIME:2016-11-23T13:22:17+05:30 - MSG: STARTED: Creating log file
TIME:2016-11-23T13:22:17+05:30 - MSG: INITIALIZING: QuickBooks Data Models
TIME:2016-11-23T13:22:17+05:30 - MSG: COMPLETED: QuickBooks Web Service server initialization.
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
TIME:2016-11-23T13:22:19+05:30 - MSG: COMPLETED: Creating log file
@TeknoloGenie While calling the API web connector is getting 404 for serverVersion and initial requests, so any idea why it's happening?
there should be a file located within the node_modules/loopback-connector-quickbooks/
dir called qbws-logs.log
can you look into it and see if your seeing where it starts the SOAP Server and builds the WSDL file?
I don't even think your getting a log file generated for you if you don't see it. Because if you look inside the qbws.js
file i had set it hardcoded on line 46 of the qbws.js
to point to http://localhost:2188/wsdl?wsdl
To fix this we would need to do two things.
Add ability to override port being used for soap server... maybe through the datasources.json
file?
Then also rewrite the qbws.js
file to support that configuration. You can see where im using the verbosity
@TeknoloGenie Got it, Let me try to modify this.
@TeknoloGenie I'm using the localhost:2188/wsdl?wsdl
in .qwc
file and its working now. but after logging I'm getting the error as following:
[33mWebMethod: receiveResponseXML() has been called by QBWebConnector[39m
TIME:2016-11-24T19:52:51+05:30 - MSG: Parameters received:
TIME:2016-11-24T19:52:51+05:30 - MSG: string ticket = {2383efae-c4fb-41ea-b1b4-0666e71c5836}
TIME:2016-11-24T19:52:51+05:30 - MSG: string response =
TIME:2016-11-24T19:52:51+05:30 - MSG: string hresult = 0x80040400
TIME:2016-11-24T19:52:51+05:30 - MSG: string message = QuickBooks found an error when parsing the provided XML text stream.
and on Web Connector error is
ReceiveResponseXML failed
Error Message: Response is not well-formed XML
I have some more questions:
For this can we need to maintain the datasources.json
in database table so that we will get the multiple .qwc
file's and then identify the file id with our database and we can play with the data according to file id?
Hey @Code-Crash sorry we had Thanksgiving Day all day and now im back to the grind.
Is this something automatically occurring? Or is it occurring when you are creating or modifying data? I would get this from time to time before release, but they all went away and all the requests that were build during init
. I spent countless hours fighting theResponse is not well-formed XML
error and surprisingly It turns out it's pretty self-explanatory.
The Web Connector could not parse the incoming RecieveResponseXML
, meaning somewhere in the XMLRequest we build & sent using the buildXMLRequest
method there was something that the Web Connector either could not understand the request that was sent, the data QuickBooks intakes is so strict. You will need to add breakpoints and see what it is that is being build as far as your XMLRequest then post it in a new issue please.
To answer your question regarding the multiple company files, I never tried to, and never even thought it would be needed but I can completely see the use case for it. I created this new issue to track progress and throw out your ideas toward how we can support multiple company files. As of right now your way of adding just multiple datasources would not work because it forces the usage of the name quickbooksService
. I went ahead and files two issue #12 & #13
I apologize for the bad grammar, misspelling or just plain mumbling lol, 4am... Early start to the day and no coffee yet.
Lets go ahead and close this issue and just post new ones as you experience issues. Im sorry this has been such a hassle for you i hope we can get you going with it asap.
@TeknoloGenie Its fine :) ,
Yes, it is automatically occurring, I have't done anything yet.
Okay, I will try to pull out the more detailed error.
No Worries. :) Take your time.
I will create a new issue from now to discuss or issue.
Hi @TeknoloGenie ,
After running the project, I'm getting error:
Cannot find module '../../../../server/server'