I have a WSO2 Micro Integrator proxy that calls a WSDL endpoint. The response is a SOAP envelope containing a list of documents, each with a contents field that holds a Base64-encoded file. I extract this Base64 content, convert the response to JSON, and send it to a Spring Boot service. However, I encounter the following error when sending the request:
[2025-03-28 23:51:41,696] ERROR {Axis2Sender} - {proxy:CallbackDecision} Unexpected error during sending message out. Error getting GZIP output stream org.apache.axis2.AxisFault: Error getting GZIP output stream
Observations:
When I intercept the HTTP request in Spring Boot, the body appears as bytes with weird characters instead of a valid JSON string.
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens
If I hardcode the payload in WSO2 (instead of processing the SOAP response), the request to the backend service works fine (only if I disable the wsdl endpoint call or if response does not contains base64 or the response if a fault (small)).
<sequence>
<property name="uri.var.loanId" scope="default" type="STRING"
expression="//mi:numDemande"
action="set"
xmlns:mi="http://mi.sofac.ma" />
<log category="INFO" level="full">
<property name="loanID" expression="$ctx:uri.var.loanId" />
</log>
<payloadFactory media-type="xml" template-type="default">
<format><docListReception
xmlns="******">
<offerId xmlns="">309264</offerId>
<dealerLogin xmlns="">SAMG1001</dealerLogin>
<documentType xmlns=""></documentType>
<documentNature xmlns=""></documentNature>
<documentCode xmlns="">D0053</documentCode>
</docListReception></format>
<args>
</args>
</payloadFactory>
<header name="Action"
value=" " />
<call>
<endpoint key="DocListReception" />
</call>
<property name="base64" action="set" type="STRING"
expression="//fileContents"></property>
<log category="INFO" level="simple">
<property name="base64" expression="$ctx:base64" />
</log>
<payloadFactory media-type="json" template-type="default">
<format> {"docsToUpload":[{"fileNature":"A0023","fileType":"CONTRACT",
"fileCode":"D0051","fileContents":"$1", "longLabelDocument":"Proces
verbal de reception SFP"}]} </format>
<args>
<arg evaluator="xml" expression="$ctx:base64" />
</args>
</payloadFactory>
<call>
<endpoint key="samStagingUploadFD" />
</call>
</sequence>
I pretty sure that the problem is not while converting, but while sending.
can I someone help me ^^