How can I receive a request from remote request in Mule anypoint? - mule

I am sending a request with XML Data to an anypoint URL after an order is created from my site. How can receive this data and save it as file and upload to a ftp?
I am new in mulesoft. Please help.

Are you exposing it via HTTP endpoint?
If so then to receive response just save the response payload.
flowVars.response = #[message.payload]
Then write to ftp path using ftp connector.
show your Xml config to help further.

Related

Mule 4 Anypoint Studio download file from external api

I will need to create a flow in Anypoint to download a .gz file from an external API source(through OAuth). I have created a listener -> Request -> Write flow. But I don't see the file saved in my local after I called the API. I have hardcoded Bearer token in the header and raw parameters in body, everything looks good. It doesn't show any error but when I tried to debug it and I'm seeing output and payload both are empty. I'm able to download the gz file with Postman. Am I in the right direction? I saw someone was using outbound endpoint but it is not showing in Mule 4.
Is there any way I can see what the external API returned(Success or failed)? And the content? Please advise.
Many thanks.
Regards,
Richard
Update 1:
Mule Flow
DEBUG
Added the Flow and the Debugging message. I have simplified the flow and just tried to make the POST rest call with Bearer token. It should return a json response. But still getting an empty response. Do we know what's that java.util.LinkedHashMap thing? Thanks.
Update 2:
Request Body
Request Header
XML Configuration:
XML Flow
You can add loggers to the application to trace the execution.
You could also enable HTTP wire logging to print requests/responses in the log too. To enable it you have to set the package org.mule.service.http.impl.service.HttpMessageLogger to DEBUG in the log4j2.xml or in the Runtime Manager console. Detailed instructions available at this KB article.

how to attachment a file to an xml request with postman?

Hello friend I need to make a request that I manage to do correctly from SOAP-UI but now in postmant , from SOAP-UI I do the following
I attchemnt a file and configure my request as follows
now I want to replicate this in postman but I don't know how to help me.
One option would be to send the bs64 inside the field

Azure logic app API http response with excel file download using Postman

Created azure logic app HTTP request it gives response for normal JSON schema However, I want to attach SharePoint excel sheet when I trigger the request from Postman.
1.How to used content type or schema to download the attached file. when postman request sent.
2.is that possible to download when you hit API through logic app
3.Generated HTTP POST URL is working
For your requirement, I test it in my side. It seems we do not need to set any value for "Content-Type" in headers of response. Please refer to my logic app below:
Then when you request the logic app url in postman, please choose "Send and Download" instead of "Send".
After that, you can download the file when request the url in postman.

Sending text file to Jenkins via remote trigger - from excel (VBA)

I have a job in Jenkins that accepts a text file parameter.
Builds are triggered from an excel macro - and I'm having difficulty understanding how to send the file to Jenkins.
Up until now, what I understood is the following:
the file must be sent in an HTTP POST request, in the body.
the file must be sent in multipart/form-data format.
What I can't seem to manage to find out:
how exactly do I encode my file to multipart/form-data in VBA?
how do I send multiple files to Jenkins in the same HTTP POST request?
More information that might be helpful:
I'm using MSXML2.XMLHTTP60.
The job has other parameters (string, password), so I'm using the format:
http://server/job/myjob/buildWithParameters?PARAM1=Value1&PARAM2=Value2
Thank you in advance for any help.
EDIT:
After a lot of headeache, I discovered that currently, the option of sending a file parameter via an http POST request is not supported:
https://issues.jenkins-ci.org/browse/JENKINS-56169
But it has been opened as a new feature request.
The only option is pretending to be the web browser, and sending an http POST request identical to the one the Jenkins server is expecting to receive.
This poses the problem I described in the Jenkins Issue - the server's response doesn't contain the item's location in the queue.

Get file behind html form

I have a file I want to download. The file is secured with a html form:
Login Screen
I want to download the following URL to the Payload: https://10.10.0.18/history/information.csv
What function do I use in Mule and is it even possible?
For Basic authentication with only username and password, you can use HTTP request connector followed by a file outbound endpoint
Refer :- https://developer.mulesoft.com/docs/display/current/Authentication+in+HTTP+Requests
https://developer.mulesoft.com/docs/display/current/Authentication+in+HTTP+Requests#AuthenticationinHTTPRequests-basic
You can also look the following reference :- Mule ESB download file from URL string