How do we download/write an xml file to our local system when we call an API via an HTTP request in webmethod io integration?
Hi @kranshi123 ,
The response from the HTTP request will be in your pipeline. From there you can do what you need to with the response. Please bear in mind though that if the HTTP Request returns a large amount of data, you may be unable to process this easily.
Whats the use-case, what do you need to do with the HTTP request response and where do you want to write it, i.e. what is “our local system”?
Use case: we retrieve XML data from the http requester and Download the XML file to a certain folder.
After that, convert the XML to a flatfile.
The HTTP response will be in your ‘pipeline’, so you can map this response into any other connector/action - there’s no need to write a ‘local file’.
You also don’t need to use workflow to do this by the way.
The FlowService example I posted over here: (How to transform XML TO FLATFILE IN WEBMETHOD IO INTEGRATION? - Forum - webMethods - Software AG Tech Community & Forums) does exactly what you’re asking. donwloads an XML from a HTTP end point and converts this to a flat file. After you’ve got the CSV data, then you’ll probably want to send that somewhere else, e.g. Amazon S3 bucket, or SFTP for example.
In workflow http request, receiving xml file is good, but in flow service httprequest, getting xml file is not good, for specific url it includes some essential data like user, password, date range which I have placed in url params. Please see the attached file. please find attached file.could you please suggest how to move forward in flowservice.
Could you please provide above solution and also for date range search should be dynamic?. I am trying in flow service. How can I achieve in flow service?
You can do this also in FlowService.
Use a transform pipeline before the HTTP call to create the args data structure and populate the values as shown here:
Then on the http call, map the args into the data like so:
This will pass the parameters to the URL as you can see here from the debug view:
There’s also an auth section where you can provide auth credentials/etc, and can provide any http headers you want to send in a similar way you provide the args.
I followed your instructions, however i am getting an security exception. Please find attached image.
Can you share what the http input looks like, blurring anything sensitive?
Required Fields for Date Range search: LOGIN_USERID, LOGIN_PASSWORD, invType, fromDate, toDate, and dateType for Url(https://my.domain.com/mydomain-api/national/servlet?CONTROLLER=com.domain.ec.rexinvoice.http.controller.InvoiceXMLAPIController)
I made some changes, It is working properly Dave,
Thanks for your assistance.
urlEcho.zip (8.1 KB)
I created another sample that uses https://httpbin.org/ to echo back the response.
Posted it here to help others who find this in the future and struggle
is there a sample file xml to flatfile mapping by adding rules, Dave? I’m not sure how to use rules in flow service.please find attached images