Uniface 9.7 UHTTP and MTOM

Author: dammie@seznam.cz (dammie)

Hello, is there any posibility how to call SOAP Web Service  with MTOM https://en.wikipedia.org/wiki/Message_Transmission_Optimization_Mechanism and get Binary data (PDF file ) in it? I ve tried UHTTP.SEND ... it worked ( "HTTP/1.1 200 OK" ) but after I ve tried read whole content: https://unifaceinfo.com/docs/0907/uniface/_reference/componentAPIs/httpExecutionOperations/READ_CONTENT.htm I got : "ERROR=-59·;MNEM=<UACTERR_NO_OPERATION>·;DESCRIPTION=No definition found for operation....   It seems there is problem to get binary data of MTOM... ? So is there any way? Can I get SOAP content with MTOM via e.g. DUMP_FILE_CONTENTS same way using example below?  

variables     handle vUhttp     string vUrl, vHeaders, vResp endvariables

newinstance “UHTTP”, vUhttp vUrl = “http://unifaceinfo.com/download/4262/” vUhttp->SET_FLAGS(8)    ; GET send headers vUhttp->DUMP_FILE_CONTENTS(“PAM96.pdf”, “”) vUhttp->SEND(vUrl, “GET”, “”, “”, vHeaders, “”, vResp) vUhttp->DUMP_FILE_CONTENTS(“”, “”)   Thanks for hints..

3 Comments

  1. Hi, we have always had problems with Uniface and binary data, especially as web-service parameters. Thats why we always (if your own web-service) use base64 encoded parameters for binary data, ie. normal string in Uniface. Not much help from me... Regards RogerW.


    Author: rogerw (roger.wallin@abilita.fi)
  2. I have it working and was able to use the example that was included in the documentation (below). The file extension doesn't matter (zip, pdf, png, etc.), but it does work pretty well.....it is only available in 9.6.07+. You may have to make adjustments depending on if you have a proxy server / firewall restrictions.

     vUhttp->SET_FLAGS(8 )        ; GET send headers
    vUhttp->DUMP_FILE_CONTENTS("your.zip", "chunk=256k")
    
    repeat
      vUhttp->GET_INFO("range", vInfo)
      putitem/id/case vHeaders, "Range", "%%vInfo"
      vUhttp->SEND(vUrl, "GET", "", "", vHeaders, "", vResp)
      vUhttp->DUMP_FILE_CONTENTS("", "")
    until (<DefineCondition>)
    
    vUhttp->CLOSE_FILE()
    

    Author: adkinsl (adkins.larry@gmail.com)
  3. Hello, AFAIK multipart-messages are currently not supported by the UHTTP component or the SOAP Call-Out interface. Sorry. It's possible that this already has been logged as a wish (not sure though). But at the moment you need to fallback to an external solution (like e.g. cUrl) or make sure (as RogerW mentioned) that the Web Service just returns base64-encoded data. Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)