aries-framework-dotnet icon indicating copy to clipboard operation
aries-framework-dotnet copied to clipboard

DotNet Edge Agent is unable to send a `Connectionless Presentation Message` to the DotNet Verifier Agent

Open sahil-khanna opened this issue 3 years ago • 1 comments

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 is Accepted
  • 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?

sahil-khanna avatar Mar 18 '21 10:03 sahil-khanna

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);

DaevMithran avatar May 04 '21 12:05 DaevMithran