IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  How set inputs on rest service get?

    Posted 11/09/21 12:23 PM

    What product/components do you use and which version/fix level?

    IS 10.5

    What are trying to achieve? Please describe in detail.

    I have a flow service named sumar
    image
    Input/Output

    I have a Rest resource

    And it descriptor


    Swagger:

    ---
    swagger: "2.0"
    info:
    description: "API de una calculadora"
    version: "1.0"
    title: "calculadora"
    host: "127.0.0.1:5555"
    basePath: "/rad/Pruebas.api:calculadoraDescriptor"
    schemes:
    - "http"
    consumes:
    - "application/json"
    produces:
    - "application/json"
    paths:
    /sumar:
    get:
    description: ""
    operationId: "sumar_GET_1"
    parameters:
    - in: "body"
    name: "request"
    description: ""
    required: true
    schema:
    $ref: "#/definitions/request"
    responses:
    200:
    description: "OK"
    schema:
    $ref: "#/definitions/sumar_GET_response"
    401:
    description: "Access Denied"
    definitions:
    response:
    required:
    - "resultado"
    properties:
    resultado:
    type: "string"
    sumar_GET_response:
    required:
    - "response"
    properties:
    response:
    $ref: "#/definitions/response"
    request:
    required:
    - "num1"
    - "num2"
    properties:
    num1:
    type: "string"
    num2:
    type: "string"
    
    

    When I execute in postman this response null

    Ive tried with savePipeline and restorePipeline and can not see my variables request/num1 and request/num2

    What’s wrong?

    Regards,
    Jesus


    #Integration-Server
    #REST
    #webMethods


  • 2.  RE: How set inputs on rest service get?

    Posted 11/09/21 12:51 PM

    GET normally does not have a body. Various components may ignore a body when present.

    But in case that’s not happening here, the expected input document is named “request”. Your Postman body does not have that. Instead, it has an anonymous object with 2 string fields. Adjust that and it may work.


    #webMethods
    #REST
    #Integration-Server


  • 3.  RE: How set inputs on rest service get?

    Posted 11/09/21 12:54 PM

    Thank you for your reply.

    Ive adjust the body with request object and not working yet.

    Can you tell me more, please?


    #REST
    #webMethods
    #Integration-Server


  • 4.  RE: How set inputs on rest service get?

    Posted 11/09/21 04:51 PM

    As @reamon indicated you can’t post a body with GET.
    If you want to use GET provide the two inputs via query params
    e.g.
    /sumar?num1=1&num2=99

    Then update your service to remove ‘request’ document wrapper and simply have num1 and num2 as your inputs to your service.

    If you want to use a body, you will have to provide a POST based API.
    regards
    John.


    #webMethods
    #Integration-Server
    #REST