aries-framework-dotnet
aries-framework-dotnet copied to clipboard
DotNet Edge Agent is unable to send a `Connectionless Presentation Message` to the DotNet Verifier Agent
Below is the scenario. EA = Edge Agent
- EA1 creates a
Connectionless Proof Request
- EA2 scans the Connectionless Proof Request and creates a
PresentationMessage
as below
ProofRecord record = await proofService.ProcessRequestAsync(agentContext, Proof.RequestPresentationMessage, null);
(PresentationMessage presentationMessage, ProofRecord proofRecord) = await proofService.CreatePresentationAsync(agentContext, record.Id, requestedCredentials);
- The state of the
ProofRecord
on EA2 isAccepted
- EA2 sends the
PresentationMessage
as below
ServiceDecorator service = Proof.RequestPresentationMessage.GetDecorator<ServiceDecorator>(DecoratorNames.ServiceDecorator);
IMessageService messageService = App.Container.Resolve<IMessageService>();
await messageService.SendAsync(agentContext: agentContext, message: presentationMessage, recipientKey: service.RecipientKeys.First(), endpointUri: service.ServiceEndpoint, routingKeys: service.RoutingKeys?.ToArray());
In the above step, EA2 gets the error "Failed to send A2A message with an HTTP status code of InternalServerError and content".
Can anyone advise on the changes I need to make to get it working?
You are passing the wrong arguments for CreatePresentationAsync while creating a presentation for connectionless transport, You should use a different method.
-
current arguments: CreatePresentationAsync(IAgentContext agentContext, string proofRecordId, RequestedCredentials requestedCredentials);
-
actual arguments: CreatePresentationAsync(IAgentContext agentContext, RequestPresentationMessage requestPresentation, RequestedCredentials requestedCredentials);