WCF DataService indent xml response

别来无恙 提交于 2020-01-25 10:35:25

问题


How can i indent the xml response from my data service?

All my request to the wcf data service are in xml wihout indent.

I am using OData3 WCF Data Service 5.0.

Before in Odata WCF Dataservice 4, all my response data was in indent xml.


回答1:


It seems that since wcf dataservice 4.0 was update in WCF Data Services 5.0 with OData 3.0, all the xml response is not intent, i solved this by implement the IDispatchMessageInspector interface and modify the current content by xdocument and xmlTextwriter .



来源:https://stackoverflow.com/questions/29123116/wcf-dataservice-indent-xml-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!