SoapAction

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
PeteMoore
Posts: 6
Joined: Tue Nov 09, 2021 9:29 pm

SoapAction

Post by PeteMoore »

Hi,
Does anyone have an example of how to do a SoapAction that is longer than 64 characters, previous forum listing say to look at the Example20 program, but unfortunately the latest download of the HTTPAPI software this program has no code other than setting on *inLR.
thanx
Peter
jonboy49
Posts: 206
Joined: Wed Jul 28, 2021 8:18 pm

Re: SoapAction

Post by jonboy49 »

I don't quite understand why you think that 64 chars is an issue. Example 16 for example uses a SOAP request way bigger than 64 characters.
PeteMoore
Posts: 6
Joined: Tue Nov 09, 2021 9:29 pm

Re: SoapAction

Post by PeteMoore »

The SoapAction that I need to send to Singapore Post is 114 characters long, and Scott has made allowance for this by using the http_xproc procedure, and according to previous forum posts there is an example of how code this in the Example20 program, but the current version of that program only has 1 line of code in it that sets on *INLR. So I am hoping that someone can help me out with either the fully coded Example20 program or another program that will show me how to code for the longer SoapAction.
PeteMoore
Posts: 6
Joined: Tue Nov 09, 2021 9:29 pm

Re: SoapAction

Post by PeteMoore »

Sorry, forgot to mention that the SoapAction in Example16 program is only 18 characters long (see line 88 - : '"GetConversionRate"');
msddcb
Posts: 21
Joined: Wed Jul 28, 2021 5:12 am

Re: SoapAction

Post by msddcb »

I have a number of previous versions and example 20 only has
** XML-RPC example
c eval *inlr = *on
In every version.
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: SoapAction

Post by Scott Klement »

Yeah, at one point I thought it might be good to have an XML-RPC example... but I never got around to writing one, and nobody has asked for one. At this point, I think XML-RPC has been completely phased out, so I don't think I ever will.

Note that I did change the EXAMPLE numbers back in 2009. So he may be referring to one before that, but that'd mean he's using a version that's more than 12 years out of date.

Pete, can you tell us what your version of EXAMPLE20 does?
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: SoapAction

Post by Scott Klement »

Also, in the current version of HTTPAPI, the SoapAction parameter can be up to 16384 characters long.
PeteMoore
Posts: 6
Joined: Tue Nov 09, 2021 9:29 pm

Re: SoapAction

Post by PeteMoore »

Hi Scott,
I am currently on version 1.33 (according to the Changelog) and the version of Example20 is the same as you have it:
** XML-RPC example
c eval *inlr = *on
I have tried passing in the 114 character in the parameter (code below) but when I debug the program it looks like it only uses the first 64 characters.

Code: Select all

 rc =  http_url_post_xml( %trim(#url)                                  
                     : %addr(PostData) +2                              
                     : %len(PostData)                                  
                     : *NULL                                           
                     : %paddr(Incoming)                                
                     : %addr(UserData)                                 
                     : 10                                              
                     : HTTP_USERAGENT                                  
                     : 'text/xml; charset=utf-8');                     
                     : 'https://singpostuat2-staging.oss.+             
                     : .oss.neopost-id.com/modules/oss/api+            
                     : /ship/sz_Client#GetAvailableCollections');      
If I upgrade to the latest version will that sort me out, or is there something else that I need to do to get the full SoapAction in the Header?
PeteMoore
Posts: 6
Joined: Tue Nov 09, 2021 9:29 pm

Re: SoapAction

Post by PeteMoore »

apologies, The code I sent had a ";" too many, This is the correct code I used:

Code: Select all

rc =  http_url_post_xml( %trim(#url)                             
                     : %addr(PostData) +2                         
                     : %len(PostData)                             
                     : *NULL                                      
                     : %paddr(Incoming)                           
                     : %addr(UserData)                            
                     : 10                                         
                     : HTTP_USERAGENT                             
                     : 'text/xml; charset=utf-8')                 
                     : 'https://singpostuat2-staging.oss.+        
                     : .oss.neopost-id.com/modules/oss/api+       
                     : /ship/sz_Client#GetAvailableCollections'); 
jonboy49
Posts: 206
Joined: Wed Jul 28, 2021 8:18 pm

Re: SoapAction

Post by jonboy49 »

PeteMoore wrote: Wed Nov 10, 2021 10:49 pm Sorry, forgot to mention that the SoapAction in Example16 program is only 18 characters long (see line 88 - : '"GetConversionRate"');
Yep - sorry I missed that it was SoapAction length you were concerned about. But i see Scott has provided the answer.
Post Reply