繁体   English   中英

WSO2 EI 在线路日志中显示 JSON 有效载荷

[英]WSO2 EI show JSON payload in wire logs

我正在使用 WSO2 EI 6.2。 我正在尝试调试使用 JSON 有效负载的 API。 我已经激活了电线日志。 然而,有效载荷是难以理解的。 关于如何解决这个问题的任何想法?

为了说明,这是我的代码的一部分:

                        <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> 

正如您所看到的,调用中有一些东西很混乱,我需要弄清楚是什么,并且能够分析有效负载将对此有所帮助。

谢谢你的帮助。

我看到您发送带有“内容编码”header 且值为 gzip 的有效负载。 请使用以下内容并尝试在通过端点发送之前删除 Content-Encoding。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM