IBM i Global

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
#Power
 View Only
  • 1.  404 error when using multiple path parameters in IBM i IWS

    Posted yesterday

    I am building a REST API using IBM i Integrated Web Services (IWS).

    Currently, the API works correctly when I pass a single path parameter (customer number) and returns the expected record.
    For example, the following URL returns a valid response when I pass customer number 01010:

    http://localhost:10099/web/services/CUSTQRYXX/01010

    Now I would like to pass multiple path parameters, such as customer number and area code, to retrieve a record using both values.

    I tried calling the API with an additional path parameter (area code 02) as shown below, but this results in a 404 Not Found error:

    http://localhost:10099/web/services/CUSTQRYXX/01010/02

    The parameters in IWS are configured as path parameters.

    My questions are:

    • Is it supported to specify multiple path parameters in an IWS REST service?

    • If so, what configuration is required on the IWS side to handle multiple path parameters?

    • Are there common causes of a 404 error in this scenario (IWS service definition, parameter mapping, ILE program interface, URL format, etc.)?

    Any guidance or examples would be greatly appreciated...

    Thank you



    ------------------------------
    SAKURA KOGA
    ------------------------------


  • 2.  RE: 404 error when using multiple path parameters in IBM i IWS

    Posted 17 hours ago
    Edited by Satid S 17 hours ago

    Dear Koga-san

    Have you tried :   localhost:10099/web/services/CUSTQRYXX?customer_number=01010&area_code=02 



    ------------------------------
    Satid S
    ------------------------------



  • 3.  RE: 404 error when using multiple path parameters in IBM i IWS

    Posted 8 hours ago

    In order to specify multiple pieces of information in path, you must deploy web service with URI path template.  Something like /{custno}/{areaCode}.  And then you need to inject those parameters in corresponding input parameter.  

    Example is given in https://www.ibm.com/support/pages/system/files/inline-files/IWS-Building-REST-Service-Part-3_0.pdf, figure 11. 



    ------------------------------
    Nadir K Amra
    ------------------------------