WSO2 EI показывает JSON полезную нагрузку в проводных журналах - PullRequest
0 голосов
/ 10 апреля 2020

Я использую WSO2 EI 6.2. Я пытаюсь отладить API, который использует JSON полезную нагрузку. Я активировал журналы проводов. Тем не менее, полезная нагрузка неразборчива. Любые идеи о том, как я могу это исправить?

Чтобы проиллюстрировать, это часть моего кода:

                        <payloadFactory media-type="json">
                            <format>
                                {
                                  "parameters": [
                                    {
                                      "name": "Device.WiFi.Radio.10000.Channel",
                                      "value": "$1"
                                    }
                                  ]
                                }
                            </format>
                            <args>
                                <arg expression="$ctx:channel"/>
                            </args>
                        </payloadFactory>
                        <log level="full">
                            <property name="step" value="ANTES CALL"/>
                            <property name="mac" expression="$ctx:uri.var.macAddress"></property>
                        </log>
                        <!-- set the authorization header -->
                        <header expression="$ctx:authorizationHeader" name="Authorization" scope="transport"/>
                        <call>
                            <endpoint key="gov:ClientEquipments/endpoints/WACS/wacs_update_parameters.endpoint.xml"/>
                        </call>
                        <log level="full">
                            <property name="step" value="DEPOIS CALL"/>
                        </log>

Тогда журналы показывают:

[2020-04-10 10:32:14,703] [EI-Core]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:2bf02b1c-ab7e-48bb-a766-260bfdc65c57, Direction: request, step = ANTES CALL, mac = 840B7C183370, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><jsonObject><parameters><name>Device.WiFi.Radio.10000.Channel</name><value>1</value></parameters></jsonObject></soapenv:Body></soapenv:Envelope>
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "POST /wacs/cpe_gm/v1/MACAddress=840B7C183370/parameters HTTP/1.1[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Authorization: Bearer ded82872-a4a8-367b-96bb-eda7c11f4120[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Access-Control-Allow-Origin: *[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Access-Control-Allow-Methods: GET[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Content-Encoding: gzip[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Vary: Accept-Encoding[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,St2-Api-Key,lastModifiedTime,x-log,ApimAuthToken[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "X-NAME-Manifest-Endpoint: /manifest[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Request-Context: appId=[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Content-Type: application/json[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Transfer-Encoding: chunked[\r][\n]"
[2020-04-10 10:32:14,707] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Host: 10.217.49.9:8280[\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Connection: Keep-Alive[\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "[\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "6a[\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "[0x1f][0x8b][0x8][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0xab][0xe6][0xe2][0x84][0x1][0x5][0x5][0xa5][0x82][0xc4][0xa2][0xc4][0xdc][0xd4][0x92][0xd4][0xa2]b%+[0x85]hd)[0x5][0x85]jT.Pu[0x1e]P-P[0x9d][0x92]KjYfr[0xaa]^x[0xa6][[0xa6]^PbJf[0xbe][0x9e][0xa1][0x1][0x10][0xe8]9g$[0xe6][0xe5][0xa5][0xe6]([0xe9]`[0xe8],K[0xcc])[0x5]k5TB[0x95][0xab]E[0xe6][0xc6]"8[0xb5][0x0][0x81][0xf5][0xe][0x7][0xa8][0x0][0x0][0x0][\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "0[\r][\n]"
[2020-04-10 10:32:14,708] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "HTTP/1.1 500 Internal Server Error[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Access-Control-Allow-Origin: *[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Access-Control-Allow-Methods: POST[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,St2-Api-Key,lastModifiedTime,x-log,ApimAuthToken[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Request-Context: appId=[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Date: Fri, 10 Apr 2020 09:32:15 GMT[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Transfer-Encoding: chunked[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "Connection: Keep-Alive[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "0[\r][\n]"
[2020-04-10 10:32:14,749] [EI-Core] DEBUG - wire HTTP-Sender I/O dispatcher-5 >> "[\r][\n]"
[2020-04-10 10:32:14,751] [EI-Core]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:df03495c-99fd-4c9a-84fd-5320af502a40, Direction: request, step = DEPOIS CALL, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns:binary xmlns:ns="http://ws.apache.org/commons/ns/payload"></ns:binary></soapenv:Body></soapenv:Envelope> 

Как вы можете видеть, что в вызове что-то не так, и мне нужно выяснить, что, и возможность проанализировать полезную нагрузку поможет с этим.

Спасибо за любую помощь.

1 Ответ

4 голосов
/ 10 апреля 2020

Я вижу, что вы отправляете полезную нагрузку с заголовком «Content-Encoding» со значением gzip. Пожалуйста, используйте следующее и попробуйте удалить кодировку содержимого перед отправкой через конечную точку.

<header action="remove" name="Content-Encoding" scope="transport"/>
...