ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Getting the value of a string object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting the value of a string object

    Hello everyone. I am new to this forum and new to calling Java from RPG. I just started a new project to integrate our legacy system to a tax calculation package that is written in Java.

    I currently have the call setup to one of their methods. It accepts a string object containing XML. It returns a string object with the XML response.

    My question is how do I get the contents of that string object into an RPG string so I can analyze it?

    Thanks in advance,

    John

  • #2
    Re: Getting the value of a string object

    There's probably a few ways to do it. One is to call the java "getbytes" method.

    Code:
    * Prototype for Java String's getBytes method  
    d Java_ConvertToBytes...                           
    d                 PR         65535A   EXTPROC(*JAVA:                       
    d                                             'java.lang.String':          
    d                                             'getBytes')                  
    d                                     Varying                 
    
      /free
    
       MyRpgString = Java_ConvertToBytes( JavaString );
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: Getting the value of a string object

      That's exactly what I needed. Thanks Michael.

      Comment

      Working...
      X