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

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.
LVL 17
Theo KouwenhovenApplication ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 ConsultantAuthor 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?
Theo KouwenhovenApplication ConsultantAuthor Commented:
Regenerate the web-service with -md16384 will help to get a working version.
workaround works for now.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
RPGLE

From novice to tech pro — start learning today.