...
Best practices for programmatically handling rate limit errors is to pause all attempts to invoke Projector Services for a period of time after a rate limit error is raised, and then to retry failed invocations after that pause. If you specify a pause that is less than the rolling window size (currently 60 seconds), you may want to iteratively use your handling until 60 seconds have elapsed since the first failure. Please consider pausing for at least five seconds before any retries.
Request Usage Example(s)
ALGORITHM DESCRIPTION:
...
1
...
ATAj5CRx7eosFAdLjFCVyg==
...
Request Usage Example(s)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pws="http://projectorpsa.com/PwsProjectorServices/" xmlns:req="http://projectorpsa.com/DataContracts/Requests/" xmlns:com="http://projectorpsa.com/DataContracts/Shared/Common/">
<soapenv:Header/>
<soapenv:Body>
<pws:PwsGetClient>
<pws:serviceRequest>
<req:RequestId>1</req:RequestId>
<req:SessionTicket>ATAj5CRx7eosFAdLjFCVyg==</req:SessionTicket>
<req:ClientIdentities>
<com:PwsClientRef>
<com:ClientNumber>C000158</com:ClientNumber>
</com:PwsClientRef>
</req:ClientIdentities>
</pws:serviceRequest>
</pws:PwsGetClient>
</soapenv:Body>
</soapenv:Envelope> |
...
Panel | ||
---|---|---|
| ||
|
...
The web service response status and message. Click here for more information.
...
2023-11-06T18:17:57.6501708Z
...
Response Usage Example(s)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<PwsGetClientResponse xmlns="http://projectorpsa.com/PwsProjectorServices/">
<PwsGetClientResult xmlns:a="http://projectorpsa.com/DataContracts/Responses/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Messages xmlns="http://projectorpsa.com/CommonServices/" xmlns:b="http://projectorpsa.com/DataContracts/Shared/Common/">
<b:PwsMessage>
<b:AdditionalErrorText>Message 136: This request was executed against the QA [appqa.projectorpsa.com] environment.</b:AdditionalErrorText>
<b:ErrorCode>NonProductionEnvironment</b:ErrorCode>
<b:ErrorNumber>136</b:ErrorNumber>
<b:ErrorText>This web service request was executed against a non-production instance of Projector.</b:ErrorText>
<b:Type>Information</b:Type>
<b:ReferenceId1 i:nil="true"/>
<b:ReferenceId2 i:nil="true"/>
</b:PwsMessage>
</Messages>
<ResponseId xmlns="http://projectorpsa.com/CommonServices/">1</ResponseId>
<Status xmlns="http://projectorpsa.com/CommonServices/">Ok</Status>
<ServerTimestampUtc xmlns="http://projectorpsa.com/CommonServices/">2023-11-06T18:17:57.6501708Z</ServerTimestampUtc>
<a:Clients xmlns:b="http://projectorpsa.com/DataContracts/Shared/Common/">
<b:PwsClientElement>
<b:ClientDetail>
<b:ClientId i:nil="true"/>
<b:ClientNumber>C000158</b:ClientNumber>
<b:ClientUid>1152921504607017770</b:ClientUid>
<b:ClientName>Projector PSA</b:ClientName>
<b:InactiveFlag>false</b:InactiveFlag>
<b:ParentClientIdentity i:nil="true"/>
<b:Address>
<b:AddressLine1>98 N Washington Street</b:AddressLine1>
<b:AddressLine2 i:nil="true"/>
<b:Attention i:nil="true"/>
<b:City>Boston</b:City>
<b:CompanyName>Projector PSA</b:CompanyName>
<b:Country>United States</b:Country>
<b:StateOrProvince>MA</b:StateOrProvince>
<b:ZipOrPostalCode>02114</b:ZipOrPostalCode>
</b:Address>
<b:BillingCycleIdentity>
<b:BillingCycleId i:nil="true"/>
<b:BillingCycleName>Monthly</b:BillingCycleName>
<b:BillingCycleUid>1152921504606853180</b:BillingCycleUid>
</b:BillingCycleIdentity>
<b:BillingInstructions i:nil="true"/>
<b:ClientMessage i:nil="true"/>
<b:ClientMessagePlain i:nil="true"/>
<b:InheritAddressFlag>false</b:InheritAddressFlag>
<b:InheritBillingCycleFlag>false</b:InheritBillingCycleFlag>
<b:InheritBillingInstructionsFlag>false</b:InheritBillingInstructionsFlag>
<b:InheritClientMessageFlag>false</b:InheritClientMessageFlag>
<b:InheritInvoiceContentFlag>false</b:InheritInvoiceContentFlag>
<b:InheritInvoiceScopeFlag>false</b:InheritInvoiceScopeFlag>
<b:InheritInvoiceTemplateFlag>false</b:InheritInvoiceTemplateFlag>
<b:InheritPaymentTermFlag>false</b:InheritPaymentTermFlag>
<b:InheritPurchaseOrderNumberFlag>false</b:InheritPurchaseOrderNumberFlag>
<b:InheritStandardRatesFlag>true</b:InheritStandardRatesFlag>
<b:InheritTimeBillingTypeFlag>false</b:InheritTimeBillingTypeFlag>
<b:InvoiceContent>B</b:InvoiceContent>
<b:InvoiceScope>E</b:InvoiceScope>
<b:InvoiceTemplateIdentity i:nil="true"/>
<b:NewClientNumber i:nil="true"/>
<b:PaymentTermIdentity>
<b:PaymentTermId i:nil="true"/>
<b:PaymentTermName>Net 30</b:PaymentTermName>
<b:PaymentTermUid>1152921504606856054</b:PaymentTermUid>
</b:PaymentTermIdentity>
<b:PurchaseOrderNumber i:nil="true"/>
<b:StandardBillingAdjustedDiscountPercent i:nil="true"/>
<b:StandardContractDiscountPercent i:nil="true"/>
<b:StandardRateCardIdentity i:nil="true"/>
<b:TimeBillingType>H</b:TimeBillingType>
<b:Timestamp>AAAAADI328g=</b:Timestamp>
<b:UserDefinedFields/>
<b:InheritInvoiceEmailSettingsFlag>false</b:InheritInvoiceEmailSettingsFlag>
<b:InvoiceEmailSettings>
<b:EmailFromUserIdentity i:nil="true"/>
<b:EmailInvoiceTemplateIdentity i:nil="true"/>
<b:InvoiceEmailEnabledFlag>false</b:InvoiceEmailEnabledFlag>
<b:InvoiceEmailType i:nil="true"/>
<b:Recipients/>
</b:InvoiceEmailSettings>
<b:InheritRenderReceiptsFlag>false</b:InheritRenderReceiptsFlag>
<b:RenderReceiptsFlag>false</b:RenderReceiptsFlag>
<b:AutoApplyAvailableBalanceFlag>false</b:AutoApplyAvailableBalanceFlag>
<b:InheritAutoApplyAvailableBalanceFlag>false</b:InheritAutoApplyAvailableBalanceFlag>
<b:InheritTaxTypesFlag>true</b:InheritTaxTypesFlag>
<b:TaxType1Identity i:nil="true"/>
<b:TaxType2Identity i:nil="true"/>
<b:TaxType3Identity i:nil="true"/>
<b:InheritRenderedInvoiceFormatFlag>false</b:InheritRenderedInvoiceFormatFlag>
<b:RenderedInvoiceFormat>P</b:RenderedInvoiceFormat>
<b:Prefix>PPSA</b:Prefix>
</b:ClientDetail>
<b:InvoiceRecipients/>
<b:NumClientLevels>4</b:NumClientLevels>
</b:PwsClientElement>
</a:Clients>
</PwsGetClientResult>
</PwsGetClientResponse>
</s:Body>
</s:Envelope> |
PwsGetClient - Common Errors and Warnings
...
Algorithm Description
Projector now keeps a count of the number of “Service Hits” that are incurred during a rolling window of time per Installation (AKA Account), per User, and per Session. Each service is allocated a “Weight” depending on its average cost to our internal processing. When the service request is evaluated, that weight (measured in number of “hits”) is added to the previous number of service hits in each category (Installation, User, Session), and if the number exceeds a predefined limit or threshold in any of those categories, a rate limit error (or warning) is raised. When an error is raised, the service fails before it is even internally invoked. When a warning is raised, the service is invoked yielding a response, but that response will include the warning.
Currently, the various parameters that affect Rate Limiting are set as follows, but Projector reserves the right to change them as necessary to address the real-world usage:
- Rolling Window Size: Last 60 seconds
- Hit Limit per Installation/Account: 2400 / 60 seconds
- Hit Limit per User: 1800 / 60 seconds
- Hit Limit per Session: 1200 / 60 seconds
The actual hit count in each of the three categories and the current thresholds will be included in the error or warning returned to the consumer as part of the response when rate limiting is triggered.
The weight of every service (number of hits consumed by each invocation) is documented on the documentation page for that service.
PWS Service Responses
For the responses to PWS Services, when a Rate Limit Violation is encountered, the PWS Error Code that is raised is “RequestExceededRateLimit” with the Error Number of 10016. This is true whether or not the violation triggers a warning or an error in the response.
The Error Text will contain additional information about the specifics of the violation.
In the case of a warning, the violation details will be bundled in a PWS Message of type “Warning” included in the response payload.
In the case of an error, there will be an exception triggered with a PWS Fault. The violation details will be bundled within the PwsFault in a PwsMessage of type “Error”.
Legacy Service Responses
For the responses to Legacy Services, when a Rate Limit Violation is encountered, the Error Code that is raised is similarly “RequestExceededRateLimit”. This is true whether or not the violation triggers a warning or an error in the response.
The Error Message will contain additional information about the specifics of the violation. Whether an error or warning, the “Errors” array will contain an “Error” with the details of the violation.
In the case of a warning, the service will respond with the Result of “Ok”, and the Severity of the Error will be marked “Warning”.
In the case of an error, the service will respond with the Result of “Fail”, and the Severity of the Error will be marked “Error”.
Testing
When writing code that consumes Projector Services, you may want to test or simulate the situation where you are exceeding established rate limits so that you can test the code you have written to handle those limits. A new PWS Service, PwsTestRateLimiter, is now provided for that purpose. You can use this service to artificially increase hits within the current rolling window so that your test may include how your code responds to rate limit errors. This service may also be used to return current parameters in use, and the current hit counts in play.