Fantastic! It all works now. And I see the benefit of IWS in parsing
the incoming data -- it handles XML or JSON and puts it into the data
structure with no effort on my part. For the record, the IWS
configuration is
Service
Resource name: lab_repair
Resource description: RT0200S
Service install path : /www/lab_repair/webservices/services/lab_repair
URI path template: /
User ID for service: myuserid
Program: /QSYS.LIB/RTLIB.LIB/RT0200S.SRVPGM
Library list for service: RTLIB
Methods
Procedure name: ADDCASE
HTTP request method: POST
URI path template for method: *NONE
HTTP response code output parameter: *NONE
HTTP header array output parameter: *NONE
Allowed input media types: *XML_AND_JSON
Returned output media types: *XML_AND_JSON
Input parameter mappings:
Parameter name Data type Input source Identifier Default Value
pCaseInfo struct *NONE
And in my program
d AddCase pr
d pCaseInfo const
likeds(Case) input
d pCaseNbr 256a output
d case ds qualified
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 proddesc 30a
d phone 10a
and in the AddCase procedure, references to the data are like this:
LMNAME = pCaseInfo.Name;
LMADR1 = pCaseInfo.Addr1;
Zero coding to handle XML or JSON.
And the URL is simply
http://1.2.3.4:10010/web/services/lab_repair. ; The
XML or JSON is in the
message body of the HTTP POST request.
Thanks to Nadir, Tim, Jon, Booth, Buddy, and Brad for all the help! The
talent on this list is amazing.
--
*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.