Plex 2E

Expand all | Collapse all

Can one use Pointers in Plex 6.1 RPG

Jump to Best Answer
  • 1.  Can one use Pointers in Plex 6.1 RPG

    Posted 08-18-2016 03:30 AM

    Hi,

     

    What I want to do :

    I am building(concatenating) a xml (string) in a plex function (rpg) , this xml can be huge and I/we ran into trouble when we ran into size limit constraint of a variable. What I want to do is define a pointer and then when I am appending to my xml(pointer in memory) . Then when calling a sub function (another rpg function) reference this pointer to get the xml file in memory. Is this posible? How do you define the pointer address in Plex rpg function and then how would you reference it again in a sub funtion call(another rpg function called from the main function).

     

    Hope this makes sense. We are still using Plex 6.1.

     

    Thanks.



  • 2.  Re: Can one use Pointers in Plex 6.1 RPG
    Best Answer

    Posted 08-18-2016 11:17 AM

    I have used pointers in stellatools Consume & Publish Webservices from IBMi - Solved



  • 3.  Re: Can one use Pointers in Plex 6.1 RPG

    Posted 08-22-2016 03:44 AM

    Thanks I also wanted to use pointers but struggled to get it working.. could you please post a link to the download page of StellaTools1.5_Beta.mdl   I did follow your link and registered on the website and also downloaded StellaToolsV2.04.zip Theres a local model but not sure if this is the correct model, if it is where would I get the example of using a pointer? What I basically am trying to do is build my request in  Program A and send it via a pointer to Program B In program B Call the Webservice. Do you have anny example of using a pointer in Plex



  • 4.  Re: Can one use Pointers in Plex 6.1 RPG

    Posted 08-22-2016 01:47 PM

    2.04 comes after 1.5

     

    I presently am on an enforced sabbatical from Plex so don't have access to the plex ide on my pc.

     

    I used pointers in my source as S.Klement does on his http solution. You should try an build the examples and dig into the action diagrams to see how I used RPG source with action diagrams.



  • 5.  Re: Can one use Pointers in Plex 6.1 RPG

    Posted 08-24-2016 03:23 AM

    Wow... firstly awesome implementation or in integration with HTTPAPI and plex.  I also see how to use pure rpg coding source code in plex and I tried Implementing a pointer solution. Could you please check the following and tell me if I am on the correct track?

     

    I went through the examples using httpApi in stella tools and did the following.

     

    This is in "Program A" : this program is responsible for building the request, in this plex function(RPGIV) I created a new field in WorkL called "MyXMLString"  in the source code I modified it to be based on a pointer.

     

    programA.PNG

    Now in "Program A" I am setting or appending the XML in to "MyXMLString"

     

    setAndcallMemory.PNG

    Where MyXMLString.Test1 is a  valid xml request just for testing purpose.

    I then call a function RPGWebserviceCallInMemory that I created in Websphere Development studio the input I defined the following way.

     

    iservice.PNG    

    I defined the iServiceReq as a pointer.

     

    Then I also defined the following.

    vService.PNG

    I define a string or field in memory that will be send into  http_url_post

     

       myString.PNG

    Next I move the the input in to my working variables.

    movel.PNG

     

    In my free format I set myString pointers address to the input address vServiceReq.

    I then consume the webservice using myString address as my post data.

     

    free form.PNG

     

    When I run Program A and view my spoolfile to check the print statements I get the following.

    gerror.PNG

     

    So I am guessing its sort of working except its cutting off the start of my xml string.

     

    Am I on the correct path in using a pointer will I be able to store a large string ie. 300 000 characters in my Input variable.

     

    Thanks for your input I appreciate it.



  • 6.  Re: Can one use Pointers in Plex 6.1 RPG

    Posted 08-24-2016 03:43 AM

    About the cutting off my xmlString What I am seeing is that when I put spaces infront of the literal it works or rather it does not cut it off.

    literal.PNG



  • 7.  Re: Can one use Pointers in Plex 6.1 RPG

    Posted 08-24-2016 05:56 AM

    Wow... firstly awesome implementation or in integration with HTTPAPI and plex.

    Yep the culmination of 17 years working with Plex non stop..thought the initiative would generate work or a job but actually the next thing that happened was having to leave plex...some reward...sorry cant help you any further.

     

    Also if you trying to consume a webservice just use the patterns stop reinventing the wheel..Scott Klement is better than you!



  • 8.  Re: Can one use Pointers in Plex 6.1 RPG

    Posted 08-24-2016 06:14 AM

    Thanks I understand.