|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Unconvertable character Error while Parsing JSON |
« View previous topic :: View next topic » |
Author |
Message
|
MrLight |
Posted: Sun Jan 08, 2023 10:38 pm Post subject: Unconvertable character Error while Parsing JSON |
|
|
Novice
Joined: 04 Aug 2022 Posts: 14
|
I am doing a POC to test a service JSON Based API Format. It's a simple flow where I use:
HttpInput Node --> Compute Node --> HTTPRequestNode--> Compute Node --> HttpReply Node , send an HTTP Request and read the response.
The call is successful and i am getting the response on the client tool
but I am getting an 'Unconvertable Character' when i enable the debugger mode to check the the tree or create new OutputRoot .
in the 1st Compute node i tried to change the CCSID with 1208 as below :
Code: |
SET OutputRoot.Properties.CodedCharSetId = 1208; |
same also in the 2nd compute node but with the response :
Code: |
SET OutputRoot.HTTPResponseHeader."Content-Type" ='application/json; charset=utf-8';
SET OutputRoot.Properties.CodedCharSetId=1208 |
the following Exception List generated:
Code: |
ExceptionList
RecoverableException
File:CHARACTER:C:\ci\product-build\WMB\src\DataFlowEngine\MessageServices\ImbDataFlowNode.cpp
Line:INTEGER:1577
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmWSInputNode
Name:CHARACTER:MsgTrans#FCMComposite_1_1
Label:CHARACTER:MsgTrans.HTTP Input
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
Insert
Type:INTEGER:14
Text:CHARACTER:MsgTrans.HTTP Input
RecoverableException
File:CHARACTER:C:\ci\product-build\WMB\src\DataFlowEngine\SQLNodeLibrary\ImbComputeNode.cpp
Line:INTEGER:343
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:MsgTrans#FCMComposite_1_8
Label:CHARACTER:MsgTrans.array
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
Insert
Type:INTEGER:14
Text:CHARACTER:MsgTrans.array
RecoverableException
File:CHARACTER:C:\ci\product-build\WMB\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
Line:INTEGER:785
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:.full_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:11.3
Insert
Type:INTEGER:5
Text:CHARACTER:SET OutputRoot.JSON = InputRoot.JSON;
RecoverableException
File:CHARACTER:C:\ci\product-build\WMB\src\CommonServices\ImbConverter.cpp
Line:INTEGER:944
Function:CHARACTER:ImbConverterCPP::internalToUnicode
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2135
Text:CHARACTER:Unconvertable character
Insert
Type:INTEGER:5
Text:CHARACTER:8b
Insert
Type:INTEGER:5
Text:CHARACTER:1f8b0800000000000000abe652000225cfbcc2d2cca2caa0d4e282fcbce254252b052503251d2e4e259888737e
Insert
Type:INTEGER:2
Text:CHARACTER:1208 |
|
|
Back to top |
|
 |
new2MB |
Posted: Thu Nov 02, 2023 2:21 am Post subject: |
|
|
Novice
Joined: 04 Jun 2014 Posts: 11
|
I am facing similar issue. were you able to find the solution for this problem?
please share your feedback. |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Nov 02, 2023 2:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Code: |
Text:CHARACTER:Unconvertable character
Insert
Type:INTEGER:5
Text:CHARACTER:8b
Insert
Type:INTEGER:5
Text:CHARACTER:1f8b0800000000000000abe652000225cfbcc2d2cca2caa0d4e282fcbce254252b052503251d2e4e259888737e
Insert
Type:INTEGER:2
Text:CHARACTER:1208
|
The bad byte is hex 8b.
There is an 8b in the 2nd byte of the data. _________________ Glenn |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Nov 07, 2023 2:13 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
I thought "1f 8b" was familiar. Now it's occurred to me. Its the standard ID prefix on GZIP encoded data, as per RFC 1952/.
Its likely that the http request specified that it will accept GZIP encoded response data, but your response handler is not decoding it. Or, the request specified that it will not accept GZIP encoded response data, but the web server is unexpectedly sending the response as GZIP encoded.
We struck this very same issue in the last year. _________________ Glenn |
|
Back to top |
|
 |
mgk |
Posted: Wed Nov 08, 2023 3:47 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
I thought "1f 8b" was familiar. Now it's occurred to me. Its the standard ID prefix on GZIP encoded data |
Well spotted, great find
The HTTPRequestNode has an option in the "Advanced" properties called "Accept compressed responses by default". The docs for this option say:
"This property indicates whether the request node handles compressed responses by default.
If the request header does not contain an Accept-Encoding header and this option is selected, the node sets the Accept-Encoding header to "gzip, deflate", and any compressed response that is received is decompressed by the node.
If the message propagated to the Request node includes an Accept-Encoding header, the message flow or client application should handle any compressed response. Therefore selecting this option has no effect in that case."
So check the message you are sending. If you have an "Accept" header (which may be from you original Input message) remove it and check this option. To see what is being sent either use a proxy to look at the message on the wire or put a trace node before and after the HTTPRequest node. The HTTP*Headers will show you what headers were present...
Kind regards. _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|