Just for clarification, a regular expression is not necessary. So what
are you specifying for URI path template for the resource?

There is 2 places where it can be specified. One covers all the APIs and
is shown when you specify resource name. The other is specific to the API
when specify REST information for the API.

So what are you specifying exactly?

There is a sample program in QSYSDIR/QIWSSAMPLE that all can use. It
converts temp from Fahrenheit to Celsius. So on the resource panel, I
specify:


Resource name: QIWSSAMPLE
Service description: QIWSSAMPLE
URI path template: /{temp}

Then on Next panel TEMPIN is the input parameter and TEMPOUT is the output
parameter.

On the panel (Step 5 - Specify resource method information), I take the
defaults. However, for the Input parameter mappings table at bottom of
panel, there is a selection box for "Input source". If you select
*PATH_PARAM, the identifier selection box will be filled with available
template variables. Since there is only one, you are done.

Once you deploy, the path you would use would look something like:

http://host:10010/QIWSSAMPLE/234

And you should get a response back.


"WEB400" <web400-bounces@xxxxxxxxxxxx> wrote on 11/21/2018 01:03:07 AM:

From: "Danny Rodius" <danny.rodius@xxxxxxxxx>
To: "'Web Enabling the IBM i \(AS/400 and iSeries\)'"
<web400@xxxxxxxxxxxx>
Date: 11/21/2018 01:07 AM
Subject: Re: [WEB400] Setting up a web services server, and services
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxx>

Hi,

Take a look at this example provided by IBM


https://www.ibm.com/developerworks/ibmi/library/i-rest-web-services-server1


Just download the resources, compile and deploy as described in the
doc (multiple parts)
Take a good look at the screens.

Your examples of the path are missing the regex part defining the
variable.
As an example you can use {datein:\d+}
Where datein: defines the id that is used and \d+ defines the parm
as a multiple digits field.
If you want a character field then you can use {datain:\{1,10}}
This defines a char field with length of 1 to 10 chars.

Hope this helps,


-----Original Message-----
From: WEB400 <web400-bounces@xxxxxxxxxxxx> On Behalf Of Booth Martin
Sent: woensdag 21 november 2018 2:35
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxx>
Subject: Re: [WEB400] Setting up a web services server, and services

I can find no information about *PATH_PARM beyond the Help page, and
frankly I couldn't figure out that section. Let me ask specifically....

Web service is WEEKDAY, an SQLRPGLE *PGM. The program has two
parms, DATEIN and DAYOUT, both 10/char.

I put a default date in the IWS Wizard for the service with
*QUERY_PARM. That, using a browser, returns the correct day-name as
JSON. So the service works. It just doesn't recognize DATEIN.

However I can't figure out how to use *PATH_PARM. What is the
correct URI path template?

I tried

* /{DateIn}
* /{DATEIN}
* /DATEIN/{DateIn}
* /WEEKDAY/{DATEIN}

and a few more permutations but none work.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.