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.

 View Only
  • 1.  Content type application/xml for RESTv2 resource

    Posted Wed March 22, 2023 05:27 AM

    Hi guys,

    I have to expose a rest endpoint which should receive a request using content type application/xml. I created a new rest resource, defined a new service to be called but when sending a request from Postman no inputs are received according to the saved pipeline. Do I need some additional configurations for application/xml? I also tried to get the input from variables node/ffdata/contentStream but with no luck so I don’t think that the request is coming using this format.
    Do you have any ideas how I can achieve this?

    Thanks,
    n23


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Content type application/xml for RESTv2 resource

    Posted Wed March 22, 2023 07:48 AM

    We need more info, can you post the request including payload. Have you defined the signature of service to match ?
    Add a savePipeline as a first step to the service and then after testing the service, call restorePipeline to see what actually got put in the pipeline.
    John.


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Content type application/xml for RESTv2 resource

    Posted Wed March 22, 2023 09:29 AM

    The flow which is called has as input a document type matching the exact XML structure from the input that I pass in Postman. I also added a savePipelineToFile as the first step in the called flow and after disabling it and adding a restorePipelineFromFile step, the pipeline only contains fileName (the input passed to savePipelineToFile which was not dropped) meaning that it looks as if the request comes empty. For rest apis using application/json it works flawlessly.


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Content type application/xml for RESTv2 resource

    Posted Wed March 22, 2023 10:02 AM

    I just did a test on my side, the issue is that in the case of application/xml you get an xml node as input called node.
    You need to first invoke the service ‘pub.xml:xmlNodeToDocument’

    Careful when mapping the output document as it represents all the possible inputs, your doc will be a child element.

    regards
    John.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Content type application/xml for RESTv2 resource

    Posted Wed March 22, 2023 10:06 AM

    Now this is the thing :slight_smile: If I call the endpoint on my dev server I get the node input, but in prod I don’t get it and really don’t understand what is the difference as if I compare the flows from dev and prod I don’t get any difference. Could there be some system extended variable affecting this somehow?


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Content type application/xml for RESTv2 resource

    Posted Fri March 24, 2023 03:22 AM

    Refer to this page of the documentation

    https://documentation.softwareag.com/webmethods/integration_server/pie10-15/webhelp/pie-webhelp/index.html#page/pie-webhelp%2Fto-content_handlers_5.html%23

    It refers to content handlers, there are a few watt settings, perhaps this will show the difference.
    John.


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Content type application/xml for RESTv2 resource

    Posted Fri March 24, 2023 04:53 AM

    Thanks for the reference!
    I could not find any differences between dev and prod when it comes to the watt settings but strangely enough I made it work in prod by changing the content type from application/xml to text/xml. It seems that this content type works for both dev and prod. I asked the client to add a policy in Azure API Management to override the content type.


    #webMethods
    #Integration-Server-and-ESB