pessantiago 1 Posted November 9, 2017 Report Share Posted November 9, 2017 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
M6 149 Posted November 9, 2017 Report Share Posted November 9, 2017 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 1 Posted November 9, 2017 Author Report Share Posted November 9, 2017 faço o pedido pelo soap e aparece-me esta mensagem...so que não sei como faço para ler isto ao que parece vem um attachment em formato MTOM. Link to post Share on other sites
pessantiago 1 Posted November 9, 2017 Author Report Share Posted November 9, 2017 aqui esta um exemplo https://social.msdn.microsoft.com/Forums/expression/es-ES/fd8b0cf4-f657-4ea8-9373-e32b0365f45f/no-se-como-recibir-la-respuesta-de-un-servicio-web-que-devuelve-un-xml-con-un-fichero-en-binario?forum=vbes Link to post Share on other sites
pessantiago 1 Posted November 10, 2017 Author Report Share Posted November 10, 2017 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
pessantiago 1 Posted November 10, 2017 Author Report Share Posted November 10, 2017 Ninguem percebe nada disto já estou contente não sou o único Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now