AnsweredAssumed Answered

Web Server:REST JSON Content-type Incorrect

Question asked by BjarkeHansen4421 on Mar 8, 2016
Latest reply on Mar 9, 2016 by BjarkeHansen4421

Hi,

I'm building a REST web service with JSON profiles specified as request and response.

Usually the Content-type header in the response a web service sends is set to "application/json" automatically but now I have to set a Dynamic Document Property to have the web service respond with the correct Content-type.

 

(I have trunacted in the JSON examples below, hence the large Content-Length).

HTTP headers I expect:

Content-Length: 3167

Content-Type: application/json

Server: Jetty(6.1.26-boomi2)

 

HTTP headers I get:

Content-Length: 602

Content-Encoding: gzip

Content-Type: text/plain

Cteonnt-Length: 3167

Server: Jetty(6.1.26-boomi2)

Cache-Control: private

 

The response I expect:

{

  "status" : {

    "errorCode" : "0",

    "businessErrorCode" : "0",

    "errorMessage" : "Stub",

    "timestamp" : "2016"

  }

}

 

The response I get:

<data contentType="text/plain" contentLength="3167"><![CDATA[{

  "status" : {

    "errorCode" : "0",

    "businessErrorCode" : "0",

    "errorMessage" : "Stub",

    "timestamp" : "2016"

  }

}]]></data>

 

If I set the dynamic document property:

outheader_Content-Type = application/json

I get the expected result.

Maybe I'm just missing a setting in the new web server UI (which is really nice!) but I didn't used to have to set the Content-Type in a dynamic document property.

I hope somebody can help.

Thanks,

Bjarke.

 

Additional information:

 

My process is a stub with the operation:

 

REST end-point:

Outcomes