Consuming Hidden WCF RIA Services
原文 http://codeseekah.com/2013/07/05/consuming-hidden-wcf-ria-services/
A Silverlight application made it to my desk yesterday, an application that consumed a remote WCF RIA service running on a Microsoft IIS. The service did not provide a public API, nor did disassembly with dotPeek help get the service manifests to construct a WCF client with. WSDL files weren’t exposed either. A new, custom client was to be written by reverse engineering what was available without any fancy configurations.

A bit of Wiresharking around and the protocol details became exposed for some low-level replication. The payloads were encoded, and the Content-Type> header hinted at application/msbin1, which made it pretty clear that it was in .NET Binary Format. Decoding was simple by switching to Fiddler and a WCF Binary Inspector. Having retrieved the payloads sending binary to the private service was quite straight-forward in C#.
... using System.Xml;
using System.Net; ... /* Write .NET Binary XML */
System.IO.Stream s = new System.IO.MemoryStream();
XmlWriter binarywriter = XmlDictionaryWriter.CreateBinaryWriter(s); binarywriter.WriteStartElement("Action1", "http://tempuri.org/");
...
binarywriter.Flush(); s.Seek(0, System.IO.SeekOrigin.Begin);
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length); HttpWebRequest request = (HttpWebRequest)WebRequest.Create("hidden.svc/binary/Action1");
request.Method = "POST";
request.ContentType = "application/msbin1";
request.GetRequestStream().Write(b, 0, b.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); /* Read .NET XML */
b = new byte[response.ContentLength];
response.GetResponseStream().Read(b, 0, b.Length); XmlReader binaryreader = XmlDictionaryReader.CreateBinaryReader(b, XmlDictionaryReaderQuotas.Max);
XmlDocument xdoc = new XmlDocument();
xdoc.Load(binaryreader);
...
Needs the System, System.Net, System.Runtime.Serialization and System.XML assemblies.
To consume hidden WCF RIA services on other platforms check out xml2wcf.py
Consuming Hidden WCF RIA Services的更多相关文章
- Silverlight项目笔记2:.svc处理程序映射缺失导致的WCF RIA Services异常
在确定代码.编译结果和数据库都正常的情况下,无法从数据库取到数据.错误提示:Sysyem.Net.WebException:远程服务器返回了错误:NotFound,监听发现请求数据库的服务异常,访问相 ...
- Silverlight项目笔记1:UI控件与布局、MVVM、数据绑定、await/async、Linq查询、WCF RIA Services、序列化、委托与事件
最近从技术支持转到开发岗,做Silverlight部分的开发,用的Prism+MVVM,框架由同事搭好,目前做的主要是功能实现,用到了一些东西,侧重于如何使用,总结如下 1.UI控件与布局 常用的主要 ...
- Silverlight应用程序中调用WCF Ria Services访问数据库图片
WCF Ria Services(通常称为RIA服务),专门设计让Silverlight应用程序访问数据库,网上有关其示例应用都是基于简单的数据显示,其中MSDN网站上有详细的解决方案介绍,地址htt ...
- WCF RIA Services异常
.svc处理程序映射缺失导致的WCF RIA Services异常 在确定代码.编译结果和数据库都正常的情况下,无法从数据库取到数据.错误提示:Sysyem.Net.WebException:远程服务 ...
- WCF RIA Services使用详解(转载)
理解领域服务和领域操作 本文目录: 3.1 WCF Ria Services简介 3.1.1 什么是WCF Ria Services 3.1.2 WCF Ria Services如何生成客户端代码 3 ...
- 使用Entity Framework和WCF Ria Services开发SilverLight之6:查找指定字段
对数据库表指定字段的查找,又是实际工作中的一项必要工作.SL客户端仅获取实际需要的指定的字段,好处很多,比如:有助于减少网络流量. 有两类这样的使用场景. 1:联表查询不需要外键表 在上一篇中,我们使 ...
- Apache许可协议Open RIA Services
Jeff Handley's进行了多年的项目--基于一份开源许可发布WCF RIA Services.遵循Apache 2许可,捐赠给Outercurve基金会的ASP.NET Open Source ...
- 使用Fiddler解析WCF RIA Service传输的数据
原文 http://www.cnblogs.com/wintersun/archive/2011/01/05/1926386.html 使用Fiddler 2 解析WCF RIA Service传输的 ...
- WCF RIA SERVICE相关技术
WCF RIA SERVICE实体属性拷贝 private void DoSubmit() { ((IEditableObject)this.RepairContract).EndEdit(); va ...
随机推荐
- PHP Curl CURLOPT_POSTFIELDS 1024
resolve : curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); url: http://www.laruence.com/2011/ ...
- Labview常用快捷键
对象调整和移动快捷键 Shift-click 选择多个对象,在现有选择的基础上添加对象 方向键 ...
- 数据库课本SQL第三章答案
3 .用 sQL 语句建立第二章习题 5 中的 4 个表. 答: 对于 S 表: S ( SNO , SNAME , STATUS , CITY ) ; 建 S 表: CREATE TABLE S ( ...
- Python的编码规范(PEP 8 & Google Python guide)
PEP 8 Python 代码规范整理 click here Goole Python 风格指南 中文版 click here 大家有取舍的看吧. 因为文章不是原创的,所以只贴地址,给大家造成麻烦了, ...
- 编程工具篇——Vim
配置 配置文件位于:/etc/vim/vimrc(添加配置在文件末尾输入代码即可) 常用配置 配色方案 :colorscheme ron(其中ron为我的配色方案,也可以选择其他,软件中自带配色文件全 ...
- ORACLE同义词总结
ORACLE同义词总结 同义词概念 Oracle的同义词(synonyms) 从字面上理解就是别名的意思,和视图的功能类似,就是一种映射关系.它可以节省大量的数据库空间,对不同用户的操作同一张表没有多 ...
- php正则表达式图谱
php 正则表达式分类图:
- UberX及以上级别车奖励政策(优步北京第二、三组)
优步北京第二.三组: 定义为2015年6月1日至7月19日激活的司机(以优步后台数据显示为准) 滴滴快车单单2.5倍,注册地址:http://www.udache.com/如何注册Uber司机(全国版 ...
- IOS开发环境更换后重新制作Provisioning Profile证书详解
新换了台Macbook,又折腾了一遍Provisioning Profile证书,苹果的证书繁锁复杂,每次制作都相当麻烦,而且Provisioning Profile证书是与设备绑定的,所以更换开发环 ...
- 从零开始学习UNITY3D(GUI篇)
邻近年底,心也有些散乱,加上工作忙了一阵,在达内培训的课程也落下了不少.对unity3d的热度似乎也有点点下降.痛定思痛,又在淘宝上买了写蛮牛网的视频.总之不管是用任何手段都要逼着自己不要浪费了培训的 ...