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
------------------------------
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
------------------------------
Hello Laurent,
I did a quick web search and most examples I can find for extracting MTOM attachments from a SOAP message is for Java or C#. And if I remember correctly then a customer from France has implemented a Java routine into their Uniface application for this specific task. Unfortunately the colleague who has worked on this case is retired now. Maybe another forum member, who has done this before, can share his experience or a small sample with the community?
But in short: Uniface currently has no out-of-the-box solution for this. It, however, should be possible to use an external routine to extract MTOM attachments from a SOAP message and interface with it from Uniface.
I hope this helps.
------------------------------
Daniel Iseli
Rocket Internal - All Brands
Geneva Switzerland
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield United Kingdom
------------------------------
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
------------------------------
It is possible to transfer binary files for download with the DUMP_FILE_CONTENTS operation, but it currently does not support multi-part HTTP requests (as used here). For details see the following topic in the doc: Binary File Transfers with UHTTP
Not sure if the DUMP_FILE_CONTENTS will actually return an error when it encounters a multi-part HTTP requests. You could give it a try. In case the complete content returned by the request is written to a file then you have to extract the "useful" parts manually.
Hope this helps.
------------------------------
Daniel Iseli
Rocket Internal - All Brands
Geneva Switzerland
------------------------------
It is possible to transfer binary files for download with the DUMP_FILE_CONTENTS operation, but it currently does not support multi-part HTTP requests (as used here). For details see the following topic in the doc: Binary File Transfers with UHTTP
Not sure if the DUMP_FILE_CONTENTS will actually return an error when it encounters a multi-part HTTP requests. You could give it a try. In case the complete content returned by the request is written to a file then you have to extract the "useful" parts manually.
Hope this helps.
------------------------------
Daniel Iseli
Rocket Internal - All Brands
Geneva Switzerland
------------------------------
We used "dump_file_contents" function to read the complete response and it's OK ! Thousands thanks ! We did not know about this function.
Our client is in 9.6 Uniface version and the dump_file_contents is only available in 9.7 one...but fortunately for us Uniface 9.6 can call remote service on server running in 9.7 version :-)
Thanks again,
------------------------------
Laurent Mérot
Rocket Forum Shared Account
------------------------------
We used "dump_file_contents" function to read the complete response and it's OK ! Thousands thanks ! We did not know about this function.
Our client is in 9.6 Uniface version and the dump_file_contents is only available in 9.7 one...but fortunately for us Uniface 9.6 can call remote service on server running in 9.7 version :-)
Thanks again,
------------------------------
Laurent Mérot
Rocket Forum Shared Account
------------------------------
Thanks for your feedback. And you are welcome. Good to hear that it's working.
------------------------------
Daniel Iseli
Principal Technical Support Engineer
Uniface Services
Rocket Software, Switzerland
------------------------------
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.