Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: RESTFull and WSAttachment  (Read 1128 times)
Benjamin G.
Posts: 130


« on: October 17, 2024, 11:53:42 am »

Hello,

When using WSAttachement to send a file to a GET request, how do I specify that the file is optional?
If I specify an existing file everything works fine. If I don't give a file (ficdia = NULL) it generates an infinite loop with code -8 (http error ...)


this is how the service is defined ...

PUBLIC FUNCTION getDownloadCustomerDiapo(head_numpro STRING ATTRIBUTES(WSHeader,WSOptional,WSName = ‘X-NUMPRODIS’)
                                        ,head_numcli STRING ATTRIBUTES(WSHeader,WSOptional,WSName = ‘X-NUMCLI’)
                                        ,head_diacli STRING ATTRIBUTES(WSHeader,WSOptional,WSName = ‘X-DIACLI’))
         ATTRIBUTES(WSGet
                   ,WSPath = ‘/download-customer-diapo’
                   ,WSDescription = ‘GET : Retrieves the zip file with the customer's slideshows’ ,WSRetCode = ‘GET : Retrieves the zip file with the customer's slideshows
                   ,WSRetCode = ‘201:Ok’
                   ,WSThrows = ‘400:Bad Request,500:Internal Server Error’)
        RETURNS (STRING ATTRIBUTES(WSMedia = ‘application/json’)
                ,STRING ATTRIBUTES(WSAttachment, WSMedia = ‘zip/*’))
  DEFINE jsn base.StringBuffer
  DEFINE ficdia STRING

  LET ficdia = prodisdbs.getDownloadCustomerDiapoPRODIS(jsn:=base.StringBuffer.create(),head_numpro,head_numcli,head_diacli)

  RETURN jsn.toString(),ficdia
END FUNCTION

thank you

Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines