Hello Nadir

I followed your instructions and deployed the webservices as instructed.


Program code



dcl-Pi main ;
P char(1);
Mode Char(1);
File Char(15);
input1 likeDS(input);
Output likeDS(OUTPUT1);
Error Char(1000);
Status Char(1);
end-Pi;

dcl-ds input qualified ;
HEADR_IN likeDS(t_Headquarters_Service);
BILL_IN likeDS(t_BillTo_Service);
end-ds;

dcl-ds Output1 qualified ;
HEADR_OUT likeDS(t_Headquarters_Service);
BILL_OUT likeDS(t_BillTo_Service);
end-ds;

Webservices deployment

Procedure name: MAIN
HTTP request method: POST
URI path template for method: {P}/{M}/{F}
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 nameData typeInput sourceIdentifierDefault Value
P char *PATH_PARAM P *NONE
MODE char *PATH_PARAM M *NONE
FILE char *PATH_PARAM F *NONE
INPUT1 struct *NONE

I am trying to test the web services in postman by passing path parms

https://10.1.xx.xx/web/services/WEB1/A/G/HEADQTRS

and in body section
{ "P" :"A",
"M":"G"
"F" :"XX"
"HEADR_IN":
{
"headquarterNumber":11,
"headquarterName": "JOHN SMITH",
"headquarterAddressLine1": "ABC",
"headquarterAddressLine2": "SOMETHING NEW",
"headquarterAddressLine3": "ADDRESS 3",
"headquarterCity": "BELLEAIR",
"headquarterState": "FL",
"headquarterZipcode": "33770 ",
"headquarterCountry": "IND",
"headquarterTimeZone": "IST",
"headquarterTelephoneCountryCode": "",
"headquarterPhoneNumber": "",
"headquarterFaxNumber": " ",
"headquarterEmail": "T@xxxxxxxxx",
"headquarterStatus": "A",
"headquarterOpenDate": "2019-05-23",
"headquarterCreditLimit": 0,
"headquarterLastChangedDate": "2019-06-06-01.12.29.682000",
"billToHeadquartersNumber": 0,
"contactCustomerHeadquartersNumber": 0,
"changedTimestamp": "2019-06-06-09.55.52.075875",
"userIdLastUpdated": "FRIND4",
"idPk": 555
},
"BILL_IN":
{
"BILLTOCUSTOMERNUMBER": 0,
"BILLTOCUSTOMERNAME": "string",
"BILLTOCUSTOMERADDRESSLINE1": "string",
"BILLTOCUSTOMERADDRESSLINE2": "string",
"BILLTOCUSTOMERADDRESSLINE3": "string",
"BILLTOCITY": "string",
"BILLTOSTATE": "string",
"BILLTOZIPCODE": "string",
"BILLTOCOUNTRY": "string",
"BILLTOTIMEZONE": "string",
"BILLTOTELEPHONECOUNTRYCODE": "string",
"BILLTOPHONENUMBER": "string",
"BILLTOPHONEEXTENSION": "string",
"BILLTOFAXNUMBER": "string",
"BILLTOSTATUS": "string",
"BILLTOOPENDATE": "2019-06-12",
"BILLTOCURRENCYTYPE": "string",
"BILLTOSALESREP": 0,
"BILLTOTERMSCODE": "string",
"BILLTOSHIPVIA": "string",
"BILLTOFOBCODE": "string",
"BILLTOTAXCODE": "string",
"BILLTOAVERAGEDAYSTOPAY": 0,
"BILLTOCOMMISSIONCODE": "string",
"BILLTOCOPACKER": "string",
"BILLTORAWMATERIALORDERINGAGREEMENT": "string",
"BILLTOBUSINESSCONTRACTAGREEMENT": "string",
"BILLTOVENDORMANAGEDINVENTORY": "string",
"BILLTOACKNOWLEDGEMENTREQUIRED": "string",
"BILLTOSTATEMENTSREQUIRED": "string",
"BILLTOALLOWBACKORDERS": "string",
"BILLTOMINIMUMORDERQUANTITY": 0,
"BILLTOALLOWOVERSHIPMENTS": "string",
"BILLTOOVERSHIPPERCENTAGE": 0,
"BILLTOALLOWOVERPRODUCTION": "string",
"BILLTOOVERPRODUCTIONPERCENTAGE": 0,
"BILLTOALLOWUNDERPRODUCTION": "string",
"BILLTOUNDERPRODUCTIONPERCENTAGE": 0,
"BILLTOHEADQUARTERSNUMBER": 0,
"BILLTOCREDITLIMIT": 0,
"BILLTOLASTCHANGEDDATE": "2019-06-12T03:50:29.743Z",
"CHANGEDUSER": "string",
"IDPK": 0,
"CHANGEDTIMESTAMP": "2019-06-12T03:50:29.743Z"
}
}

