Page 1 of 2
SoapAction
Posted: Wed Nov 10, 2021 7:14 pm
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
Re: SoapAction
Posted: Wed Nov 10, 2021 8:19 pm
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.
Re: SoapAction
Posted: Wed Nov 10, 2021 10:46 pm
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.
Re: SoapAction
Posted: Wed Nov 10, 2021 10:49 pm
by PeteMoore
Sorry, forgot to mention that the SoapAction in Example16 program is only 18 characters long (see line 88 - : '"GetConversionRate"');
Re: SoapAction
Posted: Wed Nov 10, 2021 10:58 pm
by msddcb
I have a number of previous versions and example 20 only has
** XML-RPC example
c eval *inlr = *on
In every version.
Re: SoapAction
Posted: Wed Nov 10, 2021 11:10 pm
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?
Re: SoapAction
Posted: Wed Nov 10, 2021 11:12 pm
by Scott Klement
Also, in the current version of HTTPAPI, the SoapAction parameter can be up to 16384 characters long.
Re: SoapAction
Posted: Wed Nov 10, 2021 11:50 pm
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?
Re: SoapAction
Posted: Wed Nov 10, 2021 11:56 pm
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');
Re: SoapAction
Posted: Thu Nov 11, 2021 12:03 am
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.