Never mind. Bad eyesight (and bad copy/paste). My 'case' data structure actually had a capital S where all I saw was a lower case s: 'commentS' vs 'comments'. When I fixed that, it worked as expected.

--------

This is on a v7r3 LPAR. I had a working REST service to add data from a web form to a lab repair table. It worked fine. Then they wanted to add several lines of comments.  My thought was the XML would look like this:

 <case>
  <name>Customer Name</name>
   <addr1>123 Main St</addr1>
   <city>Springfield</city>
   <state>WK</state>
   <zip>12345</zip>
   <email>homers@xxxxxxxxxxx</email>
   <sku>A1234</sku>
   <proddesc>whatchamacallit</proddesc>
   <serialnbr></serialnbr>
   <phone>8005551212</phone>
   <comments>
       <line>line 1</line>
       <line>line 2</line>
   </comments>
 </case>

and the RPGLE data structure would look like this:

 d AddCase pr
 d  pCaseInfo                            const likeds(case)                 input
 d  pAddResult likeds(AddResult)                  output

 d case            ds                    qualified template
 d  name 25a
 d  addr1 25a
 d  addr2 25a
 d  addr3 25a
 d  city 16a
 d  state 2a
 d  zip 10a
 d  email 100a
 d  sku 10a
 d  serialnbr 8a
 d  proddesc 30a
 d  phone 10a
 d  comments likeds(commentlines)

 d commentlines    ds                    qualified template
 d  line_LENGTH                  10i 0
 d  line                         79a dim(3)

I used IWS to create the web service and tested it. There are no errors, however, the comment "line" array is all blanks, although the line_LENGTH variable contains 3.

What is IWS doing that I don't understand?

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.