Jump to content

Fazer download de ficheiro do tipo mimebondary em Delphi


pessantiago

Recommended Posts

pessantiago

boas alguem sabe como posso fazer o download deste tipo de ficheiros em delphi

download xml 

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:getFileResponse xmlns:ns="http://ws.allianz.com">
         <ns:return>
            <swa:DownFileServiceResponse xmlns:swa="http://ws.allianz.com">
               <swa:msg><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?><DownFileResponse><ReturnCode>0</ReturnCode><ReturnText></ReturnText></DownFileResponse>]]></swa:msg>
               <swa:file href="idfile:PMTP.O31.ZIP">
                  <xop:Include href="cid:1.4d44449543e7a99b3a238816e4dc50c08847d77a7729c904@apache.org" xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
               </swa:file>
            </swa:DownFileServiceResponse>
         </ns:return>
      </ns:getFileResponse>
   </soapenv:Body>
</soapenv:Envelope>

 

o ficheiro em raw pelo soap ui 

--MIMEBoundary_6d44449543e7a99b3a238816e4dc50c08847d77a7729c904
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.7d44449543e7a99b3a238816e4dc50c08847d77a7729c904@apache.org>

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getFileResponse xmlns:ns="http://ws.allianz.com"><ns:return><swa:DownFileServiceResponse xmlns:swa="http://ws.allianz.com"><swa:msg><?xml version="1.0" encoding="ISO-8859-1"?><DownFileResponse><ReturnCode>0</ReturnCode><ReturnText></ReturnText></DownFileResponse></swa:msg><swa:file href="idfile:PMTP.O31.ZI"><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:1.4d44449543e7a99b3a238816e4dc50c08847d77a7729c904@apache.org"/></swa:file></swa:DownFileServiceResponse></ns:return></ns:getFileResponse></soapenv:Body></soapenv:Envelope>
--MIMEBoundary_6d44449543e7a99b3a238816e4dc50c08847d77a7729c904
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <1.4d44449543e7a99b3a238816e4dc50c08847d77a7729c904@apache.org>

PK���

 

Link to post
Share on other sites

Ou não te estás a explicar bem ou não estou a perceber bem.

O "ficheiro" que apresentas não é nenhum ficheiro, é um webservice. O Soap UI não apresenta ficheiro nenhum, faz a chamada ao webservice a presenta o resultado (em texto) dessa chamada.

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Link to post
Share on other sites
pessantiago

boas já conseguir quase resolve o problema 

mas ao gravar ele grava-me o ficheiro na totalidade e para conseguir extrair tenho de editar com o notepad ++ e apagar os cabeçalhos

 

 IdHTTP1.Post(URL, Entrada, saida);

          saida := TMemoryStream.Create;

   saida.SaveToFile('c:\temp\test.ZIP');

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.