0

I'm on wso2 mi trying to log json response objeect returned from target endpoint the enpoint return json but when i tried to test wos2 exposed api i got:

[2025-04-17 17:26:04,349] ERROR {JsonStreamBuilder} - Error occurred while processing document for application/json

My api

`

        <call>
            <endpoint key="todos-server"/>
        </call>

        <log level="custom">
            <property name="ContentType" expression="get-property('axis2', 'ContentType')"/>
            <property name="RawResponse" expression="$body"/>
        </log>

        <property name="CHARACTER_SET_ENCODING" value="UTF-8" scope="axis2" type="STRING"/>
        <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
        

        <log level="custom">
                <property name="JsonResponse" expression="json-eval($)"/>
        </log>
        
        <respond/>
    </inSequence>
` the problem is that if i test api from postman or navigator directly everything work fine`

1 Answer 1

0

This issue happens when the payload you are doing json-eval is a malformed json payload. Verify whether it is a valid json payload.

Sign up to request clarification or add additional context in comments.

1 Comment

it is a valid json i guess the problem is related to the target endpoint i had to set Accept-Encoding header value to empty string ""

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.