I am trying to create a web app that can communicate with QuickBooks Desktop.
I have set up a SOAP server, but when I click "Add an Application" in the Web Connector and select my QWC file it gives:
StatusCode=3263. Status message: This request cannot be completed because the integrated application had requested read-only access. Have the integrated application request read/write access, and have the QuickBooks administrator grant this access.
When I change the <IsReadOnly>true</IsReadOnly> to <IsReadOnly>false</IsReadOnly>, the app is added fine. Any ideas on why this might be happening? I haven't been able to find anyone doing a read-only SOAP server, so I don't really have any examples to go off of. Is there a different way I need to configure it?
My QWC File:
<?xml version="1.0"?>
<QBWCXML>
<AppName>My App Name</AppName>
<AppID></AppID>
<AppURL>https://mywebsite.com/path-to-web-connector-soap-server</AppURL>
<AppDescription></AppDescription>
<AppSupport>https://mywebsite.com/support</AppSupport>
<UserName>quickbooks</UserName>
<OwnerID>{2e081sd3-2fe5-4de5-8s6a-e70ss35ss0d8}</OwnerID>
<FileID>{14C3sC64-0sC0-4ssD-BFs4-151s95B0729C}</FileID>
<QBType>QBFS</QBType>
<Scheduler>
<RunEveryNMinutes>2</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>true</IsReadOnly>
</QBWCXML>
My SOAP Server:
<?php
require_once '../QuickBooks.php';
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set('America/New_York');
}
$user = 'quickbooks';
$pass = 'password';
$map = array(
QUICKBOOKS_QUERY => array('_request_xml_query', '_response'),
);
$errmap = array();
$hooks = array();
$log_level = QUICKBOOKS_LOG_DEVELOP;
$soapserver = QUICKBOOKS_SOAPSERVER_BUILTIN;
$soap_options = array();
$handler_options = array(
'deny_concurrent_logins' => false,
'deny_reallyfast_logins' => false,
);
$driver_options = array();
$callback_options = array();
$dsn = 'mysqli://usr:DBPassword@localhost/db_name';
if (!QuickBooks_Utilities::initialized($dsn)) {
QuickBooks_Utilities::initialize($dsn);
QuickBooks_Utilities::createUser($dsn, $user, $pass);
} else {
$Server = new QuickBooks_WebConnector_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options);
$response = (string) $Server->handle(true, true);
}
function _request_xml_query($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents)
{
return str_replace('{REQUEST_ID}', $requestID, $extra);
}
function _response($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents)
{
saveResponse($xml);
}
function saveResponse($xml) {
...
}