现在的位置: 首页 > 综合 > 正文

使用Fiddler工具调试RESTFul WCF 服务的技巧及其问题

2013年04月22日 ⁄ 综合 ⁄ 共 379字 ⁄ 字号 评论关闭

异常信息:

The incoming message has an unexpected message format ‘Raw’. The expected message formats for the operation are ‘Xml’, ‘Json’.

在使用Fiddler工具(可免费下载),测试RESTFul WCF 服务的POST方法时,出现了上述异常印象。

 

这时,记得需要在header中添加Content-Type指令,如下所示:

Content-Type: application/xml; charset=utf-8

或者Content-Type: text/xml

如果是传入JSON数据,则需要更改为:Content-Type: application/json; charset=utf-8

 

RESTFul WCF 服务返回结果:

 

参考链接:

免费抓包工具Fiddler的使用

 

 

抱歉!评论已关闭.