json.net - Unable to programmatically set Content-Type in BizTalk Wcf-Custom response port -


i attempting receive json messages biztalk using blogical rest start kit biztalk (http://biztalkrest.codeplex.com/).

i able receive message, transform it, , return response orchestration, when transform response out through biztalkrestresponsehandler, http content-type being forced 'application/xml', though i'm explicitly setting 'application/json'. content-type confirmed tracing request , response in fiddler, soapui.

the accept: value on request 'application/json'

any ideas how can trace further wcf-custom adapter stack see content-type being reset?

you can solve adding httpresponsemessageproperty before returning message in idispatchmessageinspector. can either directly in biztalkrestresponsehandler idispatchmessageinspector or in separate one.

to in biztalkrestresponsehandler source , add following 3 lines of code in beforesendreply method above "reply = newreply" in end.

httpresponsemessageproperty prop = new httpresponsemessageproperty(); newreply.properties.add(httpresponsemessageproperty.name, prop); prop.headers.add("content-type", "application/json;charset=utf-8"); 

now instead of getting:

enter image description here

you this:

enter image description here


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -