# Using protobuf for communication between java and typescript service

**URL:** <https://community.temporal.io/t/using-protobuf-for-communication-between-java-and-typescript-service/7066>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [January 26, 2023, 9:29am UTC](https://community.temporal.io/t/using-protobuf-for-communication-between-java-and-typescript-service/7066 "2023-01-26T09:29:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abu\_Rahan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/abu_rahan/32/3230_2.png) [@Abu\_Rahan](https://community.temporal.io/u/Abu_Rahan)\
**Post date:** [January 26, 2023, 9:29am UTC](https://community.temporal.io/t/using-protobuf-for-communication-between-java-and-typescript-service/7066/1 "2023-01-26T09:29:24Z")

</div>

Hi Team, I am trying to use protobuf object for communication on client side (Java sdk) and the server side is implemented in typescript sdk  
client side :

```java
   WorkflowOptions options1 = WorkflowOptions.newBuilder().setWorkflowId(workflowId)
                    .setTaskQueue("planner").build();
            workflowClient = TemporalHelper.getWorkflowClient();
            WorkflowStub workflowStub = workflowClient.newUntypedWorkflowStub("getInfrastructureTemplate",
                    options1);
            WorkflowExecution execution = workflowStub.start(infrastructureRequest);
            var details = workflowStub.getResult(test.class);

```

server side :

```java
export function getInfrastructureTemplate(productTemplate: any): any {
  // console.log(productTemplate);
  // const payload = defaultPayloadConverter.fromPayload(productTemplate);
  const testProto = test.create({test: "test1"});
  return payloadConverter.toPayload(testProto);
}

```

protobuff:

```auto
message test{
   string test:1;
}

```

test.class is the class generated from this test protobuf.  
My assumption was since the server side is returning a protobuf conversion should be automatically done as in client side workflowStub.getResult(test.class);  
I am expecting test protobuff only.But the code is throwing conversion exception. Is there any way I can handle this scenario?

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [January 26, 2023, 6:50pm UTC](https://community.temporal.io/t/using-protobuf-for-communication-between-java-and-typescript-service/7066/2 "2023-01-26T18:50:22Z")

</div>

Hello @Abu_Rahan

When you say that your server is written in Java, do you mean your worker?

Can you show the full exception log?

Antonio

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [January 27, 2023, 2:03am UTC](https://community.temporal.io/t/using-protobuf-for-communication-between-java-and-typescript-service/7066/3 "2023-01-27T02:03:47Z")

</div>

Have you seen this [topic](https://community.temporal.io/t/send-protobuf-payload-from-typescript-to-java-and-reverse/7057) about a similar problem?
