WCF DataService indent xml response

2019-09-05 05:00发布

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条回答
家丑人穷心不美
2楼-- · 2019-09-05 05:32

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 .

查看更多
登录 后发表回答