QBWCServer Class
Properties Methods Events Config Settings Errors
The QBWCServer class is used to communicate with QuickBooks Web Connector from your application.
Syntax
QBWCServer
Remarks
The QBWCServer class is designed to process requests from QuickBooks Web Connector and fire events that allow you to provide information to, and get information from QuickBooks Web Connector.
This allows you to create an application that can communicate with a remote copy of QuickBooks without worrying about directly accessing the machine where QuickBooks is running. For more information on the design of this approach refer to the Intuit website for QuickBooks Web Connector.
QWC Files
The first step in establishing a relationship between your application and a remote instance of QuickBooks is to create a QWC file. This file specifies information about your application its requirements, as well as the access you need. The CreateQWCFile method creates the QWC file which must be generated for each user of your application. The minimum required properties are:
- QWCFileInfoAppDescription
- QWCFileInfoAppName
- QWCFileInfoAppSupportURL
- QWCFileInfoAppURL
- QWCFileInfoFileId
- QWCFileInfoOwnerId
- QWCFileInfoUser
Once the file is generated the end user will obtain the file from your website, and you will assign a password for that user at that time. The password is not part of the QWC file but the user will provide this directly in QuickBooks Web Connector and it will be sent to your web application during the connection for verification purposes.
Request Processing
The class is designed with a server environment in mind. That is, it's typical that the class will be used in a web page, but is not required. However the HTTP request is received, it can be passed to the RequestData property. After passing the request data to the class call ProcessRequest method processes the request from QuickBooks Web Connector. Processing the requests will fire one of the events.
The class provides various events to interact with QuickBooks Web Connector. QuickBooks Web Connector will make a sequence of calls for any given session, and the events correspond to these calls. Within the events you control the response which dictates what QuickBooks Web Connector will do next.
A session ticket is provided so you can keep track of a particular session over the course of multiple calls. An example of a typical session:
- ServerVersion fires. This allows you to provide an the version of your application. This is purely informational and does not need to be implemented.
- ClientVersion fires. This provides version information about the QuickBooks Web Connector. It may be used to reject a connection based on minimum required versions, but in most cases no action would be taken in your code and the session proceeds.
- Authenticate fires. This event allows verification of the user that is connecting. Here you will either accept or reject the connection.
- SendRequest fires. Within this event you will supply a QBXML request that will be passed to QuickBooks.
- ReceiveResponse fires. QuickBooks Web Connector returns the QBXML response from the request you gave it in the previous step, or error information about why the request failed.
- CloseConnection fires. This is the last event in the session. You may provide a message that will be displayed in QuickBooks Web Connector, but in most cases you would not take any action in this event.
Preparing Requests and Parsing Responses
The SendRequest event requires that you provide a QBXML request. This can be generated using the other
components in this toolkit. To do so, simply set the QBRequestMode property to rmOffline before making a
method call. For instance:
Customer customer = new Customer();
customer.QBRequestMode = CustomerQBRequestModes.rmOffline;
customer.GetByName("John Doe");
e.Request = customer.QBRequestAggregate;
In the above code the class is used in the same way you would use the class if you were communicating
directly with QuickBooks with the exception that QBRequestMode is set to rmOffline. When
the GetByName method is called instead of attempting to communicate with QuickBooks only the QBRequestAggregate
property is populated. This QBXML aggregate should be passed to the e.Request parameter inside the SendRequest event.
Processing responses is similar. You will receive the QBXML response from the e.Response parameter inside the
ReceiveResponse event. You may then pass the response to the QBResponseAggregate property, or InputQBXML method
of other components in the toolkit. For instance:
Customer customer = new Customer();
customer.QBResponseAggregate = e.Response;
string myAccountNumber = customer.AccountNumber;
Setting QBResponseAggregate and calling InputQBXML do the exact same thing. The class parses the
response and populates the properties of the class.
Error Handling
There are two basic types of errors when dealing with QuickBooks Web Connector. The first are errors that originate from your application and are reported to QuickBooks Web Connector. These are driven by the actions you take inside events. For instance in the SendRequest event you may set e.Request to empty string to signify an error. QuickBooks Web Connector will see this and make another call and GetLastError will fire. GetLastError is fired when QuickBooks Web Connector is asking from error information from your application. Here you may provide details about the error.
The second type of error is a communication error between QuickBooks Web Connector and QuickBooks itself. When this happens QuickBooks Web Connector will make a call and ConnectionError will fire with information about the error received from QuickBooks.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
Overwrite | Whether to overwrite QWC files. |
QWCFileInfoAppDescription | A brief description of the application. |
QWCFileInfoAppDisplayName | The display name of the application. |
QWCFileInfoAppId | The application Id. |
QWCFileInfoAppName | The name of the application. |
QWCFileInfoAppSupportURL | A URL where users can find support for your product. |
QWCFileInfoAppUniqueName | If this property is set the QuickBooks Web Connector will not use its clone/replace model for the AppName and will instead use the replace routine. |
QWCFileInfoAppURL | The URL of your web application. |
QWCFileInfoAuthFlags | This property specifies which versions of QuickBooks your application supports. |
QWCFileInfoCertURL | This property specifies a URL which is used by the QuickBooks Web Connector to obtain and validate the SSL certificate. |
QWCFileInfoFileId | This property specifies a unique Id. |
QWCFileInfoIsReadOnly | Specifies whether read or read/write access is needed. |
QWCFileInfoNotify | Determines if notification are allowed. |
QWCFileInfoOwnerId | This property specifies an Id which identifies your application. |
QWCFileInfoPersonalDataPref | This property defines the type of access to personal/sensitive data required by your application. |
QWCFileInfoUnattendedModePref | This property specifies whether you need to access QuickBooks in unattended mode (when QuickBooks is closed). |
QWCFileInfoUpdateInterval | This property specifies the desired update interval in seconds. |
QWCFileInfoUser | This property species the user. |
RequestData | The request data to process. |
ResponseData | The response data. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
CreateQWCFile | Creates a QWC file. |
ProcessRequest | Processes the request. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Authenticate | Fired when the QuickBooks Web Connector authenticates. |
ClientVersion | Provides the QuickBooks Web Connector version information. |
CloseConnection | Fires when the update session completes. |
ConnectionError | Fires when QuickBooks Web Connector is unable to connect to QuickBooks. |
Error | Information about errors during data delivery. |
GetInteractiveURL | Fires when the URL for an interactive session is needed. |
GetLastError | Fires when QuickBooks Web Connector checks for error information. |
InteractiveDone | This event fires when QuickBooks Web Connector checks to see if the interactive session is finished. |
InteractiveRejected | This event fires after a user rejects an interactive session. |
ReceiveResponse | Fires when a response is received. |
SendRequest | Fires when QuickBooks Web Connector asks for a request. |
ServerVersion | Fires when QuickBooks Web Connector requests the version of your application. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
QBType | The type of QuickBooks software the connection will be made to. |
Style | Specifies the SOAP encoding style used in requests made by QuickBooks Web Connector. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitive | Whether sensitive data is masked in log messages. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |
Overwrite Property (QBWCServer Class)
Whether to overwrite QWC files.
Syntax
ANSI (Cross Platform) int GetOverwrite();
int SetOverwrite(int bOverwrite); Unicode (Windows) BOOL GetOverwrite();
INT SetOverwrite(BOOL bOverwrite);
int inqb_qbwcserver_getoverwrite(void* lpObj);
int inqb_qbwcserver_setoverwrite(void* lpObj, int bOverwrite);
bool GetOverwrite();
int SetOverwrite(bool bOverwrite);
Default Value
FALSE
Remarks
This determines whether existing files are overwritten when calling CreateQWCFile. The default value is False.
Data Type
Boolean
QWCFileInfoAppDescription Property (QBWCServer Class)
A brief description of the application.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppDescription();
int SetQWCFileInfoAppDescription(const char* lpszQWCFileInfoAppDescription); Unicode (Windows) LPWSTR GetQWCFileInfoAppDescription();
INT SetQWCFileInfoAppDescription(LPCWSTR lpszQWCFileInfoAppDescription);
char* inqb_qbwcserver_getqwcfileinfoappdescription(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappdescription(void* lpObj, const char* lpszQWCFileInfoAppDescription);
QString GetQWCFileInfoAppDescription();
int SetQWCFileInfoAppDescription(QString qsQWCFileInfoAppDescription);
Default Value
""
Remarks
A brief description of the application. This will be displayed in the QB Web Connector UI. For the best results use a value less than 80 characters in length.
This property is required.
Data Type
String
QWCFileInfoAppDisplayName Property (QBWCServer Class)
The display name of the application.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppDisplayName();
int SetQWCFileInfoAppDisplayName(const char* lpszQWCFileInfoAppDisplayName); Unicode (Windows) LPWSTR GetQWCFileInfoAppDisplayName();
INT SetQWCFileInfoAppDisplayName(LPCWSTR lpszQWCFileInfoAppDisplayName);
char* inqb_qbwcserver_getqwcfileinfoappdisplayname(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappdisplayname(void* lpObj, const char* lpszQWCFileInfoAppDisplayName);
QString GetQWCFileInfoAppDisplayName();
int SetQWCFileInfoAppDisplayName(QString qsQWCFileInfoAppDisplayName);
Default Value
""
Remarks
The display name of the application. This is use for display purposes in the QB Web Connector UI only.
This property is optional.
Data Type
String
QWCFileInfoAppId Property (QBWCServer Class)
The application Id.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppId();
int SetQWCFileInfoAppId(const char* lpszQWCFileInfoAppId); Unicode (Windows) LPWSTR GetQWCFileInfoAppId();
INT SetQWCFileInfoAppId(LPCWSTR lpszQWCFileInfoAppId);
char* inqb_qbwcserver_getqwcfileinfoappid(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappid(void* lpObj, const char* lpszQWCFileInfoAppId);
QString GetQWCFileInfoAppId();
int SetQWCFileInfoAppId(QString qsQWCFileInfoAppId);
Default Value
""
Remarks
The application Id. This value is passed to QuickBooks or QuickBooks POS when a connection is opened, however it is not used at the time of this writing.
This property is optional.
Data Type
String
QWCFileInfoAppName Property (QBWCServer Class)
The name of the application.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppName();
int SetQWCFileInfoAppName(const char* lpszQWCFileInfoAppName); Unicode (Windows) LPWSTR GetQWCFileInfoAppName();
INT SetQWCFileInfoAppName(LPCWSTR lpszQWCFileInfoAppName);
char* inqb_qbwcserver_getqwcfileinfoappname(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappname(void* lpObj, const char* lpszQWCFileInfoAppName);
QString GetQWCFileInfoAppName();
int SetQWCFileInfoAppName(QString qsQWCFileInfoAppName);
Default Value
""
Remarks
The name of the application. This name is displayed in the QB Web Connector UI. It is also the name supplied to QuickBooks when a connection is created.
This property is required.
Data Type
String
QWCFileInfoAppSupportURL Property (QBWCServer Class)
A URL where users can find support for your product.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppSupportURL();
int SetQWCFileInfoAppSupportURL(const char* lpszQWCFileInfoAppSupportURL); Unicode (Windows) LPWSTR GetQWCFileInfoAppSupportURL();
INT SetQWCFileInfoAppSupportURL(LPCWSTR lpszQWCFileInfoAppSupportURL);
char* inqb_qbwcserver_getqwcfileinfoappsupporturl(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappsupporturl(void* lpObj, const char* lpszQWCFileInfoAppSupportURL);
QString GetQWCFileInfoAppSupportURL();
int SetQWCFileInfoAppSupportURL(QString qsQWCFileInfoAppSupportURL);
Default Value
""
Remarks
A URL where users can find support for your product.
The domain name specified in this URL must match the domain name specified in QWCFileInfoAppURL.
During development you may specify "localhost" or a machine name in place of the domain name. If a machine name is specified, it must match the machine name specified in QWCFileInfoAppURL.
The URL provided in QWCFileInfoAppURL must be a https:// URL. The only exception to this is when using "localhost" for development, in that case a http:// URL may be used.
This property is required.
Data Type
String
QWCFileInfoAppUniqueName Property (QBWCServer Class)
If this property is set the QuickBooks Web Connector will not use its clone/replace model for the AppName and will instead use the replace routine.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppUniqueName();
int SetQWCFileInfoAppUniqueName(const char* lpszQWCFileInfoAppUniqueName); Unicode (Windows) LPWSTR GetQWCFileInfoAppUniqueName();
INT SetQWCFileInfoAppUniqueName(LPCWSTR lpszQWCFileInfoAppUniqueName);
char* inqb_qbwcserver_getqwcfileinfoappuniquename(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappuniquename(void* lpObj, const char* lpszQWCFileInfoAppUniqueName);
QString GetQWCFileInfoAppUniqueName();
int SetQWCFileInfoAppUniqueName(QString qsQWCFileInfoAppUniqueName);
Default Value
""
Remarks
If this property is set the QuickBooks Web Connector will not use its clone/replace model for the QWCFileInfoAppName and will instead use the replace routine.
This property is optional.
Data Type
String
QWCFileInfoAppURL Property (QBWCServer Class)
The URL of your web application.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAppURL();
int SetQWCFileInfoAppURL(const char* lpszQWCFileInfoAppURL); Unicode (Windows) LPWSTR GetQWCFileInfoAppURL();
INT SetQWCFileInfoAppURL(LPCWSTR lpszQWCFileInfoAppURL);
char* inqb_qbwcserver_getqwcfileinfoappurl(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoappurl(void* lpObj, const char* lpszQWCFileInfoAppURL);
QString GetQWCFileInfoAppURL();
int SetQWCFileInfoAppURL(QString qsQWCFileInfoAppURL);
Default Value
""
Remarks
The URL of your web application.
The domain name specified in this URL must match the domain name specified in QWCFileInfoAppURL.
During development you may specify "localhost" or a machine name in place of the domain name. If a machine name is specified, it must match the machine name specified in QWCFileInfoAppURL.
The URL provided in QWCFileInfoAppURL must be a https:// URL. The only exception to this is when using "localhost" for development, in that case a http:// URL may be used.
This property is required.
Data Type
String
QWCFileInfoAuthFlags Property (QBWCServer Class)
This property specifies which versions of QuickBooks your application supports.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoAuthFlags();
int SetQWCFileInfoAuthFlags(const char* lpszQWCFileInfoAuthFlags); Unicode (Windows) LPWSTR GetQWCFileInfoAuthFlags();
INT SetQWCFileInfoAuthFlags(LPCWSTR lpszQWCFileInfoAuthFlags);
char* inqb_qbwcserver_getqwcfileinfoauthflags(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoauthflags(void* lpObj, const char* lpszQWCFileInfoAuthFlags);
QString GetQWCFileInfoAuthFlags();
int SetQWCFileInfoAuthFlags(QString qsQWCFileInfoAuthFlags);
Default Value
""
Remarks
This property specifies which versions of QuickBooks your application supports. By default all editions are supported, including Simple Start.
This property is optional. If this is not set the QuickBooks Web Connector will support all versions. In most cases it is recommended to leave this value as empty string unless you need to restrict which versions of QuickBooks your application supports.
Possible values are:
0x0 | All |
0x1 | QuickBooks Simple Start |
0x2 | QuickBooks Professional |
0x4 | QuickBooks Premier |
0x8 | QuickBooks Enterprise |
If you need to support multiple editions you may AND the desired values together.
This property is optional.
Data Type
String
QWCFileInfoCertURL Property (QBWCServer Class)
This property specifies a URL which is used by the QuickBooks Web Connector to obtain and validate the SSL certificate.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoCertURL();
int SetQWCFileInfoCertURL(const char* lpszQWCFileInfoCertURL); Unicode (Windows) LPWSTR GetQWCFileInfoCertURL();
INT SetQWCFileInfoCertURL(LPCWSTR lpszQWCFileInfoCertURL);
char* inqb_qbwcserver_getqwcfileinfocerturl(void* lpObj);
int inqb_qbwcserver_setqwcfileinfocerturl(void* lpObj, const char* lpszQWCFileInfoCertURL);
QString GetQWCFileInfoCertURL();
int SetQWCFileInfoCertURL(QString qsQWCFileInfoCertURL);
Default Value
""
Remarks
This property specifies a URL which is used by the QuickBooks Web Connector to obtain and validate the SSL certificate. This is typically only used when the *rpCertURL; is not the web server where your application is running.
This property is optional.
Data Type
String
QWCFileInfoFileId Property (QBWCServer Class)
This property specifies a unique Id.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoFileId();
int SetQWCFileInfoFileId(const char* lpszQWCFileInfoFileId); Unicode (Windows) LPWSTR GetQWCFileInfoFileId();
INT SetQWCFileInfoFileId(LPCWSTR lpszQWCFileInfoFileId);
char* inqb_qbwcserver_getqwcfileinfofileid(void* lpObj);
int inqb_qbwcserver_setqwcfileinfofileid(void* lpObj, const char* lpszQWCFileInfoFileId);
QString GetQWCFileInfoFileId();
int SetQWCFileInfoFileId(QString qsQWCFileInfoFileId);
Default Value
""
Remarks
This property specifies a unique Id. The first time the QuickBooks Web Connector connects to the company this Id is stored as an extension to the company record along with QWCFileInfoOwnerId.
The storage of this data allows you to perform a Company query (using the Company class) to determine if you've worked with this company file previously. When the Company query is performed specify your QWCFileInfoOwnerId and validate the FileId in the response.
This format of this value must adhere to the GUIDTYPE defined in the QuickBooks SDK. The format is
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
where X is a hexadecimal digit. For example:
{6B063959-81B0-4622-85D6-F548C8CCB517}
This property is required.
Data Type
String
QWCFileInfoIsReadOnly Property (QBWCServer Class)
Specifies whether read or read/write access is needed.
Syntax
ANSI (Cross Platform) int GetQWCFileInfoIsReadOnly();
int SetQWCFileInfoIsReadOnly(int bQWCFileInfoIsReadOnly); Unicode (Windows) BOOL GetQWCFileInfoIsReadOnly();
INT SetQWCFileInfoIsReadOnly(BOOL bQWCFileInfoIsReadOnly);
int inqb_qbwcserver_getqwcfileinfoisreadonly(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoisreadonly(void* lpObj, int bQWCFileInfoIsReadOnly);
bool GetQWCFileInfoIsReadOnly();
int SetQWCFileInfoIsReadOnly(bool bQWCFileInfoIsReadOnly);
Default Value
FALSE
Remarks
Specifies whether read or read/write access is needed.
This property specifies whether your application will need read or read/write access to the company file. The default value is False, meaning both read and write access is required.
Data Type
Boolean
QWCFileInfoNotify Property (QBWCServer Class)
Determines if notification are allowed.
Syntax
ANSI (Cross Platform) int GetQWCFileInfoNotify();
int SetQWCFileInfoNotify(int bQWCFileInfoNotify); Unicode (Windows) BOOL GetQWCFileInfoNotify();
INT SetQWCFileInfoNotify(BOOL bQWCFileInfoNotify);
int inqb_qbwcserver_getqwcfileinfonotify(void* lpObj);
int inqb_qbwcserver_setqwcfileinfonotify(void* lpObj, int bQWCFileInfoNotify);
bool GetQWCFileInfoNotify();
int SetQWCFileInfoNotify(bool bQWCFileInfoNotify);
Default Value
FALSE
Remarks
Determines if notification are allowed.
This property determines if system tray notification pop-ups are allowed at the application level. The default value is False.
Data Type
Boolean
QWCFileInfoOwnerId Property (QBWCServer Class)
This property specifies an Id which identifies your application.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoOwnerId();
int SetQWCFileInfoOwnerId(const char* lpszQWCFileInfoOwnerId); Unicode (Windows) LPWSTR GetQWCFileInfoOwnerId();
INT SetQWCFileInfoOwnerId(LPCWSTR lpszQWCFileInfoOwnerId);
char* inqb_qbwcserver_getqwcfileinfoownerid(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoownerid(void* lpObj, const char* lpszQWCFileInfoOwnerId);
QString GetQWCFileInfoOwnerId();
int SetQWCFileInfoOwnerId(QString qsQWCFileInfoOwnerId);
Default Value
""
Remarks
This property specifies an Id which identifies your application.
This format of this value must adhere to the GUIDTYPE defined in the QuickBooks SDK. The format is
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
where X is a hexadecimal digit. For example:
{6B063959-81B0-4622-85D6-F548C8CCB517}
This property is required.
Data Type
String
QWCFileInfoPersonalDataPref Property (QBWCServer Class)
This property defines the type of access to personal/sensitive data required by your application.
Syntax
ANSI (Cross Platform) int GetQWCFileInfoPersonalDataPref();
int SetQWCFileInfoPersonalDataPref(int iQWCFileInfoPersonalDataPref); Unicode (Windows) INT GetQWCFileInfoPersonalDataPref();
INT SetQWCFileInfoPersonalDataPref(INT iQWCFileInfoPersonalDataPref);
Possible Values
PDP_NOT_NEEDED(0),
PDP_OPTIONAL(1),
PDP_REQUIRED(2)
int inqb_qbwcserver_getqwcfileinfopersonaldatapref(void* lpObj);
int inqb_qbwcserver_setqwcfileinfopersonaldatapref(void* lpObj, int iQWCFileInfoPersonalDataPref);
int GetQWCFileInfoPersonalDataPref();
int SetQWCFileInfoPersonalDataPref(int iQWCFileInfoPersonalDataPref);
Default Value
0
Remarks
This property defines the type of access to personal/sensitive data required by your application. Possible values are:
0 (pdpNotNeeded - default) | Access to personal data is not needed. |
1 (pdpOptional) | Access to personal data is optional. |
2 (pdpRequired) | Access to personal data is required. |
Data Type
Integer
QWCFileInfoUnattendedModePref Property (QBWCServer Class)
This property specifies whether you need to access QuickBooks in unattended mode (when QuickBooks is closed).
Syntax
ANSI (Cross Platform) int GetQWCFileInfoUnattendedModePref();
int SetQWCFileInfoUnattendedModePref(int iQWCFileInfoUnattendedModePref); Unicode (Windows) INT GetQWCFileInfoUnattendedModePref();
INT SetQWCFileInfoUnattendedModePref(INT iQWCFileInfoUnattendedModePref);
Possible Values
UMP_OPTIONAL(0),
UMP_REQUIRED(1)
int inqb_qbwcserver_getqwcfileinfounattendedmodepref(void* lpObj);
int inqb_qbwcserver_setqwcfileinfounattendedmodepref(void* lpObj, int iQWCFileInfoUnattendedModePref);
int GetQWCFileInfoUnattendedModePref();
int SetQWCFileInfoUnattendedModePref(int iQWCFileInfoUnattendedModePref);
Default Value
0
Remarks
This property specifies whether you need to access QuickBooks in unattended mode (when QuickBooks is closed). Possible values are:
0 (umpOptional - default) | Access to QuickBooks when it is closed is not required. The user may still grant access. |
1 (umpRequired) | Access to QuickBooks when it is closed is required. |
Data Type
Integer
QWCFileInfoUpdateInterval Property (QBWCServer Class)
This property specifies the desired update interval in seconds.
Syntax
ANSI (Cross Platform) int GetQWCFileInfoUpdateInterval();
int SetQWCFileInfoUpdateInterval(int iQWCFileInfoUpdateInterval); Unicode (Windows) INT GetQWCFileInfoUpdateInterval();
INT SetQWCFileInfoUpdateInterval(INT iQWCFileInfoUpdateInterval);
int inqb_qbwcserver_getqwcfileinfoupdateinterval(void* lpObj);
int inqb_qbwcserver_setqwcfileinfoupdateinterval(void* lpObj, int iQWCFileInfoUpdateInterval);
int GetQWCFileInfoUpdateInterval();
int SetQWCFileInfoUpdateInterval(int iQWCFileInfoUpdateInterval);
Default Value
0
Remarks
This property specifies the desired update interval in seconds. If set to a positive value the QuickBooks Web Connector will automatically enable the "Auto-Run" option when adding the application, and the "Every_Min" value will be set to the nearest minute value. The default value is 0, which means this option will not be included in the created file.
This property is optional.
Data Type
Integer
QWCFileInfoUser Property (QBWCServer Class)
This property species the user.
Syntax
ANSI (Cross Platform) char* GetQWCFileInfoUser();
int SetQWCFileInfoUser(const char* lpszQWCFileInfoUser); Unicode (Windows) LPWSTR GetQWCFileInfoUser();
INT SetQWCFileInfoUser(LPCWSTR lpszQWCFileInfoUser);
char* inqb_qbwcserver_getqwcfileinfouser(void* lpObj);
int inqb_qbwcserver_setqwcfileinfouser(void* lpObj, const char* lpszQWCFileInfoUser);
QString GetQWCFileInfoUser();
int SetQWCFileInfoUser(QString qsQWCFileInfoUser);
Default Value
""
Remarks
This property species the user. When QuickBooks Web Connector connects to your application and ProcessRequest is called the Authenticate event will fire and the user and password will be available to you for verification.
This property is required.
Data Type
String
RequestData Property (QBWCServer Class)
The request data to process.
Syntax
ANSI (Cross Platform) char* GetRequestData();
int SetRequestData(const char* lpszRequestData); Unicode (Windows) LPWSTR GetRequestData();
INT SetRequestData(LPCWSTR lpszRequestData);
char* inqb_qbwcserver_getrequestdata(void* lpObj);
int inqb_qbwcserver_setrequestdata(void* lpObj, const char* lpszRequestData);
QString GetRequestData();
int SetRequestData(QString qsRequestData);
Default Value
""
Remarks
This property specifies the data to be processed.
Call ProcessRequest to process the data.
This property is not available at design time.
Data Type
String
ResponseData Property (QBWCServer Class)
The response data.
Syntax
ANSI (Cross Platform) char* GetResponseData();
int SetResponseData(const char* lpszResponseData); Unicode (Windows) LPWSTR GetResponseData();
INT SetResponseData(LPCWSTR lpszResponseData);
char* inqb_qbwcserver_getresponsedata(void* lpObj);
int inqb_qbwcserver_setresponsedata(void* lpObj, const char* lpszResponseData);
QString GetResponseData();
int SetResponseData(QString qsResponseData);
Default Value
""
Remarks
After calling ProcessRequest this property will be populated with the response to be sent back to QuickBooks Web Connector.
This property is not available at design time.
Data Type
String
Config Method (QBWCServer Class)
Sets or retrieves a configuration setting.
Syntax
ANSI (Cross Platform) char* Config(const char* lpszConfigurationString); Unicode (Windows) LPWSTR Config(LPCWSTR lpszConfigurationString);
char* inqb_qbwcserver_config(void* lpObj, const char* lpszConfigurationString);
QString Config(const QString& qsConfigurationString);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
CreateQWCFile Method (QBWCServer Class)
Creates a QWC file.
Syntax
ANSI (Cross Platform) int CreateQWCFile(const char* lpszFilePath); Unicode (Windows) INT CreateQWCFile(LPCWSTR lpszFilePath);
int inqb_qbwcserver_createqwcfile(void* lpObj, const char* lpszFilePath);
int CreateQWCFile(const QString& qsFilePath);
Remarks
This method creates a QWC file on disk at the specified FilePath.
The QWCFileInfo* properties define the specific requirements of the file.
The following properties are required:
- QWCFileInfoAppDescription
- QWCFileInfoAppName
- QWCFileInfoAppSupportURL
- QWCFileInfoAppURL
- QWCFileInfoFileId
- QWCFileInfoOwnerId
- QWCFileInfoUser
The Overwrite property determines the behavior if the file already exists.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ProcessRequest Method (QBWCServer Class)
Processes the request.
Syntax
ANSI (Cross Platform) int ProcessRequest(); Unicode (Windows) INT ProcessRequest();
int inqb_qbwcserver_processrequest(void* lpObj);
int ProcessRequest();
Remarks
This method processes the request. A request is made by QuickBooks Web Connector to your web based application. The request must be read from the HTTP context by your application and passed to the RequestData property.
After providing the request, call this method to process the request. The event which corresponds to the call made by QuickBooks Web Connector will fire and allow you to get or set information. Possible events that may fire when this method is called are:
- Authenticate
- ClientVersion
- CloseConnection
- ConnectionError
- GetInteractiveURL
- GetLastError
- InteractiveDone
- InteractiveRejected
- ReceiveResponse
- SendRequest
- ServerVersion
Only one of these events will fire, this is because QuickBooks Web Connector only makes one call at a time. The events provide a SessionTicket so that you can identify which events belong to which session.
After this method returns, the ResponseData property will be populated. You must then send the response in your code.
When sending the response you MUST set the Content-Type header to "text/xml".
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Authenticate Event (QBWCServer Class)
Fired when the QuickBooks Web Connector authenticates.
Syntax
ANSI (Cross Platform) virtual int FireAuthenticate(QBWCServerAuthenticateEventParams *e);
typedef struct {
const char *User;
const char *Password;
int Accept;
int Busy;
int NoWork;
char *SessionTicket;
char *CompanyFile;
int UpdateDelay;
int UpdateInterval; int reserved; } QBWCServerAuthenticateEventParams;
Unicode (Windows) virtual INT FireAuthenticate(QBWCServerAuthenticateEventParams *e);
typedef struct {
LPCWSTR User;
LPCWSTR Password;
BOOL Accept;
BOOL Busy;
BOOL NoWork;
LPWSTR SessionTicket;
LPWSTR CompanyFile;
INT UpdateDelay;
INT UpdateInterval; INT reserved; } QBWCServerAuthenticateEventParams;
#define EID_QBWCSERVER_AUTHENTICATE 1 virtual INT INQB_CALL FireAuthenticate(LPSTR &lpszUser, LPSTR &lpszPassword, BOOL &bAccept, BOOL &bBusy, BOOL &bNoWork, LPSTR &lpszSessionTicket, LPSTR &lpszCompanyFile, INT &iUpdateDelay, INT &iUpdateInterval);
class QBWCServerAuthenticateEventParams { public: const QString &User(); const QString &Password(); bool Accept(); void SetAccept(bool bAccept); bool Busy(); void SetBusy(bool bBusy); bool NoWork(); void SetNoWork(bool bNoWork); const QString &SessionTicket(); void SetSessionTicket(const QString &qsSessionTicket); const QString &CompanyFile(); void SetCompanyFile(const QString &qsCompanyFile); int UpdateDelay(); void SetUpdateDelay(int iUpdateDelay); int UpdateInterval(); void SetUpdateInterval(int iUpdateInterval); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Authenticate(QBWCServerAuthenticateEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireAuthenticate(QBWCServerAuthenticateEventParams *e) {...}
Remarks
This event fires when the QuickBooks Web Connector attempts authentication.
You may use this event to accept the connection, reject the connection, postpone the update, or skip the update. The parameters are as follows:
User is the username that is presented by QuickBooks Web Connector.
Password is the password that is presented for the user.
Accept determines whether the connection request is accepted. The values of User and Password should be verified within this event to determine if the user credentials are valid. The default value is True.
Busy may be set to True to inform QuickBooks Web Connector that the application is busy and to try again later. The default is False. When set to True it is not necessary to set Accept to False.
NoWork may be set to True to inform QuickBoooks Web Connector that there is no work to process and to stop the update. When set to True it is not necessary to set Accept to False.
SessionTicket is a string value which identifies the session and will be available within other events. The class populates this with a GUID but you may choose to set your own value.
CompanyFile should be set to the full path to the company file on the system running QuickBooks which you want to work with. Leave this set to empty string to indicate that the currently opened company file should be used.
UpdateDelay allows you to postpone the update for the specified number of seconds. When set to True it is not necessary to set Accept to False.
UpdateInterval may be set to specify the interval in seconds at which the QuickBooks Web Connector will begin an update. If the user has enabled the "Auto-Run" option on QuickBooks Web Connector this will update the "Every_Min" field. Note that the user may choose to change the value. If the user has not enabled "Auto-Run" this is not applicable, but will not cause an error.
ClientVersion Event (QBWCServer Class)
Provides the QuickBooks Web Connector version information.
Syntax
ANSI (Cross Platform) virtual int FireClientVersion(QBWCServerClientVersionEventParams *e);
typedef struct {
const char *ClientVersion;
char *RequiredVersion;
char *ErrorMessage;
char *WarningMessage; int reserved; } QBWCServerClientVersionEventParams;
Unicode (Windows) virtual INT FireClientVersion(QBWCServerClientVersionEventParams *e);
typedef struct {
LPCWSTR ClientVersion;
LPWSTR RequiredVersion;
LPWSTR ErrorMessage;
LPWSTR WarningMessage; INT reserved; } QBWCServerClientVersionEventParams;
#define EID_QBWCSERVER_CLIENTVERSION 2 virtual INT INQB_CALL FireClientVersion(LPSTR &lpszClientVersion, LPSTR &lpszRequiredVersion, LPSTR &lpszErrorMessage, LPSTR &lpszWarningMessage);
class QBWCServerClientVersionEventParams { public: const QString &ClientVersion(); const QString &RequiredVersion(); void SetRequiredVersion(const QString &qsRequiredVersion); const QString &ErrorMessage(); void SetErrorMessage(const QString &qsErrorMessage); const QString &WarningMessage(); void SetWarningMessage(const QString &qsWarningMessage); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void ClientVersion(QBWCServerClientVersionEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireClientVersion(QBWCServerClientVersionEventParams *e) {...}
Remarks
This event fires with the version information for QuickBooks Web Connector.
In most cases you do not need to do anything within this event. If no action is taken the session will proceed normally. You may optionally set parameters in this event to return an error, warning, or version requirement. The parameters are as follow:
ClientVersion holds the version of QuickBooks Web Connector that is connecting to your application. For instance "2.1.0.30".
RequiredVersion specifies the required version of QuickBooks Web Connector. You may set this to a value like "2.0". This is the minimum supported version of QuickBooks Web Connector which you will allow.
ErrorMessage may be set to return an error to QuickBooks Web Connector.
WarningMessage may be set to return a warning to QuickBooks Web Connector. The user will be prompted to continue or cancel the update.
CloseConnection Event (QBWCServer Class)
Fires when the update session completes.
Syntax
ANSI (Cross Platform) virtual int FireCloseConnection(QBWCServerCloseConnectionEventParams *e);
typedef struct {
const char *SessionTicket;
char *ResponseMessage; int reserved; } QBWCServerCloseConnectionEventParams;
Unicode (Windows) virtual INT FireCloseConnection(QBWCServerCloseConnectionEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPWSTR ResponseMessage; INT reserved; } QBWCServerCloseConnectionEventParams;
#define EID_QBWCSERVER_CLOSECONNECTION 3 virtual INT INQB_CALL FireCloseConnection(LPSTR &lpszSessionTicket, LPSTR &lpszResponseMessage);
class QBWCServerCloseConnectionEventParams { public: const QString &SessionTicket(); const QString &ResponseMessage(); void SetResponseMessage(const QString &qsResponseMessage); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void CloseConnection(QBWCServerCloseConnectionEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireCloseConnection(QBWCServerCloseConnectionEventParams *e) {...}
Remarks
This event fires when QuickBooks Web Connector notifies your application that the update is complete. This is the last event to fire in a session. Parameters are as follows:
SessionTicket identifies the session.
ResponseMessage may be set to a message that will be displayed in the "Last result" field in QuickBooks Web Connector.
ConnectionError Event (QBWCServer Class)
Fires when QuickBooks Web Connector is unable to connect to QuickBooks.
Syntax
ANSI (Cross Platform) virtual int FireConnectionError(QBWCServerConnectionErrorEventParams *e);
typedef struct {
const char *SessionTicket;
const char *ErrorCode;
const char *ErrorMessage;
char *CompanyFile; int reserved; } QBWCServerConnectionErrorEventParams;
Unicode (Windows) virtual INT FireConnectionError(QBWCServerConnectionErrorEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPCWSTR ErrorCode;
LPCWSTR ErrorMessage;
LPWSTR CompanyFile; INT reserved; } QBWCServerConnectionErrorEventParams;
#define EID_QBWCSERVER_CONNECTIONERROR 4 virtual INT INQB_CALL FireConnectionError(LPSTR &lpszSessionTicket, LPSTR &lpszErrorCode, LPSTR &lpszErrorMessage, LPSTR &lpszCompanyFile);
class QBWCServerConnectionErrorEventParams { public: const QString &SessionTicket(); const QString &ErrorCode(); const QString &ErrorMessage(); const QString &CompanyFile(); void SetCompanyFile(const QString &qsCompanyFile); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void ConnectionError(QBWCServerConnectionErrorEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireConnectionError(QBWCServerConnectionErrorEventParams *e) {...}
Remarks
This event fires when QuickBooks Web Connector is unable to connect to QuickBooks. The event parameters provide the error details, and also allow you to specify an alternate company file to retry the connection with. If an alternate company file is not specified the session is ended. The parameters are as follows:
ErrorCode is the error code (HResult) returned by QuickBooks. This value is read-only.
ErrorMessage is the error message returned by QuickBooks. This value is read-only.
CompanyFile may be set to the full path of an alternate company file. If specified, the QuickBooks Web Connector will retry the connection to QuickBooks using this company file. Leave this parameter empty to end the session.
Error Event (QBWCServer Class)
Information about errors during data delivery.
Syntax
ANSI (Cross Platform) virtual int FireError(QBWCServerErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } QBWCServerErrorEventParams;
Unicode (Windows) virtual INT FireError(QBWCServerErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } QBWCServerErrorEventParams;
#define EID_QBWCSERVER_ERROR 5 virtual INT INQB_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class QBWCServerErrorEventParams { public: int ErrorCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Error(QBWCServerErrorEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireError(QBWCServerErrorEventParams *e) {...}
Remarks
The Error event is fired in case of exceptional conditions during message processing.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
GetInteractiveURL Event (QBWCServer Class)
Fires when the URL for an interactive session is needed.
Syntax
ANSI (Cross Platform) virtual int FireGetInteractiveURL(QBWCServerGetInteractiveURLEventParams *e);
typedef struct {
const char *SessionTicket;
char *URL; int reserved; } QBWCServerGetInteractiveURLEventParams;
Unicode (Windows) virtual INT FireGetInteractiveURL(QBWCServerGetInteractiveURLEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPWSTR URL; INT reserved; } QBWCServerGetInteractiveURLEventParams;
#define EID_QBWCSERVER_GETINTERACTIVEURL 6 virtual INT INQB_CALL FireGetInteractiveURL(LPSTR &lpszSessionTicket, LPSTR &lpszURL);
class QBWCServerGetInteractiveURLEventParams { public: const QString &SessionTicket(); const QString &URL(); void SetURL(const QString &qsURL); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void GetInteractiveURL(QBWCServerGetInteractiveURLEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireGetInteractiveURL(QBWCServerGetInteractiveURLEventParams *e) {...}
Remarks
This event fires when QuickBooks Web Connector requests the URL for an interactive session.
If you set the InteractiveMode parameter in the GetLastError event this event will then fire so that you may provide the URL for the interactive session. The available parameters are:
SessionTicket identifies the session.
URL specifies the URL for the interactive session on your site. This must be a secure (https://) URL.
GetLastError Event (QBWCServer Class)
Fires when QuickBooks Web Connector checks for error information.
Syntax
ANSI (Cross Platform) virtual int FireGetLastError(QBWCServerGetLastErrorEventParams *e);
typedef struct {
const char *SessionTicket;
int Pause;
int InteractiveMode;
char *ErrorMessage; int reserved; } QBWCServerGetLastErrorEventParams;
Unicode (Windows) virtual INT FireGetLastError(QBWCServerGetLastErrorEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
BOOL Pause;
BOOL InteractiveMode;
LPWSTR ErrorMessage; INT reserved; } QBWCServerGetLastErrorEventParams;
#define EID_QBWCSERVER_GETLASTERROR 7 virtual INT INQB_CALL FireGetLastError(LPSTR &lpszSessionTicket, BOOL &bPause, BOOL &bInteractiveMode, LPSTR &lpszErrorMessage);
class QBWCServerGetLastErrorEventParams { public: const QString &SessionTicket(); bool Pause(); void SetPause(bool bPause); bool InteractiveMode(); void SetInteractiveMode(bool bInteractiveMode); const QString &ErrorMessage(); void SetErrorMessage(const QString &qsErrorMessage); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void GetLastError(QBWCServerGetLastErrorEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireGetLastError(QBWCServerGetLastErrorEventParams *e) {...}
Remarks
This event allows you to report an error to QuickBooks Web Connector. It will be fired whenever QuickBooks Web Connector detects an error condition and asks your application for details. The parameters are as follows:
SessionTicket identifies the session.
Pause may be set to True to introduce a brief delay, after which QuickBooks Web Connector will retry the previous operation. For instance, the following sequence of events may occur:
- QuickBooks Web Connector makes a call and SendRequest fires.
- You set the Request parameter inside SendRequest to empty string.
- QuickBooks Web Connector determines the empty request as an error and makes a call which fires the GetLastError event.
- You set the Pause parameter inside this event to True.
- QuickBooks Web Connector reads the response and waits 5 seconds.
- QuickBooks Web Connector retries the previous operation and makes a call which fires SendRequest again.
InteractiveMode may be set to request interactive mode. When set to True the QuickBooks Web Connector will prompt the user to accept an interactive session. If the user agrees, QuickBooks Web Connector will make a call and the GetInteractiveURL event will fire. If the user declines, QuickBooks Web Connector will report this and the InteractiveRejected event will fire.
ErrorMessage may be set to any string which will be reported to the QuickBooks Web Connector.
InteractiveDone Event (QBWCServer Class)
This event fires when QuickBooks Web Connector checks to see if the interactive session is finished.
Syntax
ANSI (Cross Platform) virtual int FireInteractiveDone(QBWCServerInteractiveDoneEventParams *e);
typedef struct {
const char *SessionTicket;
char *Response; int reserved; } QBWCServerInteractiveDoneEventParams;
Unicode (Windows) virtual INT FireInteractiveDone(QBWCServerInteractiveDoneEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPWSTR Response; INT reserved; } QBWCServerInteractiveDoneEventParams;
#define EID_QBWCSERVER_INTERACTIVEDONE 8 virtual INT INQB_CALL FireInteractiveDone(LPSTR &lpszSessionTicket, LPSTR &lpszResponse);
class QBWCServerInteractiveDoneEventParams { public: const QString &SessionTicket(); const QString &Response(); void SetResponse(const QString &qsResponse); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void InteractiveDone(QBWCServerInteractiveDoneEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireInteractiveDone(QBWCServerInteractiveDoneEventParams *e) {...}
Remarks
While the interactive session is open QuickBooks Web Connector will periodically poll your application to see if the session is finished. The response you provide determines if the session has ended or is still open.
SessionTicket identifies the session.
Response specifies whether the session has ended or not. Set this to empty string to "Done" to indicate the session has finished. Set this to any other value such as "Continue" to indicate the session is still ongoing.
InteractiveRejected Event (QBWCServer Class)
This event fires after a user rejects an interactive session.
Syntax
ANSI (Cross Platform) virtual int FireInteractiveRejected(QBWCServerInteractiveRejectedEventParams *e);
typedef struct {
const char *SessionTicket;
const char *ReasonMessage;
char *ResponseMessage; int reserved; } QBWCServerInteractiveRejectedEventParams;
Unicode (Windows) virtual INT FireInteractiveRejected(QBWCServerInteractiveRejectedEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPCWSTR ReasonMessage;
LPWSTR ResponseMessage; INT reserved; } QBWCServerInteractiveRejectedEventParams;
#define EID_QBWCSERVER_INTERACTIVEREJECTED 9 virtual INT INQB_CALL FireInteractiveRejected(LPSTR &lpszSessionTicket, LPSTR &lpszReasonMessage, LPSTR &lpszResponseMessage);
class QBWCServerInteractiveRejectedEventParams { public: const QString &SessionTicket(); const QString &ReasonMessage(); const QString &ResponseMessage(); void SetResponseMessage(const QString &qsResponseMessage); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void InteractiveRejected(QBWCServerInteractiveRejectedEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireInteractiveRejected(QBWCServerInteractiveRejectedEventParams *e) {...}
Remarks
This event fires after a user rejects an interactive session. After requesting an interactive session within GetLastError the user may reject the request. If the request is rejected this event will fire with the reason and allow you to send a message back which will be displayed in QuickBooks Web Connector. The parameters are as follows:
SessionTicket identifies the session.
ReasonMessage is the reason for the rejection as reported by QuickBooks Web Connector. This will be text like "User rejected interactive mode".
ResponseMessage may be set to a string that will be displayed as the "Last Result" in QuickBooks Web Connector.
ReceiveResponse Event (QBWCServer Class)
Fires when a response is received.
Syntax
ANSI (Cross Platform) virtual int FireReceiveResponse(QBWCServerReceiveResponseEventParams *e);
typedef struct {
const char *SessionTicket;
const char *Response;
const char *ErrorCode;
const char *ErrorMessage;
int Success;
int PercentDone; int reserved; } QBWCServerReceiveResponseEventParams;
Unicode (Windows) virtual INT FireReceiveResponse(QBWCServerReceiveResponseEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPCWSTR Response;
LPCWSTR ErrorCode;
LPCWSTR ErrorMessage;
BOOL Success;
INT PercentDone; INT reserved; } QBWCServerReceiveResponseEventParams;
#define EID_QBWCSERVER_RECEIVERESPONSE 10 virtual INT INQB_CALL FireReceiveResponse(LPSTR &lpszSessionTicket, LPSTR &lpszResponse, LPSTR &lpszErrorCode, LPSTR &lpszErrorMessage, BOOL &bSuccess, INT &iPercentDone);
class QBWCServerReceiveResponseEventParams { public: const QString &SessionTicket(); const QString &Response(); const QString &ErrorCode(); const QString &ErrorMessage(); bool Success(); int PercentDone(); void SetPercentDone(int iPercentDone); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void ReceiveResponse(QBWCServerReceiveResponseEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireReceiveResponse(QBWCServerReceiveResponseEventParams *e) {...}
Remarks
This event fires after SendRequest to provide the response of the request. The parameters are as follows:
SessionTicket identifies the session.
Response holds the qbXML response. This may be passed to the QBResponseAggregate property or InputQBXML method of other classs in this toolkit to parse the response. In the case of an error this parameter will be empty. This value is read-only.
ErrorCode holds the error code (HResult) returned by QuickBooks. This value is read-only.
ErrorMessage holds the error message returned by QuickBooks. This value is read-only.
Success indicates whether the request was processed successfully by QuickBooks. If this value is False check HResult and Message for details. This value is read-only.
PercentDone indicates the current progress to QuickBooks Web Connector. A value of 100 means there are no more requests to be processed for this session.
A positive value less than 100 indicates there is still more work to do in this session and QuickBooks Web Connector will make another call and SendRequest will fire again. There is no limit to the number of requests in a session, so you may continue to set this value to a positive number less than 100 to continue the session.
A negative value indicates and error and will cause GetLastError to fire.
The default value is 100, which indicates there is no more work to do for this session.
SendRequest Event (QBWCServer Class)
Fires when QuickBooks Web Connector asks for a request.
Syntax
ANSI (Cross Platform) virtual int FireSendRequest(QBWCServerSendRequestEventParams *e);
typedef struct {
const char *SessionTicket;
const char *CompanyResponse;
const char *HostResponse;
const char *PrefsResponse;
const char *CompanyFile;
const char *QBXMLCountry;
int QBXMLMajorVersion;
int QBXMLMinorVersion;
char *Request; int reserved; } QBWCServerSendRequestEventParams;
Unicode (Windows) virtual INT FireSendRequest(QBWCServerSendRequestEventParams *e);
typedef struct {
LPCWSTR SessionTicket;
LPCWSTR CompanyResponse;
LPCWSTR HostResponse;
LPCWSTR PrefsResponse;
LPCWSTR CompanyFile;
LPCWSTR QBXMLCountry;
INT QBXMLMajorVersion;
INT QBXMLMinorVersion;
LPWSTR Request; INT reserved; } QBWCServerSendRequestEventParams;
#define EID_QBWCSERVER_SENDREQUEST 11 virtual INT INQB_CALL FireSendRequest(LPSTR &lpszSessionTicket, LPSTR &lpszCompanyResponse, LPSTR &lpszHostResponse, LPSTR &lpszPrefsResponse, LPSTR &lpszCompanyFile, LPSTR &lpszQBXMLCountry, INT &iQBXMLMajorVersion, INT &iQBXMLMinorVersion, LPSTR &lpszRequest);
class QBWCServerSendRequestEventParams { public: const QString &SessionTicket(); const QString &CompanyResponse(); const QString &HostResponse(); const QString &PrefsResponse(); const QString &CompanyFile(); const QString &QBXMLCountry(); int QBXMLMajorVersion(); int QBXMLMinorVersion(); const QString &Request(); void SetRequest(const QString &qsRequest); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void SendRequest(QBWCServerSendRequestEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireSendRequest(QBWCServerSendRequestEventParams *e) {...}
Remarks
This event fires when QuickBooks Web Connector is ready to accept a request. The purpose of the event is to provide a request to QuickBooks Web Connector. The parameters are as follows:
SessionTicket identifies the session. This value is read-only.
CompanyResponse holds a QBXML response to a Company Query. This is automatically provided by QuickBooks Web Connector the first time this event fires for a session and may be passed to the QBResponseAggregate property of the Company class. This value is read-only.
HostResponse holds a QBXML response to a Host Query. This is automatically provided by QuickBooks Web Connector the first time this event fires for a session and may be passed to the QBResponseAggregate property of the Company class. This value is read-only.
PrefsResponse holds a QBXML response to a Preferences Query. This is automatically provided by QuickBooks Web Connector the first time this event fires for a session and may be passed to the QBResponseAggregate property of the Company class. This value is read-only.
CompanyFile specifies the path to the company file that will be used in the data exchange. This value is read-only.
QBXMLCountry is the country version of QuickBooks. For instance "US", "CA", or "UK". This value is read-only.
QBXMLMajorVersion is the major version of the qbXML request processor (QBSDK version). For instance if the qbXML specification version is "6.0" this value will be "6". This value is read-only.
QBXMLMinorVersion is the minor version of the qbXML request processor (QBSDK version). For instance if the qbXML specification version is "6.0" this value will be "0". This value is read-only.
Request specifies the qbXML request that will be sent to QuickBooks Web Connector. This may be obtained from other classs in the toolkit by setting the QBRequestMode property to Offline. See the help for QBRequestMode for mode details.
Note: If the Request parameter is left empty QuickBooks Web Connector will then make a call and GetLastError will fire. This approach may be used if you wish to return an error, request interactive mode, or introduce a brief pause.
ServerVersion Event (QBWCServer Class)
Fires when QuickBooks Web Connector requests the version of your application.
Syntax
ANSI (Cross Platform) virtual int FireServerVersion(QBWCServerServerVersionEventParams *e);
typedef struct {
char *Version; int reserved; } QBWCServerServerVersionEventParams;
Unicode (Windows) virtual INT FireServerVersion(QBWCServerServerVersionEventParams *e);
typedef struct {
LPWSTR Version; INT reserved; } QBWCServerServerVersionEventParams;
#define EID_QBWCSERVER_SERVERVERSION 12 virtual INT INQB_CALL FireServerVersion(LPSTR &lpszVersion);
class QBWCServerServerVersionEventParams { public: const QString &Version(); void SetVersion(const QString &qsVersion); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void ServerVersion(QBWCServerServerVersionEventParams *e);
// Or, subclass QBWCServer and override this emitter function. virtual int FireServerVersion(QBWCServerServerVersionEventParams *e) {...}
Remarks
This event fires when QuickBooks Web Connector requests the version of your application.
Version may be set to any string value. The value you specify will be displayed to the user when they click the more information link in QuickBooks Web Connector.
Config Settings (QBWCServer Class)
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.QBWCServer Config Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
QBType:
The type of QuickBooks software the connection will be made to.This setting is applicable when calling CreateQWCFile. It specifies whether the application
will connect to QuickBooks, or QuickBooks POS (Point of Sale). Possible values are:
You should only set this when generating a QWC file designed for an application that will connect to QuickBooks POS. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Style:
Specifies the SOAP encoding style used in requests made by QuickBooks Web Connector.This setting is applicable when calling CreateQWCFile. It specifies the SOAP encoding
style used in the requests made by QuickBooks Web Connector.
When using the QBWCServer class to process requests this should not be set.
Possible values are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Base Config Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BuildInfo: Information about the product's build.When queried, this setting will return a string containing information about the product's build. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodePage:
The system code page used for Unicode to Multibyte translations.The default code page is Unicode UTF-8 (65001).
The following is a list of valid code page identifiers:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LicenseInfo:
Information about the current license.When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MaskSensitive:
Whether sensitive data is masked in log messages.In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.
This setting only works on these classes: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ProcessIdleEvents: Whether the class uses its internal event loop to process events when the main thread is idle.If set to False, the class will not fire internal idle events. Set this to False to use the class in a background thread on Mac OS. By default, this setting is True. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SelectWaitMillis: The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.If there are no events to process when DoEvents is called, the class will wait for the amount of time specified here before returning. The default value is 20. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UseInternalSecurityAPI:
Tells the class whether or not to use the system security libraries or an internal implementation.
When set to false, the class will use the system security libraries by default to perform cryptographic functions where applicable.
Setting this setting to true tells the class to use the internal implementation instead of using the system security libraries. On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default. To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the OpenSSL Notes section. |
Trappable Errors (QBWCServer Class)
Error Handling (C++)
Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
ErrorsThe following errors may be generated by the class. Note that frequently the error message will contain more specific information than what is listed here.
QBWCServer Errors
101 String too long. | |
103 Invalid date format (YYYY-MM-DD is standard). | |
104 Invalid value for enumerated field. | |
105 Invalid integer. | |
106 Invalid dollar amount. | |
107 Invalid boolean value (must be 'true' or 'false'). | |
108 Invalid number. | |
111 Invalid special characters in string. | |
112 Invalid special field syntax. | |
181 Could not load certificate file. | |
201 Required field unspecified. | |
211 Unsupported field specified. | |
301 Array line count must be nonnegative. | |
302 Array index out of bounds. | |
303 Invalid field index. | |
401 Field not accessible as a special field. | |
402 Write access attempted of readonly field. | |
403 Read access attempted of writeonly field. | |
421 The object cannot be modified. | |
511 The QBRequestId has been previously used. Please generate a new one. | |
601 Could not access QuickBooks. | |
602 Could not open specified file. | |
603 The version of QuickBooks currently being used is not supported. | |
604 QuickBooks has not been installed properly. | |
605 The specified file was of an incorrect version. | |
606 Could not start QuickBooks. | |
607 QuickBooks is open in a mode different than the one requested. | |
608 QuickBooks cannot currently be accessed. | |
609 An application name must be specified. | |
610 A file name must be specified if one is not currently open in QuickBooks. | |
611 Access denied. | |
612 QuickBooks is busy and cannot open your application in the mode requested. | |
699 The connection to QuickBooks has failed for an unknown reason. | |
702 The object requested does not exist in QuickBooks. | |
751 Unsupported QBXML version. | |
752 The QBXMLVersion chosen is insufficient to execute the request. | |
801 A QuickBooks internal error has occurred. | |
802 QuickBooks is not available due to a system-related problem. | |
803 The Id specified is invalid. | |
804 Invalid object name. | |
805 The name already exists in QuickBooks. | |
807 An object could not be found in QuickBooks. | |
808 A reference did not refer to an object that exists in QuickBooks. | |
809 The object is currently in use by the QuickBooks end user. | |
810 The object may not be added. | |
811 The object may not be updated because it is obsolete. | |
812 The address is invalid. | |
813 Permission to perform this operation is not granted. | |
814 The request has not been processed. | |
815 Time creation mismatch. | |
816 The feature is turned off or not enabled. | |
817 Permission level configured is insufficient for access. | |
818 The item specified was of an unknown type. | |
819 The object may not be changed. | |
820 An internal QuickBooks error has occurred. | |
821 An attempt was made to use a connection that was not properly initiated. | |
822 An attempt was made to use a connection that is invalid or was previously closed. | |
823 Not enough memory. | |
824 Unable to lock the necessary information to allow this application access to the company file. Try again later. | |
850 An older version of QuickBooks 2002 is being used. Please download the latest update from Intuit. | |
851 The QuickBooks request processor was not found. Check that QuickBooks Pro 2002 or higher is installed on your system. | |
861 Server error on WebExport (details follow). | |
862 The WebExport is impossible: an HTTP context was not found. | |
871 You may not set the value of QBConnectionTicket. This value is readonly. | |
880 Interrupted by the user. | |
881 An error has occurred connecting to a remote machine. | |
899 An unknown QuickBooks error has occurred. The message contains more details. | |
901 XML Parser Error. Should not occur under normal circumstances. | |
899 An XML or other QuickBooks error has occurred. |