using the IBM "wsdl2rpg.sh" tool (part 2)

Theo Kouwenhoven
Theo Kouwenhoven used Ask the Experts™
on
Hi Experts,

I have Generate the sources for a webservice with the default string length of 128.
In the service there is one element that have  to contain  base64 data so 128 pos it to small,
So I like to set the the size of only 1 field to 16384 (or even more).

Therefore I tried to copy the  xsd_string definition to a  xsd_Lstring definition and changed the value entry to a larger number.
After that I changes all required likeds(xsd_string) into xsd_Lstring  (I think i did, but probably I missed one or more)
Then recreated the Service-program.
I understand what is wrong, but can't find where to change that.

Whatever I try I keep the error:

Message RNQ0202
The call to stub_op_M1 ended in error (C G D F).
Cause . . . . . :   RPG procedure TRNS001R in program KWNPGM61/TRNS001R at    
  statement 3456 called program or procedure stub_op_M1, which ended in error.
  If the name is *N, the call was a bound call by procedure pointer.          
Recovery  . . . :   Check the job log for more information on the cause of the
  error and contact the person responsible for program maintenance.          

more info (f10)

Message: RNX0115
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
  XSD_STRING in program KWNPGM61/TRANSUS01.                                  
Recovery  . . . :   Contact the person responsible for program maintenance to
  determine the cause of the problem.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Gary PattersonVP Technology / Senior Consultant

Commented:
Need to see your code.
Gary PattersonVP Technology / Senior Consultant

Commented:
Ok, good.  I see where the call is happening.  Also need a formatted dump of TRNSR001R when the error occurs, and also stub_op_M1 - so we can see variable values.
Theo KouwenhovenApplication Consultant

Author

Commented:
Hi Gary,

Attached the sources again, changed with the xsd_Lstring definition
I also added the xsd_LstringCopyIn_ AND xsd_LstringCopyOut_
zip. Including Dump and compiler listing (if required)

It keep telling me that XSD_STRING is out of range I thought that I replaced them (where required) with the XSD_LSTRING version.
not clear what I skipped.... :(

(hours later.... still no clue)
I foud out that the problem is (probably) in a C program My C knowledgr is *zero.

In Source WebConnectSoap_util.rpgle Line 6 is causing the problem  "strlen_ = %LEN(in_.value);" (still no clue)
// Set C field(s) - C strings are null-terminated pointers.

if (in_.isNil = *ON);                                      
  out_ = *NULL;                                            
else;                                                      
  strlen_ = %LEN(in_.value);                              
  if (strlen_ >= MAX_STRING_LEN);                          
    pNullChar_ = %addr(in_.reserved);                      
  else;                                                    
    pNullChar_ = %addr(in_.value) + VARYING_LEN + strlen_; 
  endif;                                                   
                                                           
  nullChar_ = X'00';                                       
  out_ = %addr(in_.value) + VARYING_LEN;                   
endif; 

Open in new window



Regenerate the web-service with -md16384 will help to get a working version, but that is a workarond.
For now it could work, because the 3 web-service has a maximum of 3 elements each.
But in future web-services, with massive XML structures, this is not the solution, help still wanted?
Application Consultant
Commented:
Regenerate the web-service with -md16384 will help to get a working version.
workaround works for now.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial