无法从Rest WCF服务中的http post消息转换pdf

时间:2012-09-13 08:15:04

标签: .net wcf

我托管了一个Rest WCF Servce来接收内容类型为Multipart \ Mixed的消息,我在我的服务中接收消息作为流。我的传入消息包含两个部分,一个是XML,另一个是PDF作为二进制(内容类型为application \ pdf)。我正在尝试将二进制转换为pdf,但它创建了空PDF。(PDF的内容为空)。这是带标题的示例传入消息。

  

采样传入消息

POST /IntegrationService/Service.svc/Send/new HTTP/1.1
accept-encoding: gzip
connection: close
accept-charset: iso-8859-1,*,utf-8
content-type: multipart/mixed; boundary=_NextPart_000_0002_01C3E1CC.3BB37320; type=text/html;charset=UTF-8
Content-length: 236625
accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: localhost:9292

--_NextPart_000_0002_01C3E1CC.3BB37320
Content-type: text/plain
 POST /ISSIntegrationService/QnQService.svc/SendNomination/new HTTP/1.1
accept-encoding: gzip
connection: close
accept-charset: iso-8859-1,*,utf-8
content-type: multipart/mixed; boundary=_NextPart_000_0002_01C3E1CC.3BB37320; type=text/html;charset=UTF-8
Content-length: 236625
accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: localhost:9292

--_NextPart_000_0002_01C3E1CC.3BB37320
Content-type: text/plain

<?xml version="1.0" encoding="UTF-8"?>
<Nomination><ns0:Nomination xmlns:ns0="http://www.amphorainc.com/schema/QnQ" id="200"><ns0:MessageDigest uuid="DAD31333-D36F-457C-8BFF-A10168871A79" timestamp="2002-05-30T09:30:10Z" message_type="Nomination"/><ns0:NominationType>INSPECTION</ns0:NominationType><ns0:CompanyRequestor>ENI SPA</ns0:CompanyRequestor><ns0:Operator user_code=""><ns0:last_name/><ns0:first_name/><ns0:email_address/></ns0:Operator><ns0:Header><ns0:Nomination>20</ns0:Nomination><ns0:Company id="200"/><ns0:Vessel id="200"/><ns0:Commodity code="200"/><ns0:Port id="200">200</ns0:Port><ns0:OperationType>LOADING</ns0:OperationType><ns0:NominationLaycan><ns0:StartDate>2002-05-30T09:30:10Z</ns0:StartDate><ns0:EndDate>2002-05-30T09:30:10Z</ns0:EndDate></ns0:NominationLaycan></ns0:Header></ns0:Nomination></Nomination>
--_NextPart_000_0002_01C3E1CC.3BB37320
Content-disposition: testo.pdf
Content-type: application/pdf

%PDF-1.3
%âãÏÓ
57 0 obj
<< 
/Linearized 1 
/O 59 
/H [ 1653 400 ] 
/L 235576 
/E 202055 
/N 2 
/T 234318 
>> 
endobj
                                                       xref
