[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WSDL2RPG - Version 1.1 available



Hi Thomas,

I tried the new version of WSDL2RPG (version 1.1) against the same web 
service as before.  It no longer gets stuck in a loop (which is good), 
but now it crashes with the following:

WSDL2RPG URL('http://www.webservicex.net/WeatherForecast.asmx?wsdl') 
SRCFILE(ISNMAG/QRPGLESRC) SRCMBR(TRWEATHER *YES) 

Length of varying length variable is out of range.
Ownership of object QTES665759 in QGPL type *DTAQ changed.
Ownership of object QTESUSRSP in QTEMP type *USRSPC changed.
The call to main ended in error (C G D F).
C
The call to main ended in error (C G D F).
C
Application error.  RNX0115 unmonitored by WSDL2RPG at statement
   0000012500, instruction X'0000'.


                          Additional Message Information 

 

  Message ID . . . . . . :   RNX0115 

  Date sent  . . . . . . :   03/25/08      Time sent  . . . . . . : 
16:52:16
 

  Message . . . . :   Length of varying length variable is out of range. 

 

  Cause . . . . . :   The length of a varying length character or DBCS 
variable
    is less than 0 or greater than its declared maximum length in RPG 
procedure
    WSDL2R91_Q in program WSDL2RPG/WSDL2RPG. 

  Recovery  . . . :   Contact the person responsible for program 
maintenance to
    determine the cause of the problem. 

 

 

I ran it in debug... and found the error was in the QName_toString() 
procedure.  The problem appears that the parameter passed into this 
procedure (the Wsdl_QName_t structure) had never been initialized, and 
was set to all blanks.  This resulted in the VARYING lengths set to 
x'4040' which was too large... and caused the error.

This is a kludge, but I stuck the following code into the routine as a 
workaround:

P QName_toString...
P                 B                   export
  *
D QName_toString...
D                 PI                         like(wsdl_name_t       )
D  i_qName                            const  likeds(wsdl_qName_t    )
  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  /FREE

     initializeModule();

     // ******** Additions by Scott:
     if %subst(i_qname:1:2) = x'4040';
         return '';
     endif;
     if %subst(i_qname:513:2) = x'4040';
         return i_qName.lName;
     endif;
     // ******* end of additions:

     if (i_qName.ns = '');
        return i_qName.lName;
     else;                                       	
        return i_qName.ns + ':' + i_qName.lName;
     endif;

  /END-FREE
  *
P QName_toString...
P                 E

I'm sure that you can come up with a better fix than that... but it was 
a quick way for me to move on to the next step (there's a lot of code in 
WSDL2RPG, and debugging it properly would've taken a long time.)

After making that change, WSDL2RPG generates a web service stub... but 
the code that it generates won't compile.

Here's the error from the compile listing:

       RNF0501 20      2 Length of character item exceeds 65535; length
                          defaults to 65535. 


It appears to be referring to the following code:

  D tns_RpgArrayOfWeatherData_t...
  D                 DS                  based(pDummy)
  D                                     qualified
  D  item                               likeds(tns_WeatherData_t)
  D                                     dim(DIM_A1)
  D  x                            10I 0

Because data structure names can be used as character strings in RPG, 
the total size of the above DS must be 65535 or smaller.  (Unless you're 
at V6R1!!)  For reference, here are the fields that make up the above DS:

  D tns_WeatherData_t...
  D                 DS                  based(pDummy)
  D                                     qualified
  D  Day                         128A   varying
  D  MaxTemperatureC...
  D                              128A   varying
  D  MaxTemperatureF...
  D                              128A   varying
  D  MinTemperatureC...
  D                              128A   varying
  D  MinTemperatureF...
  D                              128A   varying
  D  WeatherImage                128A   varying

  D DIM_A1          C                   128

So, tns_WeatherData_t is 780 bytes long.  Multiply that by 128, and you 
get 99840...  too large for a 65535 string.  I can solve the problem by 
changing the code for this DS and the value for DIM_A1...  but I wonder 
if there isn't an alternate way to code this so that this sort of thing 
wouldn't be necessary.

Any ideas?



Thomas Raddatz wrote:
> Hi folks,
> 
> I released WSDL2RPG V1.1. You can download WSDL2RPG from my Freeware 
> page at http://www.tools400.de.
> 
> I fixed a bug in the subfile program as well as a bug reported by Scott 
> a few days ago. I also created a MS-DOS batch file to ease uploading 
> WSDL2RPG to a System i. (@Scott: I used your batch file as a starting 
> point and hope you do not mind it.)
> 
> Regards,
> 
> Thomas.
> 
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------