v1.52 - Getting "Pointer not set" error on http_url_post_stmf() call.

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
zeddave
Posts: 1
Joined: Mon Jun 30, 2025 10:50 am

v1.52 - Getting "Pointer not set" error on http_url_post_stmf() call.

Post by zeddave »

This is more of FYI, than a request for help, as I figured out a workaround, but I figured you'd like to know.

I just loaded v1.52, from v1.35.

Existing programs using the "http_url_post_stmf()" api were erroring on the optional "peSOAPAction" parameter not being set, when it tried to call "http_url_post_raw2()" api.
My workaround was to simply add an empty string as the last parameter to the api call.
I tried to pass *omit, but got the same erroring results.

Errored:

Code: Select all

rc =                                                           
 http_url_post_stmf(                                           
  g.url:
  g.tempMimeFile:                                              
  g.responseFile:                                              
  HTTP_TIMEOUT:                                                
  HTTP_USERAGENT:                                              
  http_type:                                                   
 );                                                            
Resolved:

Code: Select all

rc =                                                           
 http_url_post_stmf(                                           
  g.url:
  g.tempMimeFile:                                              
  g.responseFile:                                              
  HTTP_TIMEOUT:                                                
  HTTP_USERAGENT:                                              
  http_type:                                                   
  ''
 );                                                            


Below is the error I was getting and the source

Code: Select all

From program . . . . . . . . . :   HTTPAPIR4           
  From library . . . . . . . . :     LIBHTTP_52        
  From module  . . . . . . . . :     HTTPAPIR4         
  From procedure . . . . . . . :     HTTP_URL_POST_STMF
  From statement . . . . . . . :     7719              
                                                       
To program . . . . . . . . . . :   HTTPAPIR4           
  To library . . . . . . . . . :     LIBHTTP_52        
  To module  . . . . . . . . . :     HTTPAPIR4         
  To procedure . . . . . . . . :     HTTP_URL_POST_STMF
  To statement . . . . . . . . :     7719              
I debugged the process and it was pointing to this call in HTTPAPIR4.

Code: Select all

0029.86 c                   eval      rc = http_url_post_raw2( peURL         
0029.87 c                                                    : wwPostFD      
0029.88 c                                                    : %paddr('read')
0029.89 c                                                    : wwDataSize    
0029.90 c                                                    : wwRecvFD      
0029.91 c                                                    : %paddr('write'
0029.92 c                                                    : wwTimeout     
0029.93 c                                                    : wwUserAgent   
0029.94 c                                                    : wwContentType 
0029.95 c                                                    : wwSOAPAction  
0029.96 c                                                    : wwDataSize64 )
Scott Klement
Site Admin
Posts: 985
Joined: Sun Jul 04, 2021 5:12 am

Re: v1.52 - Getting "Pointer not set" error on http_url_post_stmf() call.

Post by Scott Klement »

What error did you receive? You provided the call stack entries that the error message was sent from/to, but you didn't provide the message itself.
AS400Guy
Posts: 9
Joined: Mon Sep 25, 2023 10:14 am
Location: Rotterdam, The Netherlands

Re: v1.52 - Getting "Pointer not set" error on http_url_post_stmf() call.

Post by AS400Guy »

Hi,
I got the same error (Pointer not set for location referenced' after upgrade to the latest version.

We don't pass the parameter peUserAgent (and soapaction) but it is ALWAYS required when calling http_url_post_raw2. wwUserAgent is not filled and it collapses.

It seems there's no 'else' built in when not passing the optional parms and/or http_url_post_raw2 is called without any optional 'when %parms < 6'

Kind regards,
Post Reply