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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -