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?
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.
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.
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.
Now this is the thing 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?
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.