QuickBooks Integrator 2020 Kotlin Edition

Questions / Feedback?

ProcessRequest Method

Processes the request.

Syntax

public fun processRequest()

Remarks

This method processes the request. A request is made by QuickBooks Web Connector to your web based application. The request may be supplied to the component in a variety of ways. You may simply call ReadRequest to read the request directly from the HTTP context. You may call SetRequestStream to specify the request stream. You may read the request yourself and supply it 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:

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. To send the response you may either send the response yourself, call the SendResponse method, or set SetResponseStream prior to calling this method.

When sending the response you MUST set the Content-Type header to "text/xml".

Example #1: Process a request and let the component read from the HTTP context and write the response.

QWCServer1.ReadRequest();
QWCServer1.ProcessRequest();
QWCServer1.SendResponse();
Note: The Content-Type header is automatically set to "text/xml" and the Response is closed by the component.

Example #2: Pass streams to the component for the request and response.

QWCServer1.SetRequestStream(Request.InputStream);
QWCServer1.SetResponseStream(Response.OutputStream);
QWCServer1.ProcessRequest();
Response.ContentType = "text/xml";      
Response.Flush();
Response.End();
Note: ContentType must be set to "text/xml" and the Response must be closed.

Example #3: Read the request and send the response outside of the component.

byte[] reqBytes = Request.BinaryRead(Request.ContentLength);
QWCServer1.RequestData = System.Text.Encoding.Default.GetString(reqBytes);
QWCServer1.ProcessRequest();
Response.ContentType = "text/xml";
Response.Write(QWCServer1.ResponseData);
Response.Flush();
Response.End();
Note: ContentType must be set to "text/xml" and the Response must be closed.

Copyright (c) 2021 /n software inc. - All rights reserved.
QuickBooks Integrator 2020 Kotlin Edition - Version 20.0 [Build 7941]