examples/appnet-api-server/src/main/java/com/hedera/hashgraph/identity/hcs/example/appnet/handlers/VcHandler.java
/**
   * Constructs a VC message from the given request body JSON.
   * The message is expected to be signed.
   * Then submits this signed message into the HCS VC 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 VC topic message as JSON string.
   * @param client The Hedera node client.
   * @param client The Hedera mirror node client.
   */
Constructs a VC message from the given request body JSON.
The message is expected to be signed.
Then submits this signed message into the HCS VC 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 VC topic message as JSON string.
@param client The Hedera node client.
@param client The Hedera mirror node client.
Constructs a VC message from the given request body JSON . The message is expected to be signed . Then submits this signed message into the HCS VC 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 VC topic message as JSON string . @param client The Hedera node client . @param client The Hedera mirror node client .
private void submitVcMessage(final Context ctx, final String json, final Client client) {
    final Hbar fee = new Hbar(2);
    try {
      MessageEnvelope<HcsVcMessage> message = MessageEnvelope.fromJson(json, HcsVcMessage.class);
      TransactionId txId = identityNetwork.createVcTransaction(message, null)
              .buildAndSignTransaction(tx -> tx.setMaxTransactionFee(fee))
              .onError(e -> log.error("Error while sending VC message transaction:", e))
              .execute(client);
      log.info("VC 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 submitVcMessage ( final Context ctx , final String json , final Client client ) { final Hbar fee = new Hbar ( 2 ) ; try { MessageEnvelope < HcsVcMessage > message = MessageEnvelope . fromJson ( json , HcsVcMessage . class ) ; TransactionId txId = identityNetwork . createVcTransaction ( message , null ) . buildAndSignTransaction ( tx -> tx . setMaxTransactionFee ( fee ) ) . onError ( e -> log . error ( "Error while sending VC message transaction:" , e ) ) . execute ( client ) ; log . info ( "VC 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 VC message from the given request body JSON.
Constructs a VC message from the given request body JSON .