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?

PLEASE FIND ATTACHED FILE FOR YOUR REFERENCE

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”?

Hi Dave,

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.

Thanks,
Kranshi

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.

Hi Dave,

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.


Thanks,
Kranshi

Hi Dave,

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?

Thanks,
Kranthi

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.

1 Like

Hi Dave,

I followed your instructions, however i am getting an security exception. Please find attached image.
Thanks,
Kranshi
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.

1 Like

Perfect :slight_smile:
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

1 Like

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

in flow service you’ll can you use if statements/switch statements ( FlowServices - webMethods.io Integration) in the logic to create conditional logic in the Flowservice, or you can add conditions onto a map ( FlowServices - webMethods.io Integration) to create conditional mapping.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.