Need to return Large XML and JSON data over 16 meg
Posted: Thu Mar 20, 2025 1:10 pm
				
				First please excuse my ignorance, I am new to this process.
I have a client that will be sending in large XML and JSON data (passed as a pointer) to my RPG program (up to 30 meg long). I need to send the data to the server and then the server will return a response that can be up to 40-50 meg long. These are details on insurance policies that are very detailed with 100's of vehicles and coverages all at one time. Using a pointer I can send the request using the following.
I do have the control option set in the program to use Teraspace: ctl-opt ALLOC(*TERASPACE);
My issue is when the data is returned in the ENDPROC procedure, I am only getting the first 32767 bytes of the Response string tag in the XML response. I need to get the full response that could be as large as 50meg back and put it in a pointer that is allocated at the needed size for the full return string. 
in this case I see that the field value has a length of 16000000 but I still only see the first 32767 bytes of data in the field VALUE.
Does anyone have a solution to my problem? Any code examples of how to return more than the 32767 bytes back would be a big help for me.
Thanks in advance,
George
			I have a client that will be sending in large XML and JSON data (passed as a pointer) to my RPG program (up to 30 meg long). I need to send the data to the server and then the server will return a response that can be up to 40-50 meg long. These are details on insurance policies that are very detailed with 100's of vehicles and coverages all at one time. Using a pointer I can send the request using the following.
I do have the control option set in the program to use Teraspace: ctl-opt ALLOC(*TERASPACE);
Code: Select all
rc = http_url_post_xml(           
          %trim(url)              
         :POLEXTPTR               
         :POLEXTLEN               
         :%paddr(StartProc)       
         :%paddr(EndProc)         
         :*NULL                   
         :180                     
         :HTTP_USERAGENT          
         :'text/xml;charset=UTF-8'
         : %trim(soapaction));    
Code: Select all
 P EndProc         B                                             
 D EndProc         PI                                            
 D   userdata                      *   value                     
 D   depth                       10I 0 value                     
 D   name                      1024A   varying const             
 D   path                     24576A   varying const             
 D   value                         A   LEN(16000000)             
 D   attrs                         *   dim(32767)                
 D                                     const options(*varsize)   
     /free                                                       
                                                                 
       If (Name = 'ResponseValue');                              
          DSPLY %LEN(VALUE);                                     
Does anyone have a solution to my problem? Any code examples of how to return more than the 32767 bytes back would be a big help for me.
Thanks in advance,
George