Thank you so much Jon and Barbara.
I still have more work to do, but I've been able to get the dynamic allocation of memory working for both the data structure and for the single variable.

Barbara, one thing I changed from your sample code is making this based on the 'cur' pointer. I just wanted to make sure I was right in doing that (and it wasn't a fluke that it was working for me).
dcl-s gSoapMsg_view char(MAX_ELEM_LEN)
based(gp_soapMsg_cur); // can't be varchar

Alan, I wasn't aware of the IFS approach you're talking about. Although I don't see how it really gains you anything (other than avoiding dynamic memory allocation in favor of writing out to the IFS). I feel the dynamic allocation approach is better for my situation. We don't need to guess how much memory we need to allocate to support multiple clients running this process at the same time.

Now onto processing the response.

Kurt Anderson
System Development Manager, Service Delivery Platform

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Wednesday, November 15, 2017 6:33 PM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: RPG & Teraspace Storage Model

You should be good on that then Kurt - let us know how it goes.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Nov 15, 2017, at 2:03 PM, Kurt Anderson <Kurt.Anderson@xxxxxxxxxxxx> wrote:

Hi Jon,

I eventually found myself moving in the direction you're talking about and did define the field as 16mb and allocating out further and repositioning the pointer as needed. Still working on it so I haven't tested anything yet.

I'm not using a wizard.
I'm calling Scott's http _post_xml() which does pass in the pointer so fingers crossed on that front.

Kurt Anderson
System Development Manager, Service Delivery Platform


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx
<mailto:rpg400-l-bounces@xxxxxxxxxxxx>] On Behalf Of Jon Paris
Sent: Wednesday, November 15, 2017 1:59 PM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx
<mailto:rpg400-l@xxxxxxxxxxxx>>
Subject: Re: RPG & Teraspace Storage Model

You have to make it at least as big as the largest single entity that you add to it. So I would normally just use a size of 16M and go from there. So for example the normal logic for adding (say) CSV values is:

buffer = newField + comma;
p_buffer += %Len(newField) + 1;

This assumes that newField is varying (replace with appropriate %Trim etc. if not. As long as buffer is big enough to accommodate the largest individual field + 1 then this is all it needs. But it assumes you are passing a pointer and the length to whoever is going to process the thing.

But it sounds like you're maybe using the wizards - if so then you are
out of luck as you aren't just passing a pointer and a length but
having the wizard define the interface from the PCML. But you should
be able to pass a bigger payload using either Scott's HTTPAPI or
alternatively the latest changes to IBM's IWS which let you talk
directly to the underlying APIs and give you more control over the
payload. I have not yet used it myself but there's an article here
that might help.
https://www.ibm.com/developerworks/ibmi/library/i-send-receive-user-de
fined-soap-rest-messages-trs/index.html
<https://www.ibm.com/developerworks/ibmi/library/i-send-receive-user-d
efined-soap-rest-messages-trs/index.html>
<https://www.ibm.com/developerworks/ibmi/library/i-send-receive-user-d
efined-soap-rest-messages-trs/index.html
<https://www.ibm.com/developerworks/ibmi/library/i-send-receive-user-d
efined-soap-rest-messages-trs/index.html>>


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Nov 15, 2017, at 11:46 AM, Kurt Anderson <Kurt.Anderson@xxxxxxxxxxxx> wrote:

I've added in the allocated data structure logic per your article (not yet tested, but it compiled so that's a start). I'm now trying to build a giant string and I'm having issues. The DS stuff worked b/c field sizes aren't changing, I just moved from having an explicit array to using a pointer instead. But for the single field, I have to give it a size, and that size is limited to 16773100. If I make it a smaller value, reallocating doesn't seem to allow it to have a value larger than the initial definition. I figure my approach is wrong here so any help would be great.

In this example, (just for ease of testing) I made the initial size 10 characters, but I want to add a value that is longer than 10 characters.

dcl-s formattedElement varchar( 100 );
dcl-s gp_SoapMsg pointer;
dcl-s gSoapMessage varchar( 10 ) Based( gp_SoapMsg );

gp_SoapMsg = %Alloc( SOAP_INCREMENT );
formattedElement = 'This is my new test element value';
gSoapMessage += formattedElement;

The contents of gSoapMessage is: 'This is my'

Thanks,

Kurt Anderson
System Development Manager, Service Delivery Platform

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Jon Paris
Sent: Tuesday, November 14, 2017 2:09 PM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: RPG & Teraspace Storage Model

P.S. If you are just building up a huge string rather than a DS array type structure as described in the article then simply adapt to increment the pointer at the end of each logic block of data that you add. Basically the logic is the same but the value added to the pointer is the variable length of the data just added and not a fixed increment based on DS size.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com


--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
<mailto:RPG400-L@xxxxxxxxxxxx> To subscribe, unsubscribe, or change
list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
<https://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx
<mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l <https://archive.midrange.com/rpg400-l>.

Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related questions.

Help support midrange.com <http://midrange.com/> by shopping at
amazon.com <http://amazon.com/> with our affiliate link:
http://amzn.to/2dEadiD <http://amzn.to/2dEadiD>
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
<mailto:RPG400-L@xxxxxxxxxxxx> To subscribe, unsubscribe, or change
list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
<https://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx
<mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l <https://archive.midrange.com/rpg400-l>.

Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related questions.

Help support midrange.com <http://midrange.com/> by shopping at
amazon.com <http://amazon.com/> with our affiliate link:
http://amzn.to/2dEadiD <http://amzn.to/2dEadiD>
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].