【发布时间】:2014-01-13 13:23:35
【问题描述】:
我正在编写一个使用 3rd 方 WCF Web 服务的 .Net 3.5 解决方案。 SOAP 服务的代理客户端是由 VisualStudio 作为服务参考生成的。
来自服务的 SOAP 响应包括数据中的附件,正如我在 fiddler 中看到的那样。附件有一个指向 CID 引用的 href 字段。 VS 2012 在返回包含附件的对象时创建的代理客户端不包含任何二进制数据,但它确实包含带有 CID 引用的 href 字段。
使用 fiddler 捕获,这是 SOAP 响应附件数据,包括 cid:xxxx ref:
<attachments>
<cmn:attachment href="cid:52b2d8a50035921e80bf1540" len="309" name="DOC1.rtf" type="application/rtf" xmime:contentType="application/rtf"/>
</attachments>
在 fiddler 的原始输出中,可以看到附件数据与匹配的 cid:xxxx ref:
------=_Part_22_12445037.1389617382038
Content-Type: application/rtf
Content-Location: DOC1.rtf
Content-ID: <52b2d8a50035921e80bf1540>
Content-Transfer-Encoding: binary
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22 Doc 1\par
\par
Test information inside an attachment for KM retrieval.\par
\par
Here's something else I've written for use in testing.\par
}
这是返回对象中可用字段的屏幕截图:
如何访问该附件数据以便实际下载文件?
【问题讨论】: