I've been doing some experimenting on my development VM.
I have a UI-only plugin (Stripe) that has a startup check that throws an exception if it fails - with a UI active, it triggers a messagebox.
For the API, it causes some other weirdness that I can't remember now that I've spent the last 6 hours on something completely different (customers and their problems...)
For my current purposes, I have changed the error-handling to ignore. Which seems to work so far.
But that may have all been a red herring.
My API is currently using 'Admin' (because it's a dev VM) and I decided to experiment and so created a new user called "API". And a new service account to run it under. The service account seems to be working ok, but if I use my new Jiwa user, I get weird errors. like the one below, which works fine when I started the API using Admin (in either case using my new Windows "service" account).
From POSTMAN when testing (with some abbreviating for clarity).
- Code: Select all
{
"ResponseStatus": {
"ErrorCode": "InvalidOperationException",
"Message": "ExecuteReader: Connection property has not been initialized.",
"StackTrace": "[SalesQuoteMAKEORDERRequest: 28/10/2022 02:42:25]:
[REQUEST: {QuoteID:c5c39382e410413b815b}]
System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.
at System...SqlCommand.ValidateCommand(String method, Boolean async)
at System...SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System...SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System...SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System...SqlCommand.ExecuteReader(CommandBehavior behavior)
at Jiwa...JiwaODBC.database.ExecuteReader(SqlCommand SQLCommand, CommandBehavior CommandBehaviour)
at Jiwa...JiwaODBC.database.ExecuteReader(SqlCommand SQLCommand)
at Jiwa...JiwaInventory.Classification.ReadDefaultRecord()
at Jiwa...JiwaInventory.Inventory.Setup()
at Jiwa...JiwaApplication.BusinessLogicFactory.CreateBusinessLogic[BusinessLogicType](IJiwaForm Client)
at AERP...AerpInventoryLibrary.GetInventoryFromID(String InventoryID) in :line 58
at AERP...AerpInventoryLibrary.GetCategory1ExpiryDateFromInventoryID(String InventoryID) in :line 68
at AERP...BusinessLogicPlugin.SalesOrderLines_AddInventoryItemEnd(SalesOrderLine Item) in :line 961
at Jiwa...SalesOrderLineCollection.AddInventoryItem(String InventorySeed, SalesOrderLineInventorySeedTypes InventorySeedType, Object& NewKey, SalesOrderLine KitHeader, Int32 LineNumber)
at Jiwa...SalesOrder.CreateNew(NewSalesOrderTypes NewSalesOrderType, String DebtorSeed, Boolean DebtorSeedIsID, String InvoiceHistoryID, String JobID, String QuoteHistoryID, String LogicalWarehouseID)
at Jiwa...SalesQuote.MakeOrder(SalesOrderTypes eOrderType)
at Jiwa...JiwaServiceModel.SalesQuoteServices.Post(SalesQuoteMAKEORDERRequest request) in :line 21169
at lambda_method(Closure , Object , Object )
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__13.MoveNext()",
"Errors": []
}
}
If I change the API service to log on as Admin instead of API, then this works.
I will get back to this next week some time, it is mostly a learning exercise for me, so it is not urgent.