Hi,
We are facing an issue when calling the Ledger API using Grpcurl from command line.
We are trying to submitting the json payload using grpcurl command and we are getting the error back whereby we feel that we are passing the right value in that field.
And I can confirm that this same workflow works when we sumbit the same vales using grpc java code
Error we are getting is below
ERROR:
Code: InvalidArgument
Message: Invalid field module_name: Expected a non-empty string
I’d say first start would be to look at your module_name reference, and see why it’s being interpreted as missing. Either missing or in the wrong place?
Perhaps start with a simple example (from DAML SDK, running on Sandbox) so you have a validated grpcurl call that submits a call successfully. That will help you to see where your problem is, which is no doubt a misaligned message structure.
You are specifying the package id but you’ve omitted the module_name and the entity_name. Omitting a string in protobuf is equivalent to setting it to an empty string so you get an error because module_name is empty.
You have two options for fixing that:
Omit recordId completely. It’s optional on the gRPC API.
Keep it but add the module and entity name. I can’t tell you what the correct ones here are (since you haven’t shared that code) but they correspond to the type of the message field of the BmwIngressMaster
Thanks @cocreature the error gone, below is the json I have modified and we are getting new error ?
Is there any specific syntax we need to follow ?
ERROR: Code: InvalidArgument
** Message: Command interpretation error in LF-DAMLe: Expecting 3 field for record dcefc5335494ef4815997d46788e55e4c63c416ef3b3dd457d7df76b2c1cf7c5:DA.ASX.Main.Integration.BMW.Ingress:BmwIngressMaster, but got 1. Details: N/A.**
I don’t know the definition of BmwIngressMaster but it sounds like it’s a template with 3 different fields. You are only specifying a single message field which is why you’re getting the error. I recommend checking the definition of the template to see which fields it has.