× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"Christen, Duane J." wrote:
> 
> I have a java method that I am calling from RPG, which seems not to be
> receiving the tns parameter. When I debug the method the variable tns is not
> available (CPF7E12), and errors out deep inside the soap process. When the
> method is called from a java program, the method works.
> 
> I think that the problem is that the string array is not being passed
> correctly but I can't determine why.
> 

The call to the Java method will pass an array with a dimension of
32767.  If aniList.Elements is less than 32767, some of the elements
will be null.  It looks like the method doesn't support null objects in
the array.

If you are on V5R3, you can use %SUBARR to specify the number of
elements to pass.  You'll have to add CONST to the prototype for the
array parameter.

     jTnList = getSpecificTnList(jLTAConnection(spidIndex) :
%subarr(jANIs : 1 : aniList.Elements)); 

If you are not on V5R3, I think you'll have to write a Java wrapper
method that your RPG program can call, passing an extra parameter of the
number of elements to use from the array.  Or you could directly write
your own JNI to call the method.  (The ILE RPG Programmer's Guide has
some examples of calling JNI directly; you could use those examples for
the basics of RPG JNI, along with the array-handling examples
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jnistring.html#array
from Sun's JNI tutorial (Sun uses C/C++, but the coding for JNI is quite
similar between C and RPG).)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.