57 60 
0000000016 00000 n
0000001548 00000 n
0000002053 00000 n
0000002260 00000 n
0000002672 00000 n
0000002722 00000 n
0000002957 00000 n
0000003007 00000 n
0000003056 00000 n
0000003599 00000 n
0000003639 00000 n
0000003861 00000 n
0000004383 00000 n
0000004432 00000 n
0000004875 00000 n
0000004924 00000 n
0000005139 00000 n
0000005188 00000 n
0000005238 00000 n
0000005259 00000 n
0000005951 00000 n
0000005972 00000 n
0000006685 00000 n
0000006706 00000 n
0000007428 00000 n
0000007449 00000 n
0000008143 00000 n
0000008164 00000 n
0000008931 00000 n
0000008952 00000 n
0000009667 00000 n
0000010140 00000 n
0000010352 00000 n
0000010373 00000 n
0000011079 00000 n
0000011100 00000 n
0000011692 00000 n
0000024688 00000 n
0000033541 00000 n
0000053742 00000 n
0000069124 00000 n
0000069617 00000 n
0000069738 00000 n
0000069857 00000 n
0000069997 00000 n
0000070465 00000 n
0000073143 00000 n
0000073647 00000 n
0000073922 00000 n
0000074419 00000 n
0000075105 00000 n
0000076138 00000 n
0000076884 00000 n
0000081142 00000 n
0000081986 00000 n
0000082255 00000 n
0000082520 00000 n
0000112758 00000 n
0000001653 00000 n
0000002031 00000 n
trailer
<<
/Size 117
/Info 55 0 R 
/Root 58 0 R 
/Prev 234308 
/ID[<398d8fef24fbc5e09927246f61f7c125><b5e96e8992ddf6584c09f48647f1584c>]
>>
startxref
0
%%EOF

58 0 obj
<< 
/Type /Catalog 
/Pages 44 0 R 
/Metadata 56 0 R 
/JT 54 0 R 
/PageLabels 43 0 R 
>> 
endobj
115 0 obj
<< /S 141 /L 341 /Filter /FlateDecode /Length 116 0 R >> 
stream
H‰b``f``+e`c`ˆ
cb@

--_NextPart_000_0002_01C3E1CC.3BB37320
Content-disposition: testo.pdf
Content-type: application/pdf

%PDF-1.3
%âãÏÓ
57 0 obj
<< 
/Linearized 1 
/O 59 
/H [ 1653 400 ] 
/L 235576 
/E 202055 
/N 2 
/T 234318 

>> 
endobj
                                                       xref
57 60 
0000000016 00000 n
0000001548 00000 n
0000002053 00000 n
0000002260 00000 n
0000002672 00000 n
0000002722 00000 n
0000002957 00000 n
0000003007 00000 n
0000003056 00000 n
0000003599 00000 n
0000003639 00000 n
0000003861 00000 n
0000004383 00000 n
0000004432 00000 n
0000004875 00000 n
0000004924 00000 n
0000005139 00000 n
0000005188 00000 n
0000005238 00000 n
0000005259 00000 n
0000005951 00000 n
0000005972 00000 n
0000006685 00000 n
0000006706 00000 n
0000007428 00000 n
0000007449 00000 n
0000008143 00000 n
0000008164 00000 n
0000008931 00000 n
0000008952 00000 n
0000009667 00000 n
0000010140 00000 n
0000010352 00000 n
0000010373 00000 n
0000011079 00000 n
0000011100 00000 n
0000011692 00000 n
0000024688 00000 n
0000033541 00000 n
0000053742 00000 n
0000069124 00000 n
0000069617 00000 n
0000069738 00000 n
0000069857 00000 n
0000069997 00000 n
0000070465 00000 n
0000073143 00000 n
0000073647 00000 n
0000073922 00000 n
0000074419 00000 n
0000075105 00000 n
0000076138 00000 n
0000076884 00000 n
0000081142 00000 n
0000081986 00000 n
0000082255 00000 n
0000082520 00000 n
0000112758 00000 n
0000001653 00000 n
0000002031 00000 n
trailer
<<
/Size 117
/Info 55 0 R 
/Root 58 0 R 
/Prev 234308 
/ID[<398d8fef24fbc5e09927246f61f7c125><b5e96e8992ddf6584c09f48647f1584c>]
>>
startxref
0
%%EOF

58 0 obj
<< 
/Type /Catalog 
/Pages 44 0 R 
/Metadata 56 0 R 
/JT 54 0 R 
/PageLabels 43 0 R 
>> 
endobj
115 0 obj
<< /S 141 /L 341 /Filter /FlateDecode /Length 116 0 R >> 
stream
H‰b``f``+e`c`ˆ
cb@
  

采样传入消息

0 个答案:

没有答案