从Web响应中读取特定数据c#

时间:2016-09-01 02:53:52

标签: c# .net httpwebresponse

如何从c#中的webresponse中提取bmp数据。需要只提取bmp数据并将其保存为bmp文件。不知道从respose流中提取这些数据。响应流是这样的......

--==vR1se8TeJPE+OIhZBEh4LvMWHzRSAJyHPubj6sIo4uxOan2qLg+N0L67Pnxc==
Content-Type: application/xop+xml; type="application/soap+xml"; 
charset="utf-8"
Content-Transfer-Encoding: binary
Content-ID: <d569a93d-2406-4130-ba60-a61cb17f2818@uuid>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-    
envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"     
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:mex="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:PNPX="http://schemas.microsoft.com/windows/pnpx/2005/08" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xmime1="http://www.w3.org/2004/06/xmlmime" xmlns:xmime2="http://www.w3.org/2004/11/xmlmime" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2005/05/devprof" xmlns:wprt="http://schemas.microsoft.com/windows/2005/05/wdp/print" xmlns:wscn="http://schemas.microsoft.com/windows/2006/08/wdp/scan" xmlns:UNS1="http://schemas.microsoft.com/windows/test/testdevice/11/2005">
<SOAP-ENV:Header><wsa:Action>http://schemas.microsoft.com/windows/2006/08/wdp/scan/RetrieveImageResponse</wsa:Action><wsa:MessageID>urn:uuid:6b416342-543c-4371-b46e-c9abbfeb362f</wsa:MessageID><wsa:RelatesTo>uuid:1ec39293-61c3-421e-86d8-a2e1e392c388</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To></SOAP-ENV:Header><SOAP-ENV:Body><wscn:RetrieveImageResponse><wscn:ScanData><xop:Include href="cid:01c50dcb-8e69-4b68-8ee0-962ae9d9702d@uuid"/></wscn:ScanData></wscn:RetrieveImageResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

--==vR1se8TeJPE+OIhZBEh4LvMWHzRSAJyHPubj6sIo4uxOan2qLg+N0L67Pnxc==
Content-Type: image/dib
Content-Transfer-Encoding: binary
Content-ID: <01c50dcb-8e69-4b68-8ee0-962ae9d9702d@uuid>
//////////////////Sample bmp data...format not supporting to paste 
here...........

**BMクYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY**

--==vR1se8TeJPE+OIhZBEh4LvMWHzRSAJyHPubj6sIo4uxOan2qLg+N0L67Pnxc==--

0 个答案:

没有答案