我正在使用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>
您可以看到通话中有些混乱,我需要弄清楚是什么,并且能够分析有效负载将对此有所帮助。
感谢您的帮助。
答案 0 :(得分:0)
我看到您发送带有“ Content-Encoding”标头且值为gzip的有效负载。通过端点发送内容之前,请使用以下内容并尝试删除内容编码。
<header action="remove" name="Content-Encoding" scope="transport"/>