Inbound Service Requests

Inbound IService Requests are utilized when data is submitted to QBO and/or when other systems are targeting the QBO application. There are two categories of Inbound Requests:

  • Primary Inbound Request - This is the parent most or initial request. This is represented by the parent Service entry.
  • Child (nested) Inbound Request - Any inbound request that is a subsequent request associated with the parent request.

Use cases: 

  1. FNC Valuation Request using request stream and import framework to import valuation - example Parent Inbound Request
  2. QDS Valuation Request using parameters in query string to save the valuation record - example Parent Inbound Request
  3. FNC Status Update on an existing Valuation record created by Parent ServiceRequest - example Child Inbound Request
IService configuration properties and usage:

  • Name - Uniquely identifies IService
  • Type - Classname, Namespace registration of plug-in. 
    • Eg. "qbo.Service.InboundService.InboundRequest, qbo.Service.InboundService"
  • RequestMethod - method signature to invoke to process incoming data
    • Eg. "ImportFile/ImportByObject?Template=QDS.Product.SCRA" 
  • ImportFileTemplate - Used to store an ImportFileTemplate name which can be passed to plug-in to set ServiceRequest.ImportFile.ImportFileTemplate
  • ReturnType - OperationReturnType of ResponseMethod. 
    • Eg. XmlReader, Object, Void
  • RequireStream - boolean. In most cases, this is set to true. This will pass HttpContext.Request.RequestStream to the RequestMethod.
  • ResponseMethod - method signature for method invoked to produce response data. Method must have same return type specified in ReturnType property. In this scenario, response data could be the output of the import.
    • Eg. "ImportFile/ImportResultXml?ImportFileID={ImportFileID}"
  • ResponseTransform - Xslt used to transform data produced by ResponseMethod. This is used to format the response data to a specific format.
    • Eg. "Templates/Logging/ImportLog.ImportResult.xslt"
  • CompleteStep - boolean. Indicates to complete parent most ServiceRequest upon execution of this step

Sample Use Cases:

IService.FNC


<!-- Parent Inbound Request-->
<Service Name="FNCOrder"
       Type="qbo.Service.InboundService.InboundRequest, qbo.Service.InboundService"
       ReturnType="XmlReader"
       RequireStream="true"
       RequestMethod="ImportFile/ImportByObject?Template=FNCOrder"
       ResponseMethod="ImportFile/ImportResultXml?ImportFileID={ImportFileID}"
       ResponseTransform="Templates/Logging/ImportLog.ImportResult.xslt"
       >
  <Steps>
      <!-- Child Inbound Request-->
    <Step Name="StatusUpdate"
      Type="qbo.Service.InboundService.InboundRequest, qbo.Service.InboundService"
      ReturnType="XmlReader"
      RequireStream="true"
      RequestMethod="ImportFile/ImportByObject?Template=FNC.StatusUpdate"
      ResponseMethod="ImportFile/ImportResultXml?ImportFileID={ImportFileID}"
      ResponseTransform="Templates/Logging/ImportLog.ImportResult.xslt"/>

    <!-- Child Outbound Request-->
    <Step Name="ProductUpdate"
      Type="qbo.Service.HTTP.HttpExchange, qbo.Service.HTTP"
      ReturnType="Void"
      RequestMethod="Valuation/Select?ID={ID}"
      RequestTransform="Templates/Service/Step.ProductUpdate.Request.xslt"
      EndPoint="https://stage.quandis.com/Service/Exchange/ServiceOrderService.ashx/SubmitV3"/>
  </Steps>
</Service>

The Parent Service entry is "FNCOrder". The purpose is to accept inbound FNC valuation requests from from QDS. It will save a ServiceRequest record in the database with:
  • ServiceRequest = 'FNCOrder'
  • ServiceRequest.ExternalReference  = 'ServiceOrder'
  • ServiceRequest.ExternalReferenceID = ServiceOrderID passed in query string

Functionally the plug-in is configured to:

  • RequireStream - this allows the IService plug-in to utilize the stream submitted to the QBO application. In this case the stream will contain Xml submitted by QDS
  • RequestMethod - ImportFile/ImportByObject using ImportFileTemplate FNCOrder. ImportByObject will invoke the ImportFileTemplate and Import the streamed Xml. Upon completion, the plug-in will scan through the ImportLog and locate the first record from the table that matches ImportFileTemplate.AppliesTo. In this case ImportFileTemplate.AppliesTo = 'Valuation' so the plug-in bind ServiceRequest.Object/ObjectID to the newly inserted Valuation record. This binding of the Parent Service to the target object (Valuation) will allow Subsequent calls to IService to function.
  • ResponseMethod - This method will return the raw ImportLog information that will be streamed to the response for QDS to consume
  • ReturnType - Set to XmlReader which matches return type of method 'ImportFile/ImportResultXml'
  • ResponseTransform - This Xslt will transform the data from ResponseMethod into an ImportResult collection. This final format is what QDS will consume and is what is outputted by HttpHandler
The parent service can be accessed by invoking:

/Valuation/Valuation.ashx/FNCOrder?ServiceOrderID=x

and expects a request stream containing an Xml payload


The child Service entry is StatusUpdate. The purpose is to accept inbound FNC status updates from QDS. Functionally it's almost identical to QDS except that:

  • The plug-in will locate the parent ServiceRequest based on the query string values submitted by QDS and set the ServiceRequest.ParentServiceRequestID to the ServiceRequestID created above
The child service can be accessed by invoking:

/Valuation/Valuation.ashx/FNCOrder/StatusUpdate?ServiceRequestID={ServiceRequestID returned by parent call}

and expects a request stream containing an Xml payload

Note the child request operation is added after the parent request. Also, the query string contains a reference to the parent ServiceRequestID
Comments