examples/appnet-api-server/src/main/java/com/hedera/hashgraph/identity/hcs/example/appnet/handlers/DidHandler.java
/**
   * Constructs a DID message from the given request body JSON.
   * The message is expected to be signed.
   * Then submits this signed CREATE, UPDATE or DELETE message into the HCS DID topic.
   * Returns 202 ACCEPTED with empty body when submission was successful, without waiting for the consensus result.
   *
   * @param ctx    The HTTP context.
   * @param json   The DID topic message as JSON string.
   * @param client The Hedera node client.
   */
Constructs a DID message from the given request body JSON.
The message is expected to be signed.

@param ctx    The HTTP context.
@param json   The DID topic message as JSON string.
@param client The Hedera node client.
Constructs a DID message from the given request body JSON . The message is expected to be signed . @param ctx The HTTP context . @param json The DID topic message as JSON string . @param client The Hedera node client .
private void submitDidMessage(final Context ctx, final String json, final Client client) {
    final Hbar fee = new Hbar(2);
    try {
      MessageEnvelope<HcsDidMessage> message = MessageEnvelope.fromJson(json, HcsDidMessage.class);
      TransactionId txId = identityNetwork.createDidTransaction(message)
              .buildAndSignTransaction(tx -> tx.setMaxTransactionFee(fee))
              .onError(e -> log.error("Error while sending DID message transaction:", e))
              .execute(client);
      log.info("DID message transaction submitted: " + txId.toString());
      ctx.getResponse().status(Status.ACCEPTED);
      ctx.render("");
    } catch (Exception e) {
      ctx.getResponse().status(Status.BAD_REQUEST);
      ctx.render(Jackson.json(new ErrorResponse(e)));
    }
  }
private void submitDidMessage ( final Context ctx , final String json , final Client client ) { final Hbar fee = new Hbar ( 2 ) ; try { MessageEnvelope < HcsDidMessage > message = MessageEnvelope . fromJson ( json , HcsDidMessage . class ) ; TransactionId txId = identityNetwork . createDidTransaction ( message ) . buildAndSignTransaction ( tx -> tx . setMaxTransactionFee ( fee ) ) . onError ( e -> log . error ( "Error while sending DID message transaction:" , e ) ) . execute ( client ) ; log . info ( "DID message transaction submitted: " + txId . toString ( ) ) ; ctx . getResponse ( ) . status ( Status . ACCEPTED ) ; ctx . render ( "" ) ; } catch ( Exception e ) { ctx . getResponse ( ) . status ( Status . BAD_REQUEST ) ; ctx . render ( Jackson . json ( new ErrorResponse ( e ) ) ) ; } }
Constructs a DID message from the given request body JSON.
Constructs a DID message from the given request body JSON .