Re: IWS and input parameters...
Robert Rogerson <[email protected]>
| Newsgroups | gmane.comp.systems.as400.web |
|---|---|
| Message-ID | <CAB_EQWunmTc8MBAY-_JoZgXgh-JmH+y7GioQTdfjg+mZi7hNyQ@mail.gmail.com> |
Thanks everyone. I feel better now about using a POST to retrieve the data. Thanks for everyone's input. Rob On Tue, Dec 15, 2020 at 4:42 PM Don Brown via WEB400 < [email protected]> wrote: > We use IWS for some system to system notifications. > > Rather than creating a new service for every different requirement we > simply pass a data structure and the processing RPG program determines the > request type and calls the required procedure. > > This allows new requirements to be added with no change to the IWS > definition and works very well. > > > Cheers > > > > > > > > From: "Robert Rogerson" <[email protected]> > To: "Web Enabling the IBM i (AS/400 and iSeries)" > <[email protected]> > Date: 16/12/2020 06:44 AM > Subject: Re: [WEB400] IWS and input parameters... > Sent by: "WEB400" <[email protected]> > > > > @Jon, so you are suggesting the pFilterDs input parm(s) be passed as a > character string and then parse them in the RPG. That way I could still > use a GET. > That may work... > > @Nadir, thanks for the links. I reread them and I think I have a better > understanding. One question, which I know I'm going to be asked is, why > are you using a POST to retrieve data? I now understand I can do this. > But is the reason that there is a restriction in IWS (as there is more > than > one parameter that is a structure) or is this a restriction of all web > service servers? > > Thanks, > > Rob > > On Tue, Dec 15, 2020 at 11:09 AM Jon Paris < > > https://urldefense.proofpoint.com/v2/url?u=http-3A__jon.paris-40partner400.com&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=REkUDLJJFdQNGPX_i1CJifIdX7R4t63_LSyAqHcYJOg&e= > > wrote: > > > I don't have time to play but, if you want to stick with GET, can you > not > > add an extra simple input parm to deal with this? > > > > > > Jon > > > > > > > On Dec 14, 2020, at 11:20 PM, Robert Rogerson <[email protected]> > > wrote: > > > > > > I'm new to this so I'm trying to understand. > > > If I want to return rows, normally I would use a GET. But since one > of > > my > > > input parameters is a structure I'm forced to either use a POST or a > PUT. > > > So I'm sort of forced out of the convention that GET is to read > records, > > > POST is to create records and PUT is to update records. > > > So it's ok to do a POST only to read records? > > > > > > Is there anyone else using IWS from an RPG perspective that has found > or > > > could share some useful information? > > > > > > Thanks, > > > > > > Rob > > > > > > On Mon, Dec 14, 2020 at 10:37 PM Nadir Amra <amra-r/[email protected]> wrote: > > > > > >> the suffix _LENGTH must be capital because that is what IWS > > currently > > >> looks for. It should not matter because it is not part of payload. > > >> > > >> If you have a structure that is an input parameters, then the HTTP > > method > > >> is POST or PUT. > > >> > > >> Other than what we have for doc on web site, and articles, > that > > is > > >> all the doc there is. We are in process of updating the doc. > > >> > > >> > > >> > > >> > > >> "WEB400" <[email protected]> wrote on 12/14/2020 > > 05:52:33 > > >> PM: > > >> > > >>> From: Robert Rogerson <[email protected]> > > >>> To: "Web Enabling the IBM i (AS/400 and iSeries)" > > >> <[email protected]> > > >>> Date: 12/14/2020 05:52 PM > > >>> Subject: [EXTERNAL] Re: [WEB400] IWS and input parameters... > > >>> Sent by: "WEB400" <[email protected]> > > >>> > > >>> @Nadir, your assumption is correct, pFilterDs is indeed input. So > you > > >> are > > >>> saying that I can have a data structure as input? > > >>> > > >>> Why must the "_lenght" be in upper case. I've never seen nor > > understand > > >>> this requirement. > > >>> > > >>> Thanks, > > >>> > > >>> Rob > > >>> > > >>> On Mon, Dec 14, 2020 at 3:25 PM Nadir Amra <amra-r/[email protected]> wrote: > > >>> > > >>>> Which parameters are input and which output? > > >>>> > > >>>> And "_length" suffix should be "_LENGTH" > > >>>> > > >>>> Assuming pFilterDs is input, you may want to define a length > > >> field > > >>>> for it as well so that you know how many entries are being > passed > > >> in. > > >>>> > > >>>> > > >>>> "WEB400" <[email protected]> wrote on 12/14/2020 > > >> 08:24:21 > > >>>> AM: > > >>>> > > >>>>> From: Robert Rogerson <[email protected]> > > >>>>> To: "Web Enabling the IBM i (AS/400 and iSeries)" > > >>>> <[email protected]> > > >>>>> Date: 12/14/2020 08:24 AM > > >>>>> Subject: [EXTERNAL] [WEB400] IWS and input parameters... > > >>>>> Sent by: "WEB400" <[email protected]> > > >>>>> > > >>>>> I want to have a filter(s) for my api. > > >>>>> An individual filter is defined as > > >>>>> > > >>>>> dcl-ds filterTmp template qualified; > > >>>>> type char(20); > > >>>>> value char(20); > > >>>>> end-ds; > > >>>>> > > >>>>> But there may be multiple occurrences of filter. For example, > > >>>>> > > >>>>> 'Warehouse': '95,96,97' > > >>>>> 'Type':'Shipments' > > >>>>> 'DateRange': 'LastWeek' > > >>>>> > > >>>>> I was hoping to do something like > > >>>>> dcl-pi *n; > > >>>>> pFilterDs likeds(filterTmp) dim(10) const; > > >>>>> transactionDs_length int(10); > > >>>>> transactionsDs likeds(transactionsTmp) dim(1000); > > >>>>> httpStatus like(httpStatusTmp); > > >>>>> httpHeaders like(httpHeadersTmp) dim(10); > > >>>>> end-pi; > > >>>>> > > >>>>> But when I try this on Step 5 of 9 on the Deploy New Service > Wizard > > >> I > > >>>> get > > >>>>> error > > >>>>> *Error:* ZUI_54411: The HTTP method must be PUT or POST when there > > >> is an > > >>>>> input parameter that is not being injected with a value. > > >>>>> > > >>>>> How should I be doing this? > > >> > > >> > > >> > > >> -- > > >> This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) > mailing > > >> list > > >> To post a message email: [email protected] > > >> To subscribe, unsubscribe, or change list options, > > >> visit: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=c7bsModZPkouNaadst1a3s9b2IS5zQ4RKb_D0CzK0q4&e= > > > >> or email: [email protected] > > >> Before posting, please take a moment to review the archives > > >> at > > https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=wd2rHGPh_MTGvM-Z_Q2WeWs2Ar60s-YEvMCzSOjCWuY&e= > . > > >> > > >> > > > -- > > > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) > mailing > > list > > > To post a message email: [email protected] > > > To subscribe, unsubscribe, or change list options, > > > visit: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=c7bsModZPkouNaadst1a3s9b2IS5zQ4RKb_D0CzK0q4&e= > > > > or email: [email protected] > > > Before posting, please take a moment to review the archives > > > at > > https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=wd2rHGPh_MTGvM-Z_Q2WeWs2Ar60s-YEvMCzSOjCWuY&e= > . > > > > > > > -- > > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing > > list > > To post a message email: [email protected] > > To subscribe, unsubscribe, or change list options, > > visit: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=c7bsModZPkouNaadst1a3s9b2IS5zQ4RKb_D0CzK0q4&e= > > > or email: [email protected] > > Before posting, please take a moment to review the archives > > at > > https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=wd2rHGPh_MTGvM-Z_Q2WeWs2Ar60s-YEvMCzSOjCWuY&e= > . > > > > > -- > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing > list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=c7bsModZPkouNaadst1a3s9b2IS5zQ4RKb_D0CzK0q4&e= > > or email: [email protected] > Before posting, please take a moment to review the archives > at > > https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_web400&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=Kys-lxRCMpPr7up01Pp1FRjOe49ne6imWwi1b-ue8yQ&m=niBeXv162AFFRLA__8V3kbpOQvbzDlhUTlGl6Ez-pbY&s=wd2rHGPh_MTGvM-Z_Q2WeWs2Ar60s-YEvMCzSOjCWuY&e= > . > > > > > > -- > This email has been scanned for computer viruses. Although MSD has taken > reasonable precautions to ensure no viruses are present in this email, MSD > cannot accept responsibility for any loss or damage arising from the use of > this email or attachments.. > -- > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing > list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/web400 > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/web400. > > -- This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/web400 or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/web400.