使用Fiddler 2 解析WCF RIA Service传输的数据,您需要安装一个PlugIn。下载解压后,放在Inspectors文件中。重新启动Fiddler,你就会看到WCF Binary的选项。
下面的场景是,点一个Button根据ID查询数据,UI如下图:
Server端Code,ItemContext是DomainContext基类
1: var tt = new ItemContext();
2: tblItemDataGrid.ItemsSource = tt.tblItems;
3: EntityQuery<tblItem> s = tt.GetTblItemsByItemNumberQuery(txtItemNumber.Text == "" ? 0 : Convert.ToInt32(txtItemNumber.Text));
4: LoadOperation<tblItem> op = tt.Load(s);
此时我们通过Monitor可以看到类似下面文本:
@GetTblItemsByItemNumberResponsehttp://tempuri.org/@GetTblItemsByItemNumberResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^
TotalCount�^
RootResults b7http://schemas.datacontract.org/2004/07/RIAServices.Web_tblItem_ItemDescription�
Item Name1_
ItemNumber�_Quantity�
就会被还原到这样的明文:
<GetTblItemsByItemNumberResponse xmlns="http://tempuri.org/">
<GetTblItemsByItemNumberResult xmlns:a="DomainServices" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:TotalCount>1</a:TotalCount>
<a:RootResults xmlns:b="http://schemas.datacontract.org/2004/07/RIAServices.Web">
<b:tblItem>
<b:ItemDescription>Item Name1</b:ItemDescription>
<b:ItemNumber>1</b:ItemNumber>
<b:Quantity>1</b:Quantity>
</b:tblItem>
</a:RootResults>
</GetTblItemsByItemNumberResult>
</GetTblItemsByItemNumberResponse>
是不是很实用,如果您是Debug本地的localhost的站点,可能需要修改hosts文件,或修改它的js配置。可以参考官方网站。
本文所使用例子是 可参考 WCF RIA Services 快速上手
希望对您开发有帮助。
作者:Petter Liu
出处:http://www.cnblogs.com/wintersun/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
该文章也同时发布在我的独立博客中-Petter Liu Blog。
分类:
WCF
, SilverLight
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)