fiskaltrust / middleware-demo-dotnet

Demo applications that demonstrate how to call the fiskaltrust.Middleware from .NET/C#. This repository contains examples using GRPC, WCF and REST using both JSON and XML.
https://docs.fiskaltrust.cloud
MIT License
3 stars 6 forks source link

Grpc.Core.RpcException: Status(StatusCode=Unimplemented, #21

Closed doczoidberg closed 2 years ago

doczoidberg commented 2 years ago

I run my middleware on grpc://localhost:18000 but get an error:


Please provide a value for 'Middleware URL' (String): grpc://localhost:18000
Please provide a value for 'CashboxID' (Guid): 93a2053a-0830-4245-8008-d59ae1d98a88
Please provide a value for 'Market (AT, DE or FR)': DE
Grpc.Core.RpcException: Status(StatusCode=Unimplemented, Detail="")
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei ProtoBuf.Grpc.Internal.Reshape.<UnaryTaskAsyncImpl>d__10`2.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.PosRetryProxyClient.<>c__DisplayClass6_0.<<EchoAsync>b__0>d.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.RetryPolicyHandler`1.<>c__DisplayClass3_0`1.<<RetryFuncAsync>b__0>d.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.RetryPolicyHandler`1.<RetryFuncAsync>d__3`1.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.PosRetryProxyClient.<EchoAsync>d__6.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Demo.Grpc.Demo.<ExecuteEchoAsync>d__6.MoveNext()

what can I do?

TSchmiedlechner commented 2 years ago

Hi @doczoidberg, thanks for reaching out! Could you please post your configuration (e.g. via a Screenshot from the Portal, or as JSON from the config file) so that we can take a more detailed look? The cashbox ID you used seems to not exist in our systems (maybe because of a typo?), so we can't look it up ourselves. 🙂

Also, the console/log output of the Middleware would be very helpful for diagnosing the issue.

doczoidberg commented 2 years ago

Middleware:


C:\WINDOWS\system32>cd /d "C:\Users\danie\Downloads\fiskaltrust.service.launcher.93a4053a-0830-4245-8008-d59ae1d98a88 (3)\"

C:\Users\danie\Downloads\fiskaltrust.service.launcher.93a4053a-0830-4245-8008-d59ae1d98a88 (3)>fiskaltrust -cashboxid=93a4053a-0830-4245-8008-d59ae1d98a88 -accesstoken=BMIZQuhg/iL2e6mgaoHPNhmxJVCjhj0jQaY2vMaRjFdlUx5eUDOafienJseIIyESNbnh/sUtXRY3K4w/l2RLes8= -sandbox -useoffline -test
2021-12-10 10:18:05 [INF] fiskaltrust.Launcher-1.3.19
2021-12-10 10:18:05 [INF] CashBoxId set to "93a4053a-0830-4245-8008-d59ae1d98a88"
2021-12-10 10:18:05 [INF] AccessToken set
2021-12-10 10:18:05 [INF] UseOffline set to "True"
2021-12-10 10:18:05 [INF] Sandbox set to "True"
2021-12-10 10:18:05 [INF] Load configuration from C:\ProgramData\fiskaltrust\service\Configuration-93a4053a-0830-4245-8008-d59ae1d98a88.json
2021-12-10 10:18:05 [INF] Starting Middleware with configuration timestamp: 637743960771743386 (SHA256: 516108fdd2ef3732bd5e90ac9cc3f1e0eaf8bfebccfbe56d5451c83b76ca178d)
2021-12-10 10:18:05 [INF] Starting ft.Middleware at C:\ProgramData\fiskaltrust\service\93a4053a-0830-4245-8008-d59ae1d98a88
2021-12-10 10:18:05 [INF] Loading Helper Id c32204ee-63d9-48c2-b548-acfb389fa713 from Package fiskaltrust.Middleware.Helper.Helipad, Version 1.3.26-rc1-21340-49069
2021-12-10 10:18:05 [INF] Create Helper c32204ee-63d9-48c2-b548-acfb389fa713
2021-12-10 10:18:06 [INF] Loading SecureSignaturCreationDevice Id 7b53f6ce-7c37-4d76-8f66-0fc05e061b4a from Package fiskaltrust.Middleware.SCU.DE.Swissbit, Version 1.3.25
2021-12-10 10:18:06 [INF] Create SecureSignaturCreationDevice 7b53f6ce-7c37-4d76-8f66-0fc05e061b4a
2021-12-10 10:18:07 [INF] gRPC Service: fiskaltrust.Middleware.SCU.DE.Swissbit (1.3.25) - Endpoint: grpc://localhost:18000
2021-12-10 10:18:07 [INF] Loading Queue Id 902d9339-c226-4913-9d4c-1653849ebccf from Package fiskaltrust.Middleware.Queue.SQLite, Version 1.3.25
2021-12-10 10:18:07 [INF] Create Queue 902d9339-c226-4913-9d4c-1653849ebccf
2021-12-10 10:18:09 [INF] gRPC Service: fiskaltrust.Middleware.Queue.SQLite (1.3.25) - Endpoint: grpc://localhost:14000
2021-12-10 10:18:09 [INF] WCF Service: fiskaltrust.Middleware.Queue.SQLite (1.3.25) - Endpoint: http://localhost:14001/soap
2021-12-10 10:18:10 [INF] REST Service: fiskaltrust.Middleware.Queue.SQLite (1.3.25) - Endpoint: rest://localhost:14002/rest, rest://localhost:14002/rest/json, rest://localhost:14002/rest/xml
2021-12-10 10:18:10 [INF] StartEnd Helper c32204ee-63d9-48c2-b548-acfb389fa713
2021-12-10 10:18:10 [INF] fiskaltrust.Middleware started. Press a button to stop...

Demo GRPC:

Please provide a value for 'Middleware URL' (String): grpc://localhost:18000
Please provide a value for 'CashboxID' (Guid): 93a4053a-0830-4245-8008-d59ae1d98a88
Please provide a value for 'Market (AT, DE or FR)': DE
Grpc.Core.RpcException: Status(StatusCode=Unimplemented, Detail="")
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei ProtoBuf.Grpc.Internal.Reshape.<UnaryTaskAsyncImpl>d__10`2.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.PosRetryProxyClient.<>c__DisplayClass6_0.<<EchoAsync>b__0>d.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.RetryPolicyHandler`1.<>c__DisplayClass3_0`1.<<RetryFuncAsync>b__0>d.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.RetryPolicyHandler`1.<RetryFuncAsync>d__3`1.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.PosRetryProxyClient.<EchoAsync>d__6.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Demo.Grpc.Demo.<ExecuteEchoAsync>d__6.MoveNext()

<1>: ReceiptExamples/de/10-implicit-flow-sequenz-split/1-check-in-info-internal/request.json - (4445000100000013)
<2>: ReceiptExamples/de/10-implicit-flow-sequenz-split/2-erste-uebernachtung-info-order/request.json - (4445000100000010)
<3>: ReceiptExamples/de/10-implicit-flow-sequenz-split/3-konsum-an-der-hotelbar-info-order/request.json - (4445000100000010)
<4>: ReceiptExamples/de/10-implicit-flow-sequenz-split/4-zweite-uebernachtung-info-order/request.json - (4445000100000010)
<5>: ReceiptExamples/de/10-implicit-flow-sequenz-split/5-check-out-und-bezahlung-fr-mueller-pos-receipt/request.json - (4445000100000001)
<6>: ReceiptExamples/de/10-implicit-flow-sequenz-split/6-check-out-und-bezahlung-hr-mueller-pos-receipt/request.json - (4445000100000001)

The config seems not be read. E.g. when I change the letter of the deivcePath it is not used:

{
    "helpers": [
        {
            "Id": "c32204ee-63d9-48c2-b548-acfb389fa713",
            "Package": "fiskaltrust.Middleware.Helper.Helipad",
            "Version": "1.3.26-rc1-21340-49069",
            "Configuration": {},
            "Url": []
        }
    ],
    "ftCashBoxId": "93a4053a-0830-4245-8008-d59ae1d98a88",
    "ftSignaturCreationDevices": [
        {
            "Id": "7b53f6ce-7c37-4d76-8f66-0fc05e061b4a",
            "Package": "fiskaltrust.Middleware.SCU.DE.Swissbit",
            "Version": "1.3.25",
            "Configuration": {
                "devicePath": "t:"
            },
            "Url": [
                "grpc://localhost:18000"
            ]
        }
    ],
    "ftQueues": [
        {
            "Id": "902d9339-c226-4913-9d4c-1653849ebccf",
            "Package": "fiskaltrust.Middleware.Queue.SQLite",
            "Version": "1.3.25",
            "Configuration": {
                "init_ftQueue": [
                    {
                        "ftQueueId": "902d9339-c226-4913-9d4c-1653849ebccf",
                        "ftCashBoxId": "93a4053a-0830-4245-8008-d59ae1d98a88",
                        "ftCurrentRow": 0,
                        "ftQueuedRow": 0,
                        "ftReceiptNumerator": 0,
                        "ftReceiptTotalizer": 0.0,
                        "ftReceiptHash": null,
                        "StartMoment": null,
                        "StopMoment": null,
                        "CountryCode": "DE",
                        "Timeout": 15000,
                        "TimeStamp": 637743960766840880
                    }
                ],
                "init_ftQueueDE": [
                    {
                        "ftQueueDEId": "902d9339-c226-4913-9d4c-1653849ebccf",
                        "ftSignaturCreationUnitDEId": "7b53f6ce-7c37-4d76-8f66-0fc05e061b4a",
                        "LastHash": null,
                        "CashBoxIdentification": "ftOZMtkCbCE0mdTBZThJ68zw",
                        "SSCDFailCount": 0,
                        "SSCDFailMoment": null,
                        "SSCDFailQueueItemId": null,
                        "UsedFailedCount": 0,
                        "UsedFailedMomentMin": null,
                        "UsedFailedMomentMax": null,
                        "UsedFailedQueueItemId": null,
                        "DailyClosingNumber": 0,
                        "TimeStamp": 637743960757746805
                    }
                ],
                "init_ftSignaturCreationUnitAT": [],
                "init_ftSignaturCreationUnitDE": [
                    {
                        "ftSignaturCreationUnitDEId": "7b53f6ce-7c37-4d76-8f66-0fc05e061b4a",
                        "Url": "[\"grpc://localhost:18000\"]",
                        "TimeStamp": 637743960755247370,
                        "TseInfoJson": null,
                        "Mode": 0,
                        "ModeConfigurationJson": null
                    }
                ],
                "init_ftSignaturCreationUnitFR": [],
                "init_ftCashBox": {
                    "ftCashBoxId": "93a4053a-0830-4245-8008-d59ae1d98a88",
                    "TimeStamp": 637743960754621500
                },
                "init_masterData": {
                    "Account": {
         ...
                    },
                    "Outlet": {
        ...
                    },
                    "Agencies": [],
                    "PosSystems": []
                }
            },
            "Url": [
                "grpc://localhost:14000",
                "http://localhost:14001/soap",
                "rest://localhost:14002/rest"
            ]
        }
    ],
    "TimeStamp": 637743960771743386
}
doczoidberg commented 2 years ago

I use a swissbit Hardware TSE btw and run console in admin mode.

TSchmiedlechner commented 2 years ago

Thanks for the quick response! It looks like grpc://localhost:18000 is the URL of the SCU, but you should use the URL of the Queue to communicate with the Middleware (grpc://localhost:14000).

If your changes in the Portal are not written to the config, you may didn't rebuild the CashBox (in the Portal, there's a rebuild button in each CashBox line). This is part of our two-steps-update mechanism to avoid accidental changes in live installations.

doczoidberg commented 2 years ago

Thank you! It seems to work now.

I changed the config.json locally.

doczoidberg commented 2 years ago

Can I do a DSFinV-K File local export with the grpc demo?

As far as I understand I could do it via journal -> TSE-FAR Export? But the tar file does not have any csv files?

doczoidberg commented 2 years ago

for sure there are no files because i have not generated a closing receipt

Prerequisite#
A daily-closing-receipt must be sent at the end of the day for the fiskaltrust.Middleware to be able to generate the DSFinV-K export. Without the daily-closing-receipts the DFinV-K export will be empty.
doczoidberg commented 2 years ago

but there is no closing receipt in the example?

TSchmiedlechner commented 2 years ago

Hi again, sorry for the delayed response. You're right, the daily-closing receipt is missing in this example repository, we'll add this hopefully soon. Meanwhile, you could take the request from our (far more complete) Postman sample collection: https://middleware-samples.docs.fiskaltrust.cloud/#6e241154-0e76-4bd0-b00d-4471415e6a76

doczoidberg commented 2 years ago

ok, thank you