Getting MULE:SOURCE_RESPONSE_SEND while using FTP/SFTP connector in Mule API - ftp

I have 2 APIs:
system API: which is reading a file from the SFTP server
process API: processing the file coming from system API and sending data to backend using batch
I am transforming the payload coming from the read connector in system API to application/csv. Also, I am converting the CSV payload to application/java before inserting the records into the batch.
The process API is working correctly (data going to backend) but in the logs, I am seeing MULE:SOURCE_RESPONSE_SEND.
Root Exception stack trace: java.lang.RuntimeException: Attempted to send invalid data through the HTTP response.
When I am changing the error response of HTTP listener to simple String "Data processing completed". This is the payload I am seeing as a response.
Where exactly might be this error Root Exception stack trace: java.lang.RuntimeException: Attempted to send invalid data through HTTP response coming from?
Thanks in advance!

Related

How to send a file through http post using Data Fusion

Wanted to send a file to an http end point url using Data fusion.
Making this http call as a pipeline alert at the completion of the pipeline.
This is not working. Getting 500 response from API. Can someone help me on how do I send the file?
If this can be achieved with http plugin as sink, please let me know the steps.
I doubt you can send files using HTTP. You can create a request using the HTTP plugin as I answered one of your previous question - Data Fusion - Issue with http post plugin.
In HTTP Callback you can find information:
This action can be used when you want to perform an HTTP request at the end of a pipeline run.
Using this plugin, you can send a request or text, not a file.
If you would like to send a file, you should use File like it's mentioned in this thread: Some questions about google Data fusion
Regarding Error 500
The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
It means that there is an issue with your endpoint. It might be a firewall or HTTP server issue. Too many possibilities of what could be wrong with current details.
In addition, you can find some additional information in doc Ingest CSV data to BigQuery using Cloud Data Fusion - Batch ingestion

Get Response payload through Datapower gateway script for invalid XML

I'm using IBM API connect & IBM DataPower 2018.
I have a SOAP web service, and I need to do some customized logging for it by capturing the request\response payload.
When the service returns a valid XML, or even SOAP exception, I could easily handle such cases, and save the request\response payload in separate DB schema for operational purposes.
I updated the response payload by returning non XML response from the backend, like "ABCDEFGHI....".
when I call this service through datapower, it returns clear response.
<errorResponse>
<httpCode>400</httpCode>
<httpMessage>Bad Request</httpMessage>
<moreInformation>Invalid XML payload received.</moreInformation>
</errorResponse>
But I am unable to capture the message.body payload which is in my case "ABCDEFGHI..", the apim.getvariable('message.body') returns nothing.
My question:
How to capture the invalid response payload (none well XML) for SOAP service by using Gateway script?
You can't... as the the message will be rejected prior to processing since DataPower will set the message type to SOAP it will reject anything not being SOAP.
You would need to pass it through a "chaining" API (or service on the DataPower instance) which could capture the response payload.

Request for an auth token using Spring OAuth 2.0 fails with error code "500 Internal Server Error" for scope read and write

I have configured Spring OAuth 2.0 in my application. I am requesting for access token using advanced rest client. This works and I get back a token in response when I pass scope=read or scope=write in payload.
working request for read
working request for write
But when I send read write together both in same request, It gives me an error saying "500 Internal Server Error".
For read write request the payload I am sending is:
grant_type=password&scope=read+write&client_id=BankingModule&client_secret=B90-388F-4EE-9758-CDA602&username=myuser&password=password
Please help me out.

Getting 400 Bad request error when sending huge amont of data with post

I am using yahoo YUI Ajax call to post request.
Page is developed in JSP and server is Tomcat 6 and using Struts 2.x.
While i am sending small amount of data using Ajax call post request it is working fine.But when i am sending huge amount of data i am getting 400 bad request error.
The 400 error comes when The Web server thinks that the data stream sent by the client (e.g. your Web browser ) was 'malformed' i.e. did not respect the HTTP protocol completely. So the Web server was unable to understand the request and process it.
There could be possibilities that data is too large, so you should better encode the data using java script inbuilt function for example escape().
Please check maxPostSize attribute of Connector in conf/server.xml.
See the following doc for the details
In Tomcat, when the post data exceeds the maximum specified in maxPostSize (server.xml) it returns a 400 as error code

What does this gSoap fault message mean?

I am using gSoap to communicate with the web service. I am using Qt to create application that uses gSoap. I am getting following fault message for some of the calls
SOAP 1.1 fault: "http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher":DeserializationFailed[no subcode]
"The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'GetPendingCommands'. Unexpected end of file. Following elements are not closed: Body, Envelope. Line 2, position 459."
Can someone please explain me what could be wrong with the service?
Thanks
DPatel
If chunking is turned on in your client side code, try turning it off. I seem to recall that you have to do something special with gSoap to get it to support chunking on the server side.
The error message means the client has received a truncated SOAP envelope. This often happens if the web service neglects to flush its output buffer before returning.

Resources