Answered

The content type of the interface response is different from the expected one

I have created a JAX-RS for Bizagi to connect

  1. @POST

    @Consumes(MediaType.APPLICATION_JSON)

    @Produces({MediaType.APPLICATION_JSON})

    public TestObj post(TestObj text) {

    System.out.println("input: "+text.getText());

    text.setText("POST: "+ text.getText());

    return text;

    }

In "post input parameter" and "post output data"

I am using the below JSON as my template

  1. {"text":"POST: HIHI"}

I have tested my RESTful service with telnet command line and it return me the JSON string successfully

  1. POST /HelloJersey/hello HTTP/1.0

    Host: 13.186.30.138

    Content-Type: application/json

    Content-Length: 15

    {"text":"HIHI"}

In the Design Form > "Actions and validation", I have set to execute the interface (to connect the above RESTful method) while a form button is clicked, and then the error message prompted:

  1. The content type of the interface response is different from the expected one

What JSON format would Bizagi expect me to use? Please advice, thanks.

Comments (2)

photo
1

I found the solution...Bizagi use XML concept, so I have to create the root first, and store the return results under the root, such as {root: {text: "hihi"}}

However, I think this is not a good way for JSON because JSON doesn't limit me to put all the things under the root....

photo
1

Dear Yun On Lam,

A member of our support team will contact you in order to reproduce it in our labs.

Regards