Can you please help me for passing the Path parms with datastructures.?

Thanks for all the help





On Tue, Jun 11, 2019 at 3:28 PM Nadir Amra <amra@xxxxxxxxxx> wrote:

Only one parameter is allowed to not be injected from an input source.

And if you have a structure as an input parameter, then your only options
for HTTP methods are POST and PUT.

So in your case, since you have a URI with template variables you want to
inject into parameters, you MUST redefine parameters so that there is only
one structure (the structure may have any number of nested structures).

And I think you are trying to inject a template variable into a structure,
which is not allowed. You are only allowed to inject values into
primitive types, like a char type.


"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 06/11/2019 02:16:14
PM:

From: anshul narang <narang.anshul@xxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 06/11/2019 02:17 PM
Subject: [EXTERNAL] [WEB400] IWS:Multiple data structures Input in
web-services
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

HI All

I am facing peculiar situation as I have program which has multiple data
structures in web services.

dcl-Pi main ;
p Packed(10);
Mode Char(1);
File Char(15);
HEADR_IN likeDS(t_Headquarters_Service);
BILL_IN likeDS(t_BillTo_Service);
HEADR_OUT likeDS(t_Headquarters_Service);
BILL_OUT likeDS(t_BillTo_Service);
Error Char(1000);
Status Char(1);
end-Pi;


So while deploying the web services using IWS , which method should be
used to pass these data structures. I am getting the following error in
IWS.

Procedure name: MAIN
URI path template for resource: /{p}/{Mode}/{File}/{HEADR_IN}/{BILL_IN}
HTTP request method: GETPUTDELETEPOST
URI path template for method: - Other -or...*NONE
HTTP response code output parameter: *NONE
HTTP header array output parameter: *NONE
Allowed input media types: - Other -or...*ALL*XML*JSON*XML_AND_JSON
Returned output media types: - Other -or...*XML*JSON*XML_AND_JSON
[image: ZUI_54401: The procedure may contain an input parameter that is
an
array, or more than one input parameter is a structure, or there is a
primitive input parameter with a type other than "int", "char", "byte",
"float", "packed" or "zoned". In this situation only Wrap input
parameters
can be selected or you can update your program and try again.]Whether to
wrap input parameters:
Wrap input parameters
Do not wrap input parameters

Input parameter mappings:
Parameter nameData typeInput sourceIdentifierDefault Value
P packed - Select -*QUERY_PARAM*PATH_PARAM*FORM_PARAM*COOKIE_PARAM
*HEADER_PARAM*MATRIX_PARAM*NONE - Other -or...*NONE
MODE char - Select -*QUERY_PARAM*PATH_PARAM*FORM_PARAM*COOKIE_PARAM
*HEADER_PARAM*MATRIX_PARAM*NONE - Other -or...*NONE
FILE char - Select -*QUERY_PARAM*PATH_PARAM*FORM_PARAM*COOKIE_PARAM
*HEADER_PARAM*MATRIX_PARAM*NONE - Other -or...*NONE
HEADR_IN struct *NONE
BILL_IN struct *NONE


ZUI_54401: The procedure may contain an input parameter that is an
array,
or more than one input parameter is a structure, or there is a primitive
input parameter with a type other than "int", "char", "byte", "float",
"packed" or "zoned". In this situation only Wrap input parameters can be
selected or you can update your program and try again.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.