Hi Laurent,
The image is clearly showing an incomplete message content: just the beginning of the attached PDF document is there.
I suppose you are using uhttp.send() to manage a round trip to and from the SOAP web service using MIME/MTOM; if you are getting $status = 1 after it you should call read_content to complete message buffer like in the standard example:
activate "UHTTP".send(pUrl, "GET", pUsername, pPassword, pHttpHeader, pHttpContent, vResponse)
while ($status = 1)
activate "UHTTP".read_Content(vMoreContent) ; get more data from UHTTP buffer
pHttpContent = $concat(pHttpContent, vMoreContent)
endwhile
What in your case it is not aligned to this programming mode?
Regards,
Gianni
------------------------------
Gianni Sandigliano
Italy
------------------------------
Original Message:
Sent: 11-08-2021 07:07
From: Laurent Mérot
Subject: Extract files from response of WebServices / MIME / MTOM
Hello,
Our supplier told us that the useful part of the response was just after the "%PDF 1-3" tag.
When we test our WebService with Soapui, we can see the entier response, but in Uniface, the responses seems to be truncated as you can see in pictures.
Is there a mean to extract the entire response in Uniface ? We tried to use the READ_CONTENT function but it was not successfull.
Regards,
Laurent.
------------------------------
Laurent Mérot
Rocket Forum Shared Account
Original Message:
Sent: 10-30-2021 07:51
From: Gianni Sandigliano
Subject: Extract files from response of WebServices / MIME / MTOM
Hi Laurent,
I did a quick search too and found this page reporting a php class probably equivalent to your need; it's a simple routine and it should be a very quick task to rebuilt it with Uniface.
Hope it helps.
Regards,
Gianni
------------------------------
Gianni Sandigliano
Italy
Original Message:
Sent: 10-22-2021 09:13
From: Laurent Mérot
Subject: Extract files from response of WebServices / MIME / MTOM
Hello,
I call WebService of a carrier to print a sticker on parcels I deliver.
I test my request in SoapUI and the sticker semmes to be included in the response. The carrier told me "Our WebService uses MTOM Technology (Message Trasmission Optimization Mechabism). By this way, the sticker is attached in MIME format in the response. You will have to parse the response to extract the .pdf file of this sticker."
Do you know how to extract such files ?
Tks
------------------------------
Laurent Mérot
Rocket Forum Shared Account
------------------